Image decoding and encoding method, apparatus, device, and storage medium
By acquiring feature channel and spatial point differentiation information to construct inverse quantization precision parameters, the problem of insufficient quantizer performance in existing technologies is solved, and more efficient image encoding and decoding performance is achieved.
Patent Information
- Application Number
- CN202411379276.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-01
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-03-01
AI Technical Summary
In existing technologies, the performance of quantizers during image encoding and decoding is poor, failing to effectively consider the differences in feature channels and image textures, resulting in limited quantization performance.
By acquiring feature channel differentiation information and/or spatial point differentiation information, inverse quantization precision parameters corresponding to each quantization residual value are constructed, and inverse quantization and synthesis transformation are performed to improve quantization precision.
By setting different quantization parameters based on the differences in feature channels and spatial point image texture, the quantization loss of important features is reduced, thereby improving encoding and decoding performance.
Smart Images

Figure CN119110069B_ABST
Abstract
Description
[0001] The present application is a divisional application of the Chinese Invention Patent Application No. 202310209226.1, with the title of "Image decoding and encoding method, device, equipment and storage medium", and the filing date of March 1, 2023. TECHNICAL FIELD
[0002] The present application relates to the technical field of image processing, in particular to an image decoding and encoding method, device, equipment and storage medium. BACKGROUND
[0003] The end-to-end image encoding and decoding technology generally includes analysis transform network, synthesis transform network, context-based prediction, quantization, entropy coding, super coding network, super scale decoding network and other modules. The quantization is a "many-to-one" mapping process, which will cause signal loss. The quantization acts on the residual, 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. However, generally, the quantization module does not consider the difference between feature channels and image textures when performing quantization, thereby limiting the quantization performance of the quantizer.
[0004] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0005] The main purpose of the present application is to provide an image decoding and encoding method, device, equipment and storage medium, which aims to solve the technical problem of poor performance of the quantizer in the image encoding and decoding process of the prior art.
[0006] To achieve the above purpose, the present application provides an image decoding method, which comprises the following steps:
[0007] Obtain feature channel differentiation information and / or spatial point differentiation information, and decode the image code stream to obtain quantized residual values;
[0008] According to the feature channel differentiation information and / or the spatial point differentiation information, construct the inverse quantization precision parameters corresponding to each quantized residual value;
[0009] For any one quantized residual value, based on the inverse quantization precision parameter corresponding to the quantized residual value, the quantized residual value is inverse quantized to obtain a reconstructed residual value;
[0010] Synthesis transform is performed on the reconstructed residual value to obtain a reconstructed image block.
[0011] In a possible implementation of the present application, the step of decoding the image code stream to obtain the quantized residual value comprises:
[0012] extracting the coding distribution parameter from the first image code stream;
[0013] decoding the coding distribution parameter to obtain a probability distribution parameter;
[0014] quantizing the probability distribution parameter to obtain a distribution quantization parameter;
[0015] decoding the second image code stream based on the distribution quantization parameter to obtain the quantized residual value.
[0016] In a possible implementation of the present application, the step of quantizing the probability distribution parameter to obtain a distribution quantization parameter comprises:
[0017] constructing a probability quantization parameter according to the feature channel distinguishing information and / or the spatial point distinguishing information;
[0018] quantizing the probability distribution parameter based on the probability quantization parameter to obtain a distribution quantization parameter.
[0019] In a possible implementation of the present application, the step of obtaining the feature channel distinguishing information and / or the spatial point distinguishing information comprises:
[0020] decoding the image code stream to obtain the feature channel distinguishing information and / or the spatial point distinguishing information.
[0021] In a possible implementation of the present application, the image code stream further comprises a third image code stream, and the third image code stream is used to transmit distinguishing information.
[0022] The step of obtaining the feature channel distinguishing information and / or the spatial point distinguishing information comprises:
[0023] decoding the third image code stream to obtain the feature channel distinguishing information and / or the spatial point distinguishing information.
[0024] In a possible implementation of the present application, the step of constructing, according to the feature channel distinguishing information and / or the spatial point distinguishing information, a dequantization precision parameter corresponding to each quantized residual value comprises:
[0025] extracting, from the feature channel distinguishing information, a quantization step length corresponding to each type of feature channel;
[0026] constructing, according to the quantization step length, a dequantization precision parameter corresponding to each quantized residual value.
[0027] In a possible implementation of the present application, the step of constructing, according to the feature channel distinguishing information and / or the spatial point distinguishing information, a dequantization precision parameter corresponding to each quantized residual value comprises:
[0028] extracting quantization step lengths corresponding to each type of spatial point from the spatial point distinguishing information;
[0029] constructing inverse quantization precision parameters corresponding to each quantization residual value according to the quantization step lengths.
[0030] In a possible implementation of the present application, the step of constructing inverse quantization precision parameters corresponding to each quantization residual value according to the feature channel distinguishing information and / or the spatial point distinguishing information comprises:
[0031] reading each type of spatial point divided from the spatial point distinguishing information;
[0032] reading quantization step lengths corresponding to each type of feature channel in each type of spatial point from the feature channel distinguishing information;
[0033] constructing inverse quantization precision parameters corresponding to each quantization residual value according to the quantization step lengths.
[0034] In a possible implementation of the present application, the step of constructing inverse quantization precision parameters corresponding to each quantization residual value according to the quantization step lengths comprises:
[0035] decoding an image code stream to obtain probability distribution parameters;
[0036] extracting parameter interval thresholds from the feature channel distinguishing information;
[0037] constructing inverse quantization precision parameters corresponding to each quantization residual value according to the probability distribution parameters, the quantization step lengths, and the parameter interval thresholds.
[0038] In a possible implementation of the present application, the step of constructing inverse quantization precision parameters corresponding to each quantization residual value according to the feature channel distinguishing information and / or the spatial point distinguishing information comprises:
[0039] extracting image block information and parameter setting rules corresponding to each feature channel from the feature channel distinguishing information;
[0040] decoding an image code stream to obtain probability distribution parameters;
[0041] calculating distribution parameter means corresponding to each image block information according to the probability distribution parameters;
[0042] matching the distribution parameter means with the parameter setting rules to obtain quantization step lengths corresponding to each image block information;
[0043] constructing inverse quantization precision parameters corresponding to each quantization residual value according to the quantization step lengths.
[0044] In a possible implementation of the present application, the step of constructing the inverse quantization precision parameter corresponding to each quantized residual value according to the feature channel distinguishing information and / or the spatial point distinguishing information comprises:
[0045] The feature channel distinguishing information is parsed, and for any quantized residual value, a segmented step set corresponding to each feature channel is obtained, wherein the segmented step set corresponding to each feature channel comprises a plurality of different quantization steps;
[0046] The quantization step corresponding to the channel segment to which the quantized residual value belongs is extracted from the segmented step set corresponding to the feature channel;
[0047] The inverse quantization precision parameter corresponding to the quantized residual value is constructed according to the quantization step.
[0048] In addition, to achieve the above object, the present application further provides an image coding method, which comprises the following steps:
[0049] The image features are obtained by performing analysis and transformation processing on the image block to be processed;
[0050] The image residual values and the probability distribution parameters are obtained by performing residual calculation on the image features;
[0051] The quantization precision parameter corresponding to each image residual value is constructed according to the feature channel distinguishing information and / or the spatial point distinguishing information;
[0052] The image residual values are quantized based on the quantization precision parameter to obtain quantized residual values;
[0053] The probability distribution parameters and the quantized residual values are written into an image code stream.
[0054] In a possible implementation of the present application, the step of writing the probability distribution parameters and the quantized residual values into an image code stream comprises:
[0055] The probability distribution parameters are written into a first image code stream;
[0056] The distribution quantization parameter is constructed according to the probability distribution parameters;
[0057] The quantized residual values are written into a second image code stream based on the distribution quantization parameter.
[0058] In a possible implementation of the present application, the step of constructing the distribution quantization parameter according to the probability distribution parameters comprises:
[0059] The probability quantization parameter is constructed according to the feature channel distinguishing information and / or the spatial point distinguishing information;
[0060] quantize the probability distribution parameter based on the probability quantization parameter to obtain a distribution quantization parameter.
[0061] In a possible implementation of the present application, the image coding method further comprises:
[0062] writing the feature channel distinguishing information and / or the spatial point distinguishing information into the image code stream.
[0063] In a possible implementation of the present application, the image code stream further comprises 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 distribution quantization parameter, the method further comprises:
[0065] writing the feature channel distinguishing information and / or the spatial point distinguishing information into the third image code stream.
[0066] In a possible implementation of the present application, the step of constructing the quantization precision parameter corresponding to each image residual value according to the feature channel distinguishing information and / or the spatial point distinguishing information comprises:
[0067] extracting the quantization step corresponding to each type of feature channel from the feature channel distinguishing information;
[0068] constructing the quantization precision parameter corresponding to each image residual value according to the quantization step.
[0069] In a possible implementation of the present application, the step of constructing the quantization precision parameter corresponding to each image residual value according to the quantization step comprises:
[0070] extracting a parameter interval threshold from the feature channel distinguishing information;
[0071] constructing the quantization precision parameter corresponding to each image residual value according to the probability distribution parameter, the parameter interval threshold and the quantization step.
[0072] In a possible implementation of the present application, the step of constructing the quantization precision parameter corresponding to each image residual value according to the feature channel distinguishing information and / or the spatial point distinguishing information comprises:
[0073] analyzing the feature channel distinguishing information, and obtaining, for any image residual value, a segmented step set corresponding to each type of feature channel, wherein the segmented step set corresponding to one type of feature channel comprises a plurality of different quantization steps;
[0074] extracting a quantization step corresponding to a segment of a channel to which the image residual value belongs from a set of segment steps corresponding to the segment of the channel;
[0075] constructing a quantization precision parameter corresponding to the image residual value according to the quantization step.
[0076] In a possible implementation of the present application, the step of constructing the quantization precision parameter corresponding to each image residual value according to the feature channel distinguishing information and / or the spatial point distinguishing information comprises:
[0077] extracting a quantization step corresponding to each type of spatial point from the spatial point distinguishing information;
[0078] constructing a quantization precision parameter corresponding to each image residual value according to the quantization step.
[0079] In a possible implementation of the present application, the step of constructing the quantization precision parameter corresponding to each image residual value according to the feature channel distinguishing information and / or the spatial point distinguishing information comprises:
[0080] reading each type of spatial point divided from the spatial point distinguishing information;
[0081] reading a quantization step corresponding to each type of feature channel from the feature channel distinguishing information;
[0082] constructing a quantization precision parameter corresponding to each image residual value according to the quantization step.
[0083] In a possible implementation of the present application, the step of writing the probability distribution parameter and the quantized residual value into the image code stream comprises:
[0084] performing image decoding according to the probability distribution parameter, the quantized residual value and the feature channel distinguishing information to obtain a reconstructed image block and an image code rate;
[0085] adjusting the feature channel distinguishing information and / or the spatial point distinguishing information according to the reconstructed image block and the image code rate;
[0086] if the current adjustment round is greater than or equal to a preset adjustment round, writing the probability distribution parameter and the quantized residual value into the image code stream.
[0087] In a possible implementation of the present application, after the step of adjusting the feature channel distinguishing information and / or the spatial point distinguishing information according to the reconstructed image block and the image code rate, the method further comprises:
[0088] if the current adjustment round is less than the preset adjustment round, returning to the step of constructing the quantization precision parameter corresponding to each feature channel according to the feature channel distinguishing information.
[0089] In addition, to achieve the above object, the present application further provides an image decoding device, which comprises:
[0090] An entropy decoding module is configured to acquire feature channel distinguishing information and / or spatial point distinguishing information, and decode an image code stream to obtain quantized residual values;
[0091] A parameter constructing module is configured to construct inverse quantization precision parameters corresponding to the quantized residual values according to the feature channel distinguishing information and / or the spatial point distinguishing information;
[0092] An inverse quantization module is configured to, for any one quantized residual value, perform inverse quantization on the quantized residual value based on the inverse quantization precision parameter corresponding to the quantized residual value to obtain a reconstructed residual value;
[0093] A synthesis transformation module is configured 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 application further provides an image encoding device, which comprises:
[0095] An analysis transformation module is configured to perform analysis transformation on a to-be-processed image block to obtain image features;
[0096] A residual calculation module is configured to perform residual calculation on the image features to obtain image residual values and probability distribution parameters;
[0097] A parameter constructing module is configured to construct quantization precision parameters corresponding to respective feature channels according to feature channel distinguishing information and / or spatial point distinguishing information;
[0098] A quantization module is configured to perform quantization on the image residual values based on the quantization precision parameters to obtain quantized residual values;
[0099] An entropy encoding module is configured to write the probability distribution parameters and the quantized residual values into an image code stream.
[0100] In addition, to achieve the above object, the present application further provides a decoding device, which comprises a processor, a memory, and a decoding program stored on the memory and executable on the processor, and the decoding program, when executed by the processor, implements the image decoding method as described above.
[0101] In addition, to achieve the above object, the present application further provides an encoding device, which comprises a processor, a memory, and an encoding program stored on the memory and executable on the processor, and the encoding program, when executed by the processor, implements the image encoding method as described above.
[0102] Further, to achieve the above object, the present application also provides a computer readable storage medium, wherein the computer readable storage medium stores an image decoding program and / or an image encoding program.
[0103] The image decoding program is used to implement the image decoding method as described above, or the image encoding program is used to implement the image encoding method as described above.
[0104] The present application obtains the quantized residual value by obtaining the feature channel distinguishing information and / or the spatial point distinguishing information and decoding the image code stream, constructs the inverse quantization precision parameter corresponding to each quantized residual value according to the feature channel distinguishing information and / or the spatial point distinguishing information, performs inverse quantization on the quantized residual value based on the inverse quantization precision parameter to obtain the reconstructed residual value, and performs synthesis transformation on the reconstructed residual value to obtain the reconstructed image block. Since the inverse quantization is performed according to the corresponding inverse quantization parameter constructed based on the feature channel distinguishing information and / or the spatial point distinguishing information, different quantization parameters can be set according to the differences between the feature channels and the spatial point image textures in the encoding process, so that the more important features bear smaller quantization loss, thereby improving the performance of encoding and decoding. BRIEF DESCRIPTION OF DRAWINGS
[0105] Figure 1 FIG. 1 is a structural schematic diagram of an electronic device of a hardware running environment related to an embodiment scheme of the present application;
[0106] Figure 2 FIG. 2 is a flowchart of an image decoding method according to a first embodiment of the present application;
[0107] Figure 3 FIG. 3 is an image encoding and decoding flowchart according to an embodiment of the present application;
[0108] Figure 4 FIG. 4 is a feature channel schematic diagram according to an embodiment of the present application;
[0109] Figure 5 FIG. 5 is a two-dimensional average value of the feature channel probability distribution parameter according to an embodiment of the present application;
[0110] Figure 6 FIG. 6 is a flowchart of an image decoding method according to a second embodiment of the present application;
[0111] Figure 7 FIG. 7 is a decoding process schematic diagram according to an embodiment of the present application;
[0112] Figure 8 FIG. 8 is a flowchart of an image decoding method according to a third embodiment of the present application;
[0113] Figure 9 FIG. 9 is an identification matrix schematic diagram according to an embodiment of the present application;
[0114] Figure 10 A schematic diagram of row and column division according to an embodiment of the present invention;
[0115] Figure 11 2 is a flow chart of a fourth embodiment of an image decoding method according to the present invention;
[0116] Figure 12 This is a schematic diagram of spatial point classification according to an embodiment of the present invention;
[0117] Figure 13 1 is a flow chart of a first embodiment of an image encoding method according to the present invention;
[0118] Figure 14 A schematic diagram of an image encoding process according to an embodiment of the present invention;
[0119] Figure 15 2 is a flow chart of a second embodiment of an image encoding method according to the present invention;
[0120] Figure 16 2 is a flow chart of a third embodiment of an image encoding method according to the present invention;
[0121] Figure 17 This is a schematic diagram of the optimal threshold mode flag function process according to an embodiment of the present invention;
[0122] Figure 18 This is a parameter optimization flow chart of an embodiment of the present invention;
[0123] Figure 19 is a structural block diagram of a first embodiment of an image decoding device according to the present invention;
[0124] Figure 20 This is a structural block diagram of the first embodiment of the image encoding device of the present invention.
[0125] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0126] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0127] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of an encoding device or decoding device in the hardware operating environment involved in the embodiment of the present invention.
[0128] like Figure 1As shown, the electronic device can 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. The communication bus 1002 is configured to connect and communicate between the components. The user interface 1003 can include a display, an input unit such as a keyboard, and optionally a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0129] Those skilled in the art can understand that Figure 1 The structure shown in the figure does not constitute a limitation on the electronic device, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.
[0130] As Figure 1 As shown, the memory 1005 as a storage medium can include an operating system, a network communication module, a user interface module, and an image encoding program and / or an image decoding program.
[0131] In 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 the user; the processor 1001 and the memory 1005 in the electronic device can be arranged in an encoding device or a decoding device, the electronic device calls the encoding program stored in the memory 1005 through the processor 1001, and executes the image encoding method provided by the embodiment of the present application, or calls the image decoding program stored in the memory 1005 through the processor 1001, and executes the image decoding method provided by the embodiment of the present application.
[0132] In some embodiments of the present application, the performance of the quantizer is improved by improving the quantization accuracy considering the differences between feature channels, for example, the feature channels are classified according to the differences between the feature channels, and the feature channels with different importance levels have different quantization accuracies; or the features can be classified according to the differences in texture complexity, and the features in different texture complexity regions have different quantization accuracies; in the present application, any information used for feature channel classification belongs to relevant information for distinguishing feature channels, and the features classified by the above information will be quantized with different accuracies, that is, different quantization steps are used, so that the more important features bear less quantization loss, the feature prediction to be encoded is more accurate, and then a more optimal feature reconstruction value y_hat is obtained, and finally the purpose of obtaining a more optimal encoding performance is achieved.
[0133] The embodiment of the present application provides an image decoding method, which refers to Figure 2 , Figure 2 FIG. 1 is a flowchart of a first embodiment of an image decoding method of the present application.
[0134] In the embodiment, the image decoding method comprises the following steps S10-S40.
[0135] Step S10: Obtain feature channel distinguishing information and / or spatial point distinguishing information, and decode an image code stream to obtain a quantized residual value.
[0136] It should be noted that the execution subject of the embodiment can be a decoding device for decoding image data, and the decoding device can be an electronic device such as a camera, a mobile terminal, a personal computer, a server, and the like, of course, other devices having the same or similar functions can also be used, and the embodiment is not limited thereto. In the embodiment and the following embodiments, the image decoding method of the present application is described by taking the decoding device as an example.
[0137] In the image encoding process, the encoding device generally decodes the encoded image code stream after encoding, and determines whether the parameters used in the encoding need to be adjusted according to the image quality of the decoded image, so the execution subject of the embodiment can also be the encoding device.
[0138] In the embodiment of the present application, some technical terms that can be involved in the process of encoding or decoding an image include quantization and dequantization (Quantization and Dequantization), scalar quantization (SQ, Scalar Quantization), entropy encoding (Entropy Encoding), convolutional neural network (CNN), feature channel (Feature Channel), and the like, which are described herein.
[0139] Quantization is the process of mapping the continuous values(or a large number of discrete values) of a signal into a finite number of discrete amplitudes, which realizes the many-to-one mapping of signal values. In video coding, the residual signal after transformation often has a large dynamic range. Therefore, quantizing the transform coefficients can effectively reduce the signal value space and achieve better compression effect. At the same time, due to the many-to-one mapping mechanism, the quantization process inevitably introduces distortion, which is the fundamental reason for the distortion in video coding.
[0140] Dequantization is the inverse process of quantization, which maps the quantized coefficients to the reconstructed signal in the input signal space, and the reconstructed signal is an approximation of the input signal.
[0141] Scalar quantization is the most basic quantization method, which maps the continuous signal(or a large number of discrete values) into several discrete signals. Specifically, the input of scalar quantization is a one-dimensional scalar signal, which first divides the input signal space into a series of disjoint 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 it belongs to.
[0142] The simplest scalar quantization method is uniform scalar quantization, which divides the input signal space into equidistant intervals, and the representative signal of each interval is the midpoint of the interval. The length of the interval is called the quantization step, and the index of the interval is called the level. The parameter representing the quantization step is the quantization parameter(QP, Quantization Parameter).
[0143] The optimal scalar quantizer is the Lloyd-Max quantizer, which considers the distribution of the input signal, and the interval division is non-uniform. The representative signal of each interval is the probability centroid of the interval, and the boundary point of the adjacent two intervals is the midpoint of the representative signals of the two intervals.
[0144] Entropy coding is the coding process that does not lose any information according to the entropy principle. Information entropy is the average amount of information of the source(measure of uncertainty). Common entropy coding methods include Shannon coding, Huffman coding and arithmetic coding.
[0145] Neural Network(NN):
[0146] The neural network referred to herein is an artificial neural network, rather than a biological neural network. The neural network is an operation model composed of a large number of nodes (or neurons) connected with each other. In the artificial neural network, the neuron processing unit 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. The input units accept signals and data from the external world; the output units output the processing results of the system; and the hidden units are the units between the input units and the output units, which cannot be observed from the outside of the system. The connection weights between the neurons reflect the connection strength between the units, and the information representation and processing are embodied in the connection relationship of the network processing units. The artificial neural network is a non-programmed, brain-like information processing method, the essence of which is to obtain a parallel distributed information processing function through the transformation and dynamics of the network, and to imitate the information processing function of the human brain neural system at different levels and degrees. At present, in the field of video processing, commonly used neural networks include convolutional neural network (CNN), recurrent neural network (RNN), and fully connected network.
[0147] The convolutional neural network is a kind of feedforward neural network, and is one of the most representative network structures in deep learning technology. The artificial neurons of the convolutional neural network can respond to a part of the surrounding units in the coverage range, and have excellent performance for large image processing.
[0148] Generally, the basic structure of the CNN includes two layers, one of which is a feature extraction layer (also referred to as a convolution layer), and the input of each neuron is connected with 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 other is a feature mapping layer (also referred to as an activation layer), each calculation layer of the network is composed of multiple feature mappings, and each feature mapping is a plane, and all the neurons on the plane have equal weights. The feature mapping structure can adopt Sigmoid function, ReLU function, Leaky-ReLU function, PReLU function, GDN function, etc. as the activation function of the convolutional network. In addition, since the neurons on a mapping plane share weights, the number of free parameters of the network is reduced.
[0149] One of the advantages of the CNN over the traditional image processing algorithm is that the complex pre-processing process (extracting artificial features, etc.) of the image is avoided, and the original image can be directly input for end-to-end learning. One of the advantages of the CNN over the traditional neural network is that the traditional neural network adopts a full connection mode, that is, all the neurons from the input layer to the hidden layer are connected, which will result in a large number of parameters, making the network training time-consuming and even difficult to train, while the CNN avoids this difficulty through local connection and weight sharing.
[0150] In the neural network, the input signal can obtain a plurality of feature maps through the convolution layer, each feature map is called a feature channel, and contains a part of information of the input signal.
[0151] It should be noted that the feature channel distinguishing information can be distinguishing information for dividing the image feature channels, and the feature channel distinguishing information can include a rule for dividing the feature channels and a quantization precision parameter for quantizing the residual values corresponding to the divided feature channels. The spatial point distinguishing information can be distinguishing information for classifying the points in the image, and the spatial point distinguishing information can include a rule for dividing the spatial points in the image based on the image texture, and if necessary, the spatial point distinguishing information can also include a quantization precision parameter for quantizing the residual values corresponding to the divided spatial points.
[0152] The feature channel or spatial point division rule can be set based on the probability distribution parameter, or can be set based on the average value or variance of the probability distribution parameter, for example: a corresponding threshold value is set to obtain a plurality of value intervals, and the feature channels are divided into a plurality of categories according to the value interval to which the corresponding probability distribution parameter belongs.
[0153] Step S20: Constructing the inverse quantization precision parameter corresponding to each quantized residual value according to the feature channel distinguishing information and / or the spatial point distinguishing information.
[0154] It should be noted that constructing the inverse quantization precision parameter corresponding to each quantized residual value according to the feature channel distinguishing information and / or the spatial point distinguishing information can be determining the feature channel category or the spatial point category corresponding to each quantized residual value according to the feature channel distinguishing information and / or the spatial point information, so as to obtain the inverse quantization precision parameter that should be used when performing inverse quantization processing on each quantized residual value.
[0155] Step S30: Inverse quantizing the quantized residual value based on the inverse quantization precision parameter to obtain a reconstructed residual value.
[0156] It can be understood that after determining the inverse quantization precision parameter corresponding to each quantized residual value, the inverse quantization processing of the quantized residual value can be performed according to the inverse quantization precision parameter, that is, inverse quantization, and the value obtained after processing is taken as the reconstructed residual value.
[0157] Step S40: Synthesis transformation is performed 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 value used when calculating the feature residual value can be obtained through context prediction, and the reconstructed residual value can be reconstructed into an image feature through the mean value, and then the image feature can be reconstructed into an image block through a synthesis transformation network, so as to obtain a reconstructed image block.
[0159] It can be understood that if the encoding device divides the image data into only one image block for processing during the encoding process, the reconstructed image block obtained at this time is the completed reconstructed image data corresponding to the image data. If the encoding device divides the image data into multiple image blocks for processing during the encoding process, the reconstructed image block obtained at this time is only the reconstructed image data corresponding to one image block in the image data.
[0160] For the convenience of understanding, the present application is described in combination with Figure 3 , 4 and 5, but the present application is not limited thereto. Figure 3 The figure is a schematic diagram of the image coding and decoding process of the present embodiment. As shown in the figure, the image coding and decoding process mainly involves the analysis transformation network, the synthesis transformation network, the context-based prediction, the quantization, the entropy coding, the super coding network, the super decoding network and the like, wherein: Figure 3
[0161] Analysis transformation network: transform the image x into the feature y in the latent domain, so as to facilitate the subsequent operations 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 is written into the image bitstream biatstream#1, and mainly transmits the probability model parameter σ of the residual.
[0163] Context-based prediction module: the input of the module includes not only z_hat but also the decoded y_hat, and the two are jointly input to obtain a more accurate mean value mu, which is the predicted value of the original feature, and the reconstructed y_hat is obtained by adding the reconstructed residual value r_hat.
[0164] Super decoding network: the output z_hat of the super coding network is used as the input of the super decoding network to obtain the probability distribution parameter σ, and the distribution quantization parameter σ_hat is obtained by quantization, which will be used to obtain the quantized residual value r_q in combination with the second image bitstream (Bitstream#2).
[0165] Synthesis transformation module: the obtained reconstructed latent domain feature y_hat is obtained by the synthesis transformation module.
[0166] Entropy coding: a lossless coding method based on the information entropy principle, which converts a series of element symbols (such as transformation coefficients and mode information) used to represent a video sequence into a binary code stream, and removes the statistical redundancy of these video element symbols.
[0167] Quantization: a "many-to-one" mapping process, which will bring signal loss, quantization acts on the residual r, 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 sigma to obtain sigma_hat, which is to estimate the probability distribution of the quantized residual r_q better. Dequantization is the inverse process of quantization, wherein the quantization precision parameter or the dequantization precision parameter used in the quantization and dequantization process is constructed according to the feature channel distinction information and / or the spatial point distinction information.
[0168] Figure 4 The feature channel diagram of the present embodiment is shown in Figure 5 The two-dimensional diagram of the average value of the probability distribution parameter of the feature channel of the present embodiment is shown in Figure 3 As shown in the above Figure 4 After the image x is processed by the analysis transformation network, the feature y obtained contains C feature channels (Channels), and the number of C depends on the number of convolution kernels used by the analysis transformation network, as shown in The amount of information contained in each feature channel is different, some feature channels contain more information, almost the same as the input image, and some feature channels almost do not contain information, and are basically all noise, so using different quantization precision for different feature channels helps to obtain better coding performance.
[0169] In addition, the average of all feature channel sigma can obtain a 2-dimensional image, as shown in Figure 5 In Figure 5 , it can be determined that the texture value of the part of the region is higher, that is, the part of the region is more important, and allocating more code words to the complex texture part of the image helps to improve the coding performance.
[0170] The present embodiment obtains feature channel distinction information and / or spatial point distinction information, and decodes the image code stream to obtain a quantized residual value; constructs a dequantization precision parameter corresponding to each quantized residual value according to the feature channel distinction information and / or the spatial point distinction information; dequantizes the quantized residual value based on the dequantization precision parameter to obtain a reconstructed residual value; and synthesizes and transforms the reconstructed residual value to obtain a reconstructed image block. Since the corresponding dequantization parameter is constructed according to the feature channel distinction information and / or the spatial point distinction information, the dequantization is performed, so that different quantization parameters can be set according to the differences of the feature channels and the spatial point image texture in the coding process, and the more important features are allowed to bear smaller quantization loss, thereby improving the coding and decoding performance.
[0171] Reference Figure 6 , Figure 6 is a flowchart of a second embodiment of an image decoding method of the present application.
[0172] In the embodiment, the image code stream can include a first image code stream and a second image code stream, wherein the first image code stream is used to transmit the decoding auxiliary information, and the second image code stream is used to transmit the residual data.
[0173] Based on the first embodiment, the step S10 of the image decoding method in the embodiment can include steps S101-S104.
[0174] In step S101, the feature channel distinguishing information and / or the spatial point distinguishing information are acquired, and the encoding distribution parameter is extracted from the first image code stream.
[0175] It should be noted that the encoding distribution parameter can be extracted from the first image code stream by entropy decoding the first image code stream to read the decoding auxiliary information contained in the first image code stream, so as to obtain the encoding distribution parameter.
[0176] In step S102, the encoding distribution parameter is decoded to obtain the probability distribution parameter.
[0177] It should be noted that the encoding distribution parameter can be decoded to obtain the probability distribution parameter by decoding the read decoding auxiliary information through the hyper-scale decoding network, so as to obtain the probability distribution parameter.
[0178] In step S103, the probability distribution parameter is quantized to obtain the distribution quantization parameter.
[0179] It should be noted that when the encoding device writes the residual data into the second image code stream, the residual data is written based on the quantized probability distribution parameter, and therefore, when the second image code stream is decoded, the quantized probability distribution parameter needs to be obtained for decoding. At this time, in order to ensure that the second image code stream can be normally decoded, the probability distribution parameter can be quantized in the same way as when the encoding device is encoded to obtain the distribution quantization parameter.
[0180] In the specific implementation process, in order to ensure that the obtained distribution quantization parameter is consistent with that 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 that used when the encoding device is encoded. The step S103 in the embodiment can include:
[0181] The probability quantization parameter is constructed according to the feature 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 the distribution quantization parameter.
[0183] It should be noted that constructing the probability quantization parameter according to the feature channel distinguishing information and / or the spatial point distinguishing information can be to extract a parameter used when quantizing the probability distribution parameter from the feature channel distinguishing information and / or the spatial point distinguishing information.
[0184] In a possible implementation of the embodiment, to facilitate decoding by the decoding device, the encoding device can write the feature channel distinguishing information and / or the spatial point distinguishing information used in the encoding process into the first image code stream or the second image code stream, and then obtaining the feature channel distinguishing information and / or the spatial point distinguishing information can be decoding the first image code stream or the second image code stream to extract the feature channel distinguishing information and / or the spatial point distinguishing information.
[0185] In a possible implementation of the embodiment, to avoid code stream confusion, the encoding device can also set a third image code stream to transmit the feature channel distinguishing information and / or the spatial point distinguishing information used in the encoding process, and then obtaining the feature channel distinguishing information and / or the spatial point distinguishing information can be decoding the third image code stream to extract the feature channel distinguishing information and / or the spatial point distinguishing information.
[0186] Step S104: Decoding the second image code stream based on the distribution 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, the quantized residual value is entropy encoded and written based on the quantized distribution quantization parameter, and then after the distribution quantization parameter is obtained, the second image code stream can be inversely operated according to the distribution quantization parameter, that is, entropy decoding, so as to obtain the quantized residual value.
[0188] To facilitate understanding, the present embodiment will be described below in combination with Figure 7 , but the present scheme is not limited thereto. Figure 7 A decoding process of the present embodiment is shown in FIG. 2. Figure 7 As shown in FIG. 2, the decoding end receives at least two image code streams (a first image code stream Bitstream#1 and a second image code stream Bitstream#2), and can also receive a third image code stream Bitstream#3.
[0189] At this time, the decoding process includes: obtaining a z_hat from the Bitstream#1 auxiliary code stream, and obtaining the parameter σ of the probability distribution model of the residual through the z_hat; obtaining the information related to the distinguishing feature channel or the distinguishing texture region (feature channel distinguishing information and / or spatial point distinguishing information), and classifying the feature channel or the spatial point by using the information; the quantization precisions of the feature channels or the spatial points in different categories are different; the information related to the distinguishing feature channel can be transmitted from the encoding device to the decoding device through the Bitstream#1 or Bitsstream#2, or can be transmitted through a new code stream Bitsstream#3, or the related information can be written in the encoding and decoding device in advance without code stream transmission; performing entropy decoding on the Bitsstream#2, and obtaining the quantized residual r_q by jointly using σ; the information related to the distinguishing feature channel or the spatial point will act on the inverse quantization of the quantized residual r_q, and the quantized residual r_q and σ corresponding to the feature channels or the spatial points in different categories have different quantization precisions.
[0190] Reference Figure 8 , Figure 8 FIG. 2 is a flowchart of a third embodiment of the image decoding method of the present application.
[0191] Based on the first embodiment, the step S20 of the image decoding method of the present embodiment includes steps S201-S202.
[0192] Step S201: Extract the quantization step corresponding to each type of feature channel from the feature channel distinguishing information.
[0193] It should be noted that when distinguishing the feature channels, the feature channels can be divided into multiple categories, and different quantization steps are assigned to the feature channels in different categories, so that the feature channel distinguishing information includes the classification rule of the feature channels and the quantization step corresponding to each type of feature channel.
[0194] The classification rule of the feature channels can be set in the following modes 1-4.
[0195] Mode 1: Set according to the serial number of the feature channel:
[0196] Set the corresponding quantization step for each serial number corresponding feature channel, and then classify the feature channels with the same quantization step into one category, for example: assuming that the serial number of the feature channel is 1-X, then the feature channel quantization step list can be: channel_list=[channel1、chanenel2、…、channelX];
[0197] Further, the same feature channel can further include components, such as luminance or chrominance, which can be further subdivided, for example, assuming that the luminance channel sequence number is 1-X1, the chrominance channel sequence number is 1-X2, the luminance channel quantization step size list is: channel_listY=[channel1,chanenel2, …, channelX1], and the chrominance channel quantization step size list is: channel_listUV=[channel1,chanenel2, …, channelX2].
[0198] Method 2: setting corresponding categories based on the channel flag list;
[0199] A corresponding flag is set for each sequence number corresponding feature channel, and the flag identifies the category of the sequence number corresponding feature channel.
[0200] For example, taking the luminance channel as an example, the sequence number of the luminance channel is 1-128, and the flag list channel_listY=[flag0,flag1, …, flag128], wherein the value of the flag is the category corresponding to the luminance channel of the sequence number, such as only two categories, and the value of the flag is 0 and 1.
[0201] Method 3: dividing the categories of the feature channels by setting threshold values:
[0202] The categories of the feature channels are set by a threshold value calculated from the probability distribution parameter σ, such as the mean or variance of the probability distribution parameter σ, or a relevant threshold value calculated from the quantization residual r_q, such as the sum of the absolute values of the quantization residual or the code rate, for example: thr_list=[thr1,thr2, …, thrX].
[0203] Method 4: dividing the categories of the feature channels by the number of channels: the relevant threshold value list calculated from the distribution parameter σ, such as the mean or variance of the probability distribution parameter σ, or the sum of the absolute values of the quantization residual r_q or the code rate, is used to sort the channels, and multiple number thresholds (the multiple number thresholds can be represented by a list, such as: num_list=[num1,num2, …, numX], X is the length of the list, i.e. the number of number thresholds) are set, and the categories are classified according to the number of channels according to the number thresholds, such as the first 3 are classified as one category, and the rest are classified as one category, assuming that the channel number threshold can be set to 3, then num_list=[3] can be set.
[0204] Step S202: constructing a dequantization precision parameter corresponding to each quantization residual value according to the quantization step size.
[0205] It should be noted that after obtaining the quantization step corresponding to each type of feature channel, the quantization step used when quantizing each quantized residual value can be obtained according to the feature channel corresponding to each quantized residual value, so as to calculate the dequantization precision parameter required for dequantizing each quantized residual value.
[0206] For example: assuming that the feature channel is divided into X types, the quantization step corresponding to each type of feature channel in the feature channel distinguishing information can be represented by a list scale_list=[scale1, scale2, …, scaleX], where X is the number of quantization steps, and assuming that the quantized residual value corresponding to the jth type of feature channel is r qj , the feature residual is r j , and the reconstructed residual value obtained by dequantization is r_hat j , then the quantization process is r qj =round(r j *scale j *scale i ), and the dequantization process is r_hat j =r qj / (scale j *scale i ), where scale j is the quantization step used when quantizing the feature residual corresponding to the jth type of feature channel according to the newly added feature channel, scale i is the quantization step used when quantizing the feature residual corresponding to the jth type of feature channel in the original scheme, and scale i can be set to 1, that is, the quantization step of the original scheme can be retained or not. Similarly, in the following embodiments, whether to retain the quantization step of the original scheme can be selected.
[0207] In the specific implementation process, for the same feature channel, different quantization steps can also be further set, such as by setting a threshold to divide multiple value intervals, or by further setting the value interval to which the value calculated according to the probability distribution parameter belongs. The step S202 described in the present embodiment can include:
[0208] Decoding the image code stream to obtain the probability distribution parameter;
[0209] Extracting the parameter interval threshold from the feature channel distinguishing information;
[0210] According to the probability distribution parameter, the quantization step, and the parameter interval threshold, constructing the dequantization precision parameter corresponding to each quantized residual value.
[0211] It should be noted that when constructing the inverse quantization precision parameter corresponding to the quantized difference residual value, the feature channel category to which the quantized residual value belongs can be acquired first, the quantization step corresponding to the feature channel of the category and the parameter interval threshold are acquired, the value interval is divided according to the parameter interval threshold, then the value interval to which the probability distribution parameter corresponding to the quantized residual value belongs (or the value interval to which the mean value or variance of the probability distribution parameter belongs) is calculated, the corresponding quantization step is selected from the plurality of quantization steps corresponding to the feature channel of the category according to the value interval, and then the inverse quantization precision parameter corresponding to the inverse quantization of the quantized residual value is calculated according to the quantization step. The plurality of quantization steps corresponding to a feature channel of a category correspond to the divided value intervals respectively.
[0212] For example: assuming that the feature channel corresponding to the quantized residual value is category i, the quantization steps corresponding to the feature channel of the category include scale1, scale2, scaleN, and the parameter interval thresholds thr1, thr2, …, thrN are different thresholds (thr1, thr2, …, thrN are in descending order), then the value intervals can include: (thr1, ∞), (thr2, thr1], …, (thrN, thrN-1], each value interval corresponds to a quantization step, and if the probability distribution parameter σ corresponding to the quantized residual value is greater than thr1, the corresponding quantization step is scale1, if the probability distribution parameter σ corresponding to the quantized residual value is greater than thr2 and less than or equal to thr1, the corresponding quantization step is scale2, and so on.
[0213] In the specific implementation process, the same feature channel of a category can be classified again, for example: the feature channel of a category is divided into multiple segments, and each segment corresponds to a different quantization step, then the step S20 described in this embodiment can include:
[0214] The feature channel differentiation information is parsed to acquire a segmented step set corresponding to each feature channel of a category;
[0215] The quantization step corresponding to each channel segment is extracted from the segmented step set;
[0216] The inverse quantization precision parameter corresponding to each quantized residual value is constructed according to the quantization step.
[0217] It should be noted that after further dividing the feature channel of a category, each feature channel of a category can correspond to a plurality of different quantization steps, which can be saved in the form of a set, then the feature channel differentiation information can be parsed to acquire a segmented step set corresponding to each feature channel of a category, and then the quantization step corresponding to each channel segment is extracted from the segmented step set. The segmented division manners of feature channels of different categories can be different or the same, and this embodiment does not limit this.
[0218] At this time, constructing the dequantization precision parameter corresponding to the quantized residual value according to the quantization step length can be to obtain the feature channel category corresponding to the quantized residual value, and to determine the channel segment to which the quantized residual value belongs in the feature channel category, to determine the quantization step length and other parameters used when calculating the quantized residual value according to the feature channel category and the channel segment, and to calculate the dequantization precision parameter required for dequantization 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, and the segment step length set corresponding to the i-th feature channel at this time can be represented as: scale_list i = [scale i1 ... scale ij ... sscle iX ], where scaleij is the quantization step length of the j-th segment in the i-th feature channel, and j takes values [1, X].
[0220] In 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 related threshold list calculated from the distribution parameter σ or the average value or variance of σ, or the related threshold list calculated from the quantized residual r_q or the sum of the absolute values of the quantized residual r_q or the code rate, and the list length X, thr_luma and thr_chroma can be combined into one list, thr_list = [thr1, thr2, …, thrX], or they can be transmitted separately.
[0222] Rule 2: Channel two-dimensional flag matrix, as shown in the schematic diagram Figure 7 , luma and chroma components can be combined into one matrix, or they can be transmitted separately, similar to the channel flag list in example 1. Different flags represent different classifications.
[0223] Rule 3: Row, column, diagonal column number and list length, similar to channel number, as shown in the schematic diagram Figure 7 .
[0224] Rule 4: Transmit row, column, diagonal column flags, similar to the channel flag list.
[0225] Rule 5: Row, column, diagonal column number table num_list = [num1, num2, …, numX] and list length X, similar to the channel number list.
[0226] Rule 6: Row, column, diagonal column flags, similar to channel flags.
[0227] Here, combined with Figure 9 and10 To explain, Figure 9 This is a schematic diagram of the identification matrix of this embodiment, as shown in Figure 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 Figure 9 As shown, 0 and 1 in the matrix represent the classification labels of the relevant feature data in the same channel.
[0228] Figure 10 This is a schematic diagram of the row and column division of this embodiment. The specific row, column, and oblique column divisions 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 step sizes may be set. In this case, step S20 of this embodiment may include:
[0230] Extracting image segmentation 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 size corresponding to each image block information;
[0234] The inverse quantization precision parameters corresponding to the respective 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. After that, different quantization step sizes are set according to the different means of the probability distribution parameters corresponding to these blocks, where the size of the blocks can be set freely.
[0236] Extracting the image segmentation information and parameter setting rules corresponding to each feature channel from the feature channel differentiation information may include extracting the parameter setting rules and the segmentation rules from the feature channel differentiation information, determining the segments corresponding to each feature channel according to the segmentation rules, and thereby obtaining the image segmentation information corresponding to each feature channel. The parameter setting rules include quantization step sizes corresponding to different distribution parameter means.
[0237] In actual use, calculating the distribution parameter mean corresponding to each image block information according to the probability distribution parameter can be calculating the average of the probability distribution parameters corresponding to each image block information, so as to obtain the distribution parameter mean.
[0238] In the implementation process, matching the distribution parameter mean with the parameter setting rule to obtain the quantization step corresponding to each image block information can be matching the distribution parameter mean with multiple value intervals contained in the parameter setting rule, and taking 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 when calculating the quantized residual value can be determined according to the image block information to which the quantized residual value belongs, so as to calculate the dequantization precision parameter required for dequantizing the quantized residual value.
[0240] The embodiment constructs the probability quantization parameter according to the feature channel distinguishing information and / or the spatial point distinguishing information, quantizes the probability distribution parameter based on the probability quantization parameter, and obtains 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 based on 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 differences between the feature channels and the spatial point image textures, and the performance of the encoding method of the embodiment is further improved.
[0241] Reference Figure 11 , Figure 11 The flowchart of the fourth embodiment of the image decoding method of the present application is shown.
[0242] Based on the first embodiment, the step S20 of the image decoding method of the present embodiment includes steps S201'-S202'.
[0243] Step S201': extracting the quantization step corresponding to each type of spatial point from the spatial point distinguishing information.
[0244] It should be noted that when setting the quantization step, the spatial points in the image can be divided into multiple categories according to the image texture, and different quantization steps can be set for different categories of spatial points, for example: according to the image texture, the spatial points in the image are divided into X categories, and the quantization step of the jth category of spatial points is scale_j, and the value range of j is [1, X].
[0245] In the classification of the spatial points, the image texture complexity corresponding to the spatial points can be used for the classification, 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 intervals to which the image texture complexity corresponding to the spatial points belongs.
[0246] Step S202': constructing the dequantization precision parameters corresponding to the respective quantized residual values according to the quantization step.
[0247] It can be understood that the construction of the dequantization precision parameters corresponding to the respective quantized residual values according to the quantization step of the respective spatial points can be to obtain the quantization step used for calculating the quantized residual values and the like according to the category of the spatial point corresponding to the quantized residual value, so as to calculate the dequantization precision parameters required for the dequantization of the respective quantized residual values.
[0248] It should be noted that each spatial point actually contains C (C is the number of feature channels) points, and after the division of the different categories of spatial points, the multiple points contained in the spatial points can be further divided. Different feature channels in a category of spatial points can correspond to different quantization steps, and at this time, the spatial point division information and the feature channel division information can be used in cooperation. At this time, the step S20 described in the embodiment can include:
[0249] reading the divided categories of spatial points from the spatial point division information;
[0250] reading the quantization steps corresponding to the respective feature channels in the respective categories of spatial points from the feature channel division information;
[0251] constructing the dequantization precision parameters corresponding to the respective quantized residual values according to the quantization step.
[0252] It should be noted that when the multiple points contained in the respective spatial points in the respective categories of spatial points are further divided according to the different feature channels, the points of the multiple different feature channels corresponding to a category of spatial points can correspond to different quantization steps, and at this time, the multiple categories of spatial points that can be divided can be read from the spatial point division information, and then the quantization steps corresponding to the respective feature channels in the respective categories of spatial points are read.
[0253] For example, the spatial points are divided into two categories a and b, and the feature channels contained in a and b are both 1-X, and at this time, the quantization steps corresponding to the respective feature channels in the a category of spatial points can be represented as scale_lista=[scale1, scale2, …, scaleX], and the quantization steps corresponding to the respective feature channels in the b category of spatial points can be represented as scale_listb=[scale1, scale2, …, scaleX].
[0254] In a specific implementation, in order to facilitate the decoding device to determine the specific quantization step setting manner, a corresponding flag bit can also be set in the image code stream, and the flag bit is used to determine how to obtain the quantization step, for example, if the flag bit is set to 0, the quantization step is determined according to the feature channel distinguishing information, if the flag bit is set to 1, the quantization step is determined according to the spatial point distinguishing information, and if the flag bit is set to 2, the quantization step is determined in combination with the feature channel distinguishing information and the spatial point distinguishing information.
[0255] It should be noted that the present embodiment only illustrates a manner in which the spatial point distinguishing information and the feature channel distinguishing information are used in cooperation, and the plurality of points contained in the spatial point can be further divided by using the implementation manner for further dividing the feature channel provided in any one of the above embodiments, and the present embodiment does not limit this.
[0256] For the convenience of understanding, the present embodiment will be described below in combination with Figure 12 , but the present scheme is not limited thereto. Figure 12 FIG. 1 is a spatial point classification diagram of the present embodiment, according to the image texture complexity corresponding to the spatial point, the spatial point can be divided into a first type, a second type and a third type (as shown by the arrows in the figure), and the specific divided spatial points are shown in Figure 12 Figure 12 The color depth of each point in the figure is used to represent the image texture complexity, the color depth is consistent, and the color is deeper, and the image texture complexity is higher.
[0257] The present embodiment extracts the quantization step corresponding to each type of spatial point from the spatial point distinguishing information, and constructs the dequantization accuracy parameter corresponding to each quantization residual value according to the quantization step. Since the dequantization accuracy parameter corresponding to each quantization residual value is constructed according to the quantization step corresponding to each type of spatial point, different quantization steps can be set for spatial points of different image textures, so that the quantization and dequantization can be set differently according to the difference of the image texture.
[0258] The present embodiment provides an image encoding method, referring to Figure 13 , Figure 13 FIG. 2 is a flow diagram of a first embodiment of an image encoding method of the present application.
[0259] In the present embodiment, the image encoding method comprises the following steps S100-S500:
[0260] Step S100: performing analysis and transformation processing on the to-be-processed image block to obtain image features.
[0261] It should be noted that the execution subject of the embodiment can be an encoding device for encoding image data, which can be a personal computer, a server, or other electronic devices, or other devices that can achieve the same or similar functions, and the embodiment is not limited thereto. In the embodiment and the following embodiments, the image encoding method of the application is described by taking the encoding device as an example.
[0262] It should be noted that the image feature can be obtained by analyzing and transforming the image block to be processed by an analysis and transformation network to extract feature information.
[0263] Step S200: performing residual calculation on the image feature to obtain image residual value and probability distribution parameter.
[0264] It should be noted that the residual calculation on the image feature to obtain the image residual value and the probability distribution parameter can be performed by generating a prediction value based on a context-based prediction module, and then performing residual calculation on the image feature and the prediction value to obtain the image residual value, and analyzing the image residual value by a super-encoding network to obtain the probability distribution parameter.
[0265] Step S300: constructing quantization precision parameters corresponding to each image residual value according to feature channel distinguishing information and / or spatial point distinguishing information.
[0266] It should be noted that the feature channel distinguishing information can be distinguishing information for dividing the image feature channels, and the spatial point distinguishing information can be distinguishing information for classifying each point in the image. The feature channel distinguishing information and the spatial point distinguishing information can be set by the management personnel of the encoding device according to actual needs.
[0267] It should be noted that the construction of the quantization precision parameters corresponding to each image residual value according to the feature channel distinguishing information and / or the spatial point distinguishing information can be to determine the feature channel category or the spatial point category corresponding to each image residual value according to the feature channel distinguishing information and / or the spatial point information, and to read the quantization precision parameters required for quantizing each image residual value from the feature channel distinguishing information and / or the spatial point distinguishing information. The quantization precision parameter can be a quantization step or other parameters 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 quantization processing of the image residual value based on the quantization precision parameter to obtain the quantized residual value can be to quantize the image residual value according to the quantization precision parameter, and to take the calculated value as the quantized residual value.
[0270] Step S500: write the probability distribution parameter and the quantized residual value into an image code stream.
[0271] It should be noted that the probability distribution parameter and the quantized residual value written into the image code stream can be processed by the super coding network after the probability distribution parameter is processed, and then entropy coding is used to write the probability distribution parameter into the image code stream, and the quantized residual value is entropy coded based on the quantized probability distribution parameter, and then written into the image code stream.
[0272] In a specific implementation, the image code stream can include a first image code stream and a second image code stream, the first image code stream is used to transmit the decoding auxiliary information, and the second image code stream is used to transmit the residual data. The step S500 of the embodiment can include:
[0273] write the probability distribution parameter into the first image code stream;
[0274] construct a distribution quantization parameter according to the probability distribution parameter;
[0275] write the quantized residual value into the second image code stream based on the distribution quantization parameter.
[0276] It should be noted that the probability distribution parameter written into the first image code stream can be processed by the super coding network after the probability distribution parameter is processed, and then entropy coding is used to write the probability distribution parameter into the first image code stream. The distribution quantization parameter can be constructed according to the probability distribution parameter. The probability distribution parameter can be quantized to obtain the distribution quantization parameter. The quantized residual value can be entropy coded based on the distribution quantization parameter, and then written into the second image code stream.
[0277] In order to ensure the performance of the quantizer, the quantization parameter used when quantizing the probability distribution parameter can be constructed according to the feature channel distinguishing information and / or the spatial point distinguishing information. At this time, the step of constructing a distribution quantization parameter according to the probability distribution parameter in the embodiment can include:
[0278] construct a probability quantization parameter according to the feature channel distinguishing information and / or the spatial point distinguishing information;
[0279] quantize the probability distribution parameter based on the probability quantization parameter to obtain the distribution quantization parameter.
[0280] It should be noted that the probability quantization parameter is constructed according to the feature channel distinguishing information and / or the spatial point distinguishing information, and different quantization parameters can be set according to different feature channels or spatial points corresponding to the probability distribution parameter, so that the quantization can be fully adapted to the difference of the feature channels and the complexity of the image texture, 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 feature channel distinguishing information and / or the spatial point distinguishing information can also be written into the image code stream.
[0282] It can be understood that, since the parameters used for quantization are adjusted according to the feature channel distinguishing information and / or the spatial point distinguishing information during encoding, if the decoding device is to be normally decoded, the feature channel distinguishing information and / or the spatial point distinguishing information also needs to be obtained. At this time, the feature channel distinguishing information and / or the spatial point distinguishing information is written into the first image code stream or the second image code stream, so that the decoding device can obtain the feature channel distinguishing information and / or the spatial point distinguishing information, thereby ensuring that the decoding device can normally decode.
[0283] In actual use, in order to avoid code stream data confusion or code stream complexity, a third image code stream can also be set to transmit the distinguishing information, and at this time, the step of writing the quantized residual value into the second image code stream based on the distribution quantization parameter according to the embodiment further includes:
[0284] writing the feature channel distinguishing information and / or the spatial point distinguishing information into the third image code stream.
[0285] For the convenience of understanding, the present embodiment will be described below in combination with Figure 14 , but the present scheme is not limited thereto. Figure 14 The image encoding process of the present embodiment is shown in Figure 14 , the encoding device can write the quantized residual value into the second image code stream, write the encoding distribution parameter z_hat calculated from the probability distribution parameter σ into the first image code stream, and write the information related to distinguishing the feature channel or the spatial point (the feature channel distinguishing information and / or the spatial point distinguishing information) into the first image code stream or the second image code stream. The information related to distinguishing the feature channel or the spatial point can also be written into the third image code stream, and if necessary, the information related to distinguishing the feature channel or the spatial point can also be directly written into the encoding device as a local parameter in advance, without code stream transmission, as long as the encoding device end and the decoding device end are consistent.
[0286] The embodiment obtains image features by analyzing and transforming a to-be-processed image block; performs residual error calculation on the image features to obtain image residual error values and probability distribution parameters; constructs quantization precision parameters corresponding to each image residual error value according to feature channel distinguishing information and / or spatial point distinguishing information; performs quantization processing on the image residual error values based on the quantization precision parameters to obtain quantized residual error values; and writes the probability distribution parameters and the quantized residual error values into an image code stream. In the encoding process, different quantization parameters can be set according to the differences between feature channels and spatial point image textures, so that more important features bear smaller quantization losses, thereby improving the performance of encoding and decoding.
[0287] Reference Figure 15 , Figure 15 FIG. 2 is a flowchart of a second embodiment of an image encoding method according to the present application.
[0288] Based on the first embodiment of the image encoding method, the step S300 of the image encoding method of the embodiment includes steps S3001-S3002.
[0289] Step S3001: Extracting quantization step lengths corresponding to each type of feature channel from feature channel distinguishing information.
[0290] It should be noted that when distinguishing feature channels, the feature channels can be divided into multiple types, and different quantization step lengths are assigned to feature channels of different types. In this case, the feature channel distinguishing information includes classification rules of the feature channels and quantization step lengths corresponding to each type of feature channel, and the quantization step lengths corresponding to each type of feature channel can be directly extracted from the feature channel distinguishing information.
[0291] The classification rules of the feature channels are set in a similar manner as described above, and will not be described again here.
[0292] Step S3002: Constructing quantization precision parameters corresponding to each image residual error value according to the quantization step lengths.
[0293] It can be understood that after determining the quantization step lengths corresponding to each type of feature channel, the quantization step length and other parameters when quantizing the image residual error values can be determined according to the type of the feature channel corresponding to each image residual error value, so as to determine the quantization precision parameters corresponding to each image residual error value.
[0294] In a specific implementation, for the same feature channel, different quantization step lengths can also be further set, such as by setting a threshold to divide multiple value intervals, and further setting by the value interval to which the value obtained by the probability distribution parameter or according to the probability distribution parameter belongs. The step S3002 of the embodiment can include:
[0295] extracting a parameter interval threshold value from the feature channel distinguishing information;
[0296] constructing a quantization precision parameter corresponding to each image residual value according to the probability distribution parameter, the parameter interval threshold value and the quantization step length.
[0297] It should be noted that when constructing the quantization precision parameter corresponding to each feature channel according to the probability distribution parameter, the parameter interval threshold value and the quantization step length, the feature channel category to which the quantized residual value belongs can be obtained first, the quantization step length and the parameter interval threshold value corresponding to the category of the feature channel are obtained, a plurality of value intervals are divided according to the parameter interval threshold value, and then the value interval to which the probability distribution parameter corresponding to the quantized residual value belongs (or the value interval to which the mean value or variance of the probability distribution parameter belongs) is calculated. According to the value interval, the corresponding quantization step length is selected from the plurality of quantization step lengths corresponding to the category of the feature channel, so as to obtain the quantization precision parameter corresponding to each image residual value.
[0298] In the specific implementation process, for the same category of feature channel, it can be classified again, for example: a category of feature channel is divided into multiple segments, and each segment corresponds to a different quantization step length. At this time, the step S3002 described in this embodiment can include:
[0299] parsing the feature channel distinguishing information to obtain a segmented step length set corresponding to each category of feature channel;
[0300] extracting a quantization step length corresponding to each channel segment from the segmented step length set;
[0301] constructing a quantization precision parameter corresponding to each image residual value according to the quantization step length.
[0302] It should be noted that after further dividing a category of feature channel, each category of feature channel can correspond to a plurality of different quantization step lengths, which can be saved in the form of a set at this time. At this time, the feature channel distinguishing information can be parsed to obtain a segmented step length set corresponding to each category of feature channel, and then a quantization step length corresponding to each channel segment is extracted from the segmented step length set. The segmented division manners of different categories of feature channels can be different or the same, and this embodiment does not limit this.
[0303] At this time, constructing a quantization precision parameter corresponding to each image residual value according to the quantization step length can be obtaining a feature channel category corresponding to the image residual value, and determining a channel segment to which the image residual value belongs in the category of feature channel, determining a quantization step length used for quantizing the image residual value according to the feature channel category and the channel segment, and thus obtaining a quantization precision parameter corresponding to each image residual value.
[0304] In a specific implementation, when setting the quantization step, the quantization step can be set according to the image texture. In this case, the step S3002 in the embodiment can include:
[0305] Extracting the quantization step corresponding to each type of spatial point from the spatial point classification information;
[0306] Constructing the quantization precision parameter corresponding to each image residual value according to the quantization step.
[0307] It should be noted that when setting the quantization step, the spatial points in the image can be classified into multiple categories according to the image texture, and different quantization steps can be set for different categories of spatial points. For example, according to the image texture, the spatial points in the image are classified into X categories, and the quantization step of the jth category of spatial points is scale_j, and the value range of j is [1, X].
[0308] When classifying spatial points, the spatial points can be classified according to the image texture complexity corresponding to the spatial points. For example, three complexity intervals are set, [0, F1], (F1, F2], (F2, ∞), and then the spatial points are classified 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 parameter corresponding to each image residual value according to the quantization step corresponding to each type of spatial point can be obtaining the quantization step and other parameters used when quantizing the image residual value according to the category of the spatial point corresponding to the image residual value, so as to obtain the quantization precision parameter 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 classifying different categories of spatial points, the multiple points contained in the spatial points can be further classified. Different feature channels in a category of spatial points can correspond to different quantization steps. In this case, the spatial point classification information and the feature channel classification information can be used together. In this case, the step S3002 in the embodiment can include:
[0311] Reading each type of spatial point classified from the spatial point classification information;
[0312] Reading the quantization step corresponding to each type of feature channel in each type of spatial point from the feature channel classification information;
[0313] Constructing the quantization precision parameter corresponding to each image residual value according to the quantization step.
[0314] It should be noted that, according to the different characteristics of the channel, the plurality of points contained in each space point of each type of space point is further divided, and the plurality of different characteristic channels corresponding to each type of space point can correspond to different quantization step lengths, so at this time, the plurality of types of space points that can be divided can be read from the space point classification information, and then the quantization step length corresponding to each characteristic channel of each type of space point is read.
[0315] For example: the space points are divided into two types a and b, and the characteristic channels contained in a and b are both 1-X, so the quantization step length corresponding to each characteristic channel in the a type space point can be represented as scale_lista=[scale1, scale2, …, scaleX], and the quantization step length corresponding to each characteristic channel in the b type space point can be represented as scale_listb=[scale1, scale2, …, scaleX].
[0316] In a specific implementation, in order to facilitate the coding device to clearly understand the specific quantization step length setting method, the corresponding flag bit can also be pre-set in the coding device 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 according to the characteristic channel classification information, if the flag bit is set to 1, the quantization step length is determined according to the space point classification information, and if the flag bit is set to 2, the quantization step length is determined in combination with the characteristic channel classification information and the space point classification information.
[0317] It should be noted that the present embodiment only illustrates a mode of using space point classification information and characteristic channel classification information together, and the plurality of points contained in the space point can also be further divided by using the implementation mode of further dividing according to the characteristic channel provided in any of the above embodiments, which is not limited by the present embodiment.
[0318] Reference Figure 16 , Figure 16 The flowchart of a third embodiment of the image coding method of the present application is shown.
[0319] Based on the first embodiment of the image coding method described above, the step S500 of the image coding method of the present embodiment comprises steps S5001-S5003.
[0320] Step S5001: decoding the image according to the probability distribution parameter, the quantized residual value and the characteristic channel classification information to obtain a reconstructed image block and an image code rate.
[0321] It should be noted that, performing image decoding according to the probability distribution parameters, the quantized residual value and the characteristic channel distinguishing information to obtain the reconstructed image block and the image bit rate can be performed according to the image decoding method provided in any of the above embodiments, performing image decoding according to the probability distribution parameters, the quantized residual value and the characteristic channel distinguishing information to obtain the reconstructed image block, 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 optimizing and adjusting the quantization-related parameters in the characteristic channel distinction information and / or spatial point distinction information according to the reconstructed image block and the image bit rate.
[0324] In a specific implementation, the administrator 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 indicates that parameter optimization adjustment is not performed; if the optimal threshold mode flag value is 1, it indicates that parameter optimization adjustment is performed.
[0325] For ease of understanding, now combined Figure 17 This is for illustration only, but not for limitation. Figure 17 This is a flow chart of the optimal threshold mode flag function. Figure 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 into 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 optimal 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, it will be directly encoded according to 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 can be understood that if the current adjustment round is greater than or equal to the preset adjustment round, it indicates that the parameter optimization adjustment has been completed, at this time, the probability distribution parameter and the quantized residual value can be written into the image code stream, and the image code stream is transmitted to the decoding device end. Among them, the adjusted feature channel distinguishing information and / or spatial point distinguishing information can also be written into the image code stream.
[0329] If the current adjustment round is less than the preset adjustment round, it indicates that the parameter optimization adjustment has not been completed, therefore, the step of constructing the quantization precision parameter corresponding to each feature channel according to the feature channel distinguishing information can be returned.
[0330] For the convenience of understanding, the present application will be described below in conjunction with Figure 18 , but the present application is not limited thereto. Figure 18 The parameter optimization flowchart of the present embodiment is shown in Figure 18 , wherein the index indicating the distortion D can be one or a combination of multiple indexes such as msssim, vif, fsim, nlpd, iw-ssim, vmaf, psnr_HVS, X is the related threshold or parameter of the distinguished feature channel, res_q is the quantized residual value, sigma is the probability distribution parameter σ, step_X can be set by the management personnel of the encoding device according to actual needs, and the iteration number limit can be that the current adjustment round is compared 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 met; if the current adjustment round is less than the preset adjustment round, it is determined that the iteration number limit is not met.
[0331] The present embodiment obtains the reconstructed image block and the image code rate by decoding the image according to the probability distribution parameter, the quantized residual value and the feature channel distinguishing information; adjusts the feature channel distinguishing information and / or spatial point distinguishing information according to the reconstructed image block and the image code rate; and writes the probability distribution parameter and the quantized residual value into the image code stream if the current adjustment round is greater than or equal to the preset adjustment round. Since the image is decoded and the feature channel distinguishing information and / or spatial point distinguishing information is adjusted according to the reconstructed image block and the image code 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, the present embodiment further proposes a storage medium, the storage medium stores an image encoding or image decoding program, the image encoding program is executed by the processor to realize the steps of the image encoding method as described above, and the image decoding program is executed by the processor to realize the steps of the image decoding method as described above.
[0333] Referring to Figure 19 ,Figure 19 A structure block diagram of a first embodiment of an image decoding apparatus of the present application.
[0334] As shown in Figure 19 , the image decoding apparatus provided by the embodiment of the present application comprises:
[0335] An entropy decoding module 10, configured to acquire feature channel distinguishing information and / or spatial point distinguishing information, and decode an image code stream to obtain quantized residual values;
[0336] A parameter construction module 20, configured to construct inverse quantization precision parameters corresponding to the quantized residual values according to the feature channel distinguishing information and / or the spatial point distinguishing information;
[0337] An inverse quantization module 30, configured to inverse quantize the quantized residual values based on the inverse quantization precision parameters to obtain reconstructed residual values;
[0338] A synthesis transformation module 40, configured to perform synthesis transformation on the reconstructed residual values to obtain a reconstructed image block.
[0339] For the convenience of understanding, the above Figure 3 is described here, but the present solution is not limited thereto. In the present embodiment, the entropy decoding module can perform the entropy decoding process as shown in Figure 3 , the parameter construction module and the inverse quantization module can perform the inverse quantization process as shown in Figure 3 , and the synthesis transformation module can perform the synthesis transformation process in Figure 3 by using a synthesis transformation network.
[0340] The present embodiment acquires feature channel distinguishing information and / or spatial point distinguishing information, decodes an image code stream to obtain quantized residual values, constructs inverse quantization precision parameters corresponding to the quantized residual values according to the feature channel distinguishing information and / or the spatial point distinguishing information, inverse quantizes the quantized residual values based on the inverse quantization precision parameters to obtain reconstructed residual values, and performs synthesis transformation on the reconstructed residual values to obtain a reconstructed image block. Since the inverse quantization is performed according to the corresponding inverse quantization parameters constructed based on the feature channel distinguishing information and / or the spatial point distinguishing information, different quantization parameters can be set according to the differences in feature channel and spatial point image texture during the encoding process, so that more important features can bear smaller quantization loss, thereby improving the performance of encoding and decoding.
[0341] In a possible implementation manner of the present embodiment, the image code stream comprises 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 further configured to extract a coding distribution parameter from the first image code stream, decode the coding distribution parameter to obtain a probability distribution parameter, quantize the probability distribution parameter to obtain a distribution quantization parameter, and decode the second image code stream based on the distribution quantization parameter to obtain a quantized residual value.
[0343] In a possible implementation of the present embodiment, the entropy decoding module 10 is further configured to construct a probability quantization parameter based on the feature channel distinguishing information and / or the spatial point distinguishing 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 the present embodiment, the entropy decoding module 10 is further configured to decode the first image code stream or the second image code stream to obtain feature channel distinguishing information and / or spatial point distinguishing information.
[0345] In a possible implementation of the present embodiment, the image code stream further includes a third image code stream, and the third image code stream is configured to transmit distinguishing information.
[0346] The entropy decoding module 10 is further configured to decode the third image code stream to obtain feature channel distinguishing information and / or spatial point distinguishing information.
[0347] In a possible implementation of the present embodiment, the parameter construction module 20 is further configured to extract a quantization step length corresponding to each type of feature channel from the feature channel distinguishing information, and construct a dequantization precision parameter corresponding to each quantized residual value based on the quantization step length.
[0348] In a possible implementation of the present embodiment, the parameter construction module 20 is further configured to extract a quantization step length corresponding to each type of spatial point from the spatial point distinguishing information, and construct a dequantization precision parameter corresponding to each quantized residual value based on the quantization step length.
[0349] In a possible implementation of the present embodiment, the parameter construction module 20 is further configured to read each type of spatial point divided from the spatial point distinguishing information, read a quantization step length corresponding to each type of feature channel in each type of spatial point from the feature channel distinguishing information, and construct a dequantization precision parameter corresponding to each quantized residual value based on the quantization step length.
[0350] In a possible implementation of the present embodiment, the parameter construction module 20 is further configured to decode an image code stream to obtain a probability distribution parameter, extract a parameter interval threshold from the feature channel distinguishing information, and construct a dequantization precision parameter corresponding to each quantized residual value based on the probability distribution parameter, the quantization step length, and the parameter interval threshold.
[0351] In a possible implementation of the present embodiment, the parameter construction module 20 is further configured to extract image block information corresponding to each feature channel and parameter setting rules from the feature channel distinguishing information; decode the image code stream to obtain a probability distribution parameter; calculate a distribution parameter mean corresponding to each image block information according to the probability distribution parameter; match the distribution parameter mean with the parameter setting rules to obtain a quantization step length corresponding to each image block information; and construct a dequantization precision parameter corresponding to each quantization residual value according to the quantization step length.
[0352] In a possible implementation of the present embodiment, the parameter construction module 20 is further configured to parse the feature channel distinguishing information to obtain a segmentation step length set corresponding to each feature channel; extract a quantization step length corresponding to each channel segment from the segmentation step length set; and construct a dequantization precision parameter corresponding to each quantization residual value according to the quantization step length.
[0353] Reference Figure 20 , Figure 20 is a structure block diagram of a first embodiment of an image coding device of the present application.
[0354] As shown in Figure 20 , the image coding device provided by the present embodiment includes:
[0355] An analysis transformation module 100 configured to perform analysis transformation processing on a to-be-processed image block to obtain image features.
[0356] A residual calculation module 200 configured to perform residual calculation on the image features to obtain image residual values and a probability distribution parameter.
[0357] A parameter construction module 300 configured to construct a quantization precision parameter corresponding to each feature channel according to feature channel distinguishing information and / or spatial point distinguishing information.
[0358] A quantization module 400 configured to perform quantization processing on the image residual values based on the quantization precision parameter to obtain quantization residual values.
[0359] An entropy coding module 500 configured to write the probability distribution parameter and the quantization residual values into an image code stream.
[0360] For ease of understanding, the above Figure 3 is described herein, but the present solution is not limited thereto, and in the present embodiment, the analysis transformation module can be configured to perform an analysis transformation process as shown in Figure 3 , the residual calculation module, the parameter construction module and the quantization module are configured to perform a quantization process as shown in Figure 3 , and the entropy coding module is configured to perform an entropy coding process as shown in Figure 3An entropy coding process in the image coding method.
[0361] The embodiment obtains image features by performing analysis and transformation processing on the image block 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 according to feature channel distinguishing information and / or spatial point distinguishing 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 an image code stream. In the encoding process, different quantization parameters can be set according to the differences between feature channels and spatial point image textures, so that more important features bear smaller quantization loss, thereby improving the performance of encoding and decoding.
[0362] In a possible implementation manner of the 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 configured 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 quantized residual values into the second image code stream based on the distribution quantization parameters.
[0364] In a possible implementation manner of the embodiment, the entropy coding module 500 is further configured to construct probability quantization parameters according to the feature channel distinguishing information and / or the spatial point distinguishing information, and quantize the probability distribution parameters based on the probability quantization parameters to obtain distribution quantization parameters.
[0365] In a possible implementation manner of the embodiment, the entropy coding module 500 is further configured to write the feature channel distinguishing information and / or the spatial point distinguishing information into the first image code stream or the second image code stream.
[0366] In a possible implementation manner of the 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 configured to write the feature channel distinguishing information and / or the spatial point distinguishing information into the third image code stream.
[0368] In a possible implementation manner of the embodiment, the parameter construction module 300 is further configured to extract quantization step lengths corresponding to various feature channels from the feature channel distinguishing information, and construct quantization precision parameters corresponding to each image residual value according to the quantization step lengths.
[0369] In a possible implementation of the present embodiment, the parameter construction module 300 is further configured to extract a parameter interval threshold from the feature channel distinguishing information; and construct a quantization precision parameter corresponding to each image residual value according to the probability distribution parameter, the parameter interval threshold, and the quantization step.
[0370] In a possible implementation of the present embodiment, the parameter construction module 300 is further configured to parse the feature channel distinguishing information to obtain a set of segmentation steps corresponding to each feature channel; extract a quantization step corresponding to each channel segment from the set of segmentation steps; and construct a quantization precision parameter corresponding to each image residual value according to the quantization step.
[0371] In a possible implementation of the present embodiment, the parameter construction module 300 is further configured to extract a quantization step corresponding to each type of spatial point from the spatial point distinguishing information; and construct a quantization precision parameter corresponding to each image residual value according to the quantization step.
[0372] In a possible implementation of the present embodiment, the parameter construction module 300 is further configured to read each type of spatial point divided from the spatial point distinguishing information; read a quantization step corresponding to each feature channel in each type of spatial point from the feature channel distinguishing information; and construct a quantization precision parameter corresponding to each image residual value according to the quantization step.
[0373] In a possible implementation of the present embodiment, the entropy encoding module 500 is further configured to perform image decoding according to the probability distribution parameter, the quantized residual value, and the feature channel distinguishing information to obtain a reconstructed image block and an image code rate; adjust the feature channel distinguishing information and / or the spatial point distinguishing information according to the reconstructed image block and the image code rate; and write the probability distribution parameter and the quantized residual value into an image code stream if a current adjustment round is greater than or equal to a preset adjustment round.
[0374] In a possible implementation of the present embodiment, the entropy encoding module 500 is further configured to return to the step of constructing a quantization precision parameter corresponding to each feature channel according to the feature channel distinguishing 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 the technical solutions of the present application are not limited in any way. In specific applications, those skilled in the art can make settings according to needs, and the present application does not limit this.
[0376] It should be noted that the above-described workflow is merely illustrative and does not limit the scope of protection of the present application. In actual applications, a person skilled in the art can select part or all of the above-described workflow to achieve the purpose of the embodiment according to actual needs, which is not limited herein.
[0377] In addition, technical details not described in detail in the embodiment can be referred to the image encoding or image decoding method provided by any embodiment of the present application, which will not be described here.
[0378] In addition, it should be noted that in this document, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or system. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or system including the element.
[0379] The above-mentioned embodiment numbers of the present application are only for description, not representing the advantages or disadvantages of the embodiments.
[0380] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by software and necessary general hardware platform, or by hardware. In many cases, the former is a better embodiment. Based on this understanding, the technical solutions of the present application or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk), and includes a plurality of instructions for making a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) execute the methods described in various embodiments of the present application.
[0381] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, is also included in the patent protection scope of the present application.
Claims
1. An image decoding method characterized by, The image decoding method comprises the following steps: The feature channel differentiation information is parsed, and for any quantized residual value, a segmented step set corresponding to each feature channel is obtained, wherein the segmented step set corresponding to a feature channel comprises a plurality of different quantization steps; A quantization step corresponding to a channel segment to which the quantized residual value belongs is extracted from the segmented step set corresponding to one feature channel; According to the quantization step, a dequantization precision parameter corresponding to the quantized residual value is constructed; 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; Before the step of parsing the feature channel differentiation information and obtaining, for any quantized residual value, a segmented step set corresponding to each feature channel, the method further comprises the following steps: Distribution parameters are extracted from the image code stream; The distribution parameters are decoded to obtain probability distribution parameters; According to the feature channel corresponding to the probability distribution parameters, probability quantization parameters are constructed; wherein different feature channels correspond to different probability quantization parameters; The probability distribution parameters are quantized based on the probability quantization parameters to obtain distribution quantization parameters; The image code stream is decoded based on the distribution quantization parameters to obtain quantized residual values.
2. The image decoding method of claim 1, wherein, Before the step of parsing the feature channel differentiation information and obtaining, for any quantized residual value, a segmented step set corresponding to each feature channel, the method further comprises the following steps: The image code stream is decoded to obtain feature channel differentiation information.
3. An image coding method characterized by, The image encoding method comprises the following steps: An image feature is obtained by analyzing and transforming a to-be-processed image block; An image residual value and a probability distribution parameter are obtained by performing residual calculation on the image feature; The feature channel differentiation information is parsed, and for any image residual value, a segmented step set corresponding to each feature channel is obtained, wherein the segmented step set corresponding to a feature channel comprises a plurality of different quantization steps; A quantization step corresponding to a channel segment to which the image residual value belongs is extracted from the segmented step set corresponding to one feature channel; According to the quantization step, a quantization precision parameter corresponding to the image residual value is constructed; The image residual value is quantized 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; The step of writing the probability distribution parameter and the quantized residual value into the image code stream comprises the following steps: The probability distribution parameter is written into the image code stream; According to the feature channel corresponding to the probability distribution parameters, probability quantization parameters are constructed; wherein different feature channels correspond to different probability quantization parameters; The probability distribution parameters are quantized based on the probability quantization parameters to obtain distribution quantization parameters; The quantized residual value is written into the image code stream based on the distribution quantization parameters.
4. The image coding method of claim 3, wherein, The image encoding method further comprises the following steps: The feature channel differentiation information is written into the image code stream.
5. An image decoding apparatus characterized by comprising: The image decoding device comprises: The entropy decoding module is configured to extract the coding distribution parameter from the image code stream, decode the coding distribution parameter to obtain a probability distribution parameter, construct a probability quantization parameter according to a feature channel corresponding to the probability distribution parameter, wherein different feature channels correspond to different probability quantization parameters, quantize the probability distribution parameter based on the probability quantization parameter to obtain a distribution quantization parameter, and decode the image code stream based on the distribution quantization parameter to obtain a quantized residual value. The parameter construction module is configured to parse the feature channel distinguishing information, for any quantized residual value, obtain a set of segmentation step lengths corresponding to each type of feature channel, wherein the set of segmentation step lengths corresponding to one type of feature channel includes a plurality of different quantization step lengths, extract a quantization step length corresponding to a channel segment to which the quantized residual value belongs from the set of segmentation step lengths corresponding to one type of feature channel, and construct a dequantization precision parameter corresponding to the quantized residual value according to the quantization step length. The dequantization module is configured to, for any quantized residual value, perform dequantization on the quantized residual value based on the dequantization precision parameter corresponding to the quantized residual value to obtain a reconstructed residual value.
6. An image coding apparatus characterized by comprising: The image encoding apparatus comprises: The analysis and transformation module is configured to perform analysis and transformation processing on a to-be-processed image block to obtain an image feature. The residual calculation module is configured to perform residual calculation on the image feature to obtain an image residual value and a probability distribution parameter. The parameter construction module is configured to parse the feature channel distinguishing information, for any image residual value, obtain a set of segmentation step lengths corresponding to each type of feature channel, wherein the set of segmentation step lengths corresponding to one type of feature channel includes a plurality of different quantization step lengths, extract a quantization step length corresponding to a channel segment to which the image residual value belongs from the set of segmentation step lengths corresponding to one type of feature channel, and construct a quantization precision parameter corresponding to the image residual value according to the quantization step length. The quantization module is configured to perform quantization processing on the image residual value based on the quantization precision parameter to obtain a quantized residual value. The entropy encoding module is configured to write the probability distribution parameter and the quantized residual value into an image code stream. The entropy encoding module is further configured to write the probability distribution parameter into an image code stream, construct a probability quantization parameter according to a feature channel corresponding to the probability distribution parameter, wherein different feature channels correspond to different probability quantization parameters, quantize the probability distribution parameter based on the probability quantization parameter to obtain a distribution quantization parameter, and write the quantized residual value into the image code stream based on the distribution quantization parameter.
7. A decoding device, comprising: The decoding device comprises a processor, a memory, and a decoding program stored on the memory and executable on the processor, and the decoding program, when executed by the processor, implements the image decoding method of any one of claims 1-2.
8. An encoding device, comprising: The encoding device comprises a processor, a memory, and an encoding program stored on the memory and executable on the processor, and the encoding program, when executed by the processor, implements the image encoding method of any one of claims 3-4.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores an image decoding program and / or an image encoding program thereon; The image decoding program, when executed by the processor, implements the image decoding method according to any one of claims 1-2, or the image encoding program, when executed by the processor, implements the image encoding method according to any one of claims 3-4.
10. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the image decoding method according to any one of claims 1-2, or the computer program, when executed by the processor, implements the image encoding method according to any one of claims 3-4.
Citation Information
Patent Citations
Encoding method and device, decoding method and device, electronic equipment and storage medium
CN111641832A
Bit allocation for neural network feature channel compression
WO2022191729A1