CN111641826B - Method, device and system for encoding and decoding data - Google Patents

Method, device and system for encoding and decoding data Download PDF

Info

Publication number
CN111641826B
CN111641826B CN201910157698.0A CN201910157698A CN111641826B CN 111641826 B CN111641826 B CN 111641826B CN 201910157698 A CN201910157698 A CN 201910157698A CN 111641826 B CN111641826 B CN 111641826B
Authority
CN
China
Prior art keywords
probability distribution
parameter
network
entropy
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910157698.0A
Other languages
Chinese (zh)
Other versions
CN111641826A (en
Inventor
林超逸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910157698.0A priority Critical patent/CN111641826B/en
Publication of CN111641826A publication Critical patent/CN111641826A/en
Application granted granted Critical
Publication of CN111641826B publication Critical patent/CN111641826B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/149Data rate or code amount at the encoder output by estimating the code amount by means of a model, e.g. mathematical model or statistical model
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • H04N19/395Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability involving distributed video coding [DVC], e.g. Wyner-Ziv video coding or Slepian-Wolf video coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Abstract

The disclosure relates to a method, a device and a system for encoding and decoding data, and belongs to the technical field of data compression. The method comprises the following steps: inputting the quantized transformation coefficients and the corresponding quantization step size into a first processing network of the entropy model, and acquiring first probability distribution parameters which are processed and output by the first processing network and reflect the probability distribution of the quantized transformation coefficients; determining probability distribution of the quantized transform coefficients according to the first probability distribution parameter and the second probability distribution parameter; and performing entropy coding processing on the quantized transformation coefficient according to the probability distribution to obtain an entropy coding result. By adopting the method and the device, the data compression rate is higher when entropy coding processing is carried out on the quantized transformation coefficient according to the more accurate first probability distribution parameter and the second probability distribution parameter.

Description

Method, device and system for encoding and decoding data
Technical Field
The present disclosure relates to the field of data compression technologies, and in particular, to a method, an apparatus, and a system for encoding and decoding data.
Background
Before data such as video data is transmitted or stored, the video data needs to be encoded to compress the video data, and the data volume of the compressed video data is smaller, so that the transmission and storage of the video data are more facilitated. The method comprises the steps of coding by taking an image in video data as a unit, firstly carrying out transformation processing on the image to obtain a transformation coefficient, then carrying out quantization processing on the transformation coefficient to obtain a quantized transformation coefficient, finally determining probability distribution corresponding to the quantized transformation coefficient, and carrying out entropy coding processing on the quantized transformation coefficient based on the probability distribution to obtain a final image code stream. The quantized transform coefficient may be a multi-dimensional tensor, which includes a set of data, and each data corresponds to a data bit.
The probability of the data value of each data bit in the quantized transformation coefficient meets the Gaussian distribution, the parameters included in the Gaussian distribution have the mean value and the variance, and after the mean value and the variance are determined, the probability corresponding to the variable can be determined by giving the value of the variable, so that the problem of determining the probability distribution can be converted into the problem of determining the mean value and the variance. The mean value is generally set to 0, and the variance is determined in the case of a mean value of 0. The related art provides a way to determine the variance, which can be to train the encoder network and the decoder network in advance, wherein both the encoder network and the decoder network can be neural networks, and the encoder network and the decoder network can be used jointly. The quantized transform coefficients may be input to an encoder network, which outputs encoding parameters, performs quantization processing on the encoding parameters, inputs the quantized encoding parameters into a decoder network, which outputs the variance. Further, a probability distribution may be determined based on the mean and the variance, and entropy encoding processing may be performed on the quantized transform coefficients based on the probability distribution. It should be noted that the probability distribution is an estimated value, and the probability distribution estimated by different methods may be different. When the determined probability distribution is more accurate, the data compression rate in the process of entropy-encoding the quantized transform coefficient is higher.
In carrying out the present disclosure, the inventors have found that at least the following problems exist:
in the above process, the average value in the probability distribution is directly set to 0, but the average value in the actual situation is probably not 0, and the set average value does not conform to the actual situation, which may further result in low accuracy of the probability distribution and low compression rate of the obtained data.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides the following technical solutions:
according to a first aspect of embodiments of the present disclosure, there is provided a method of encoding data, the method comprising:
inputting the quantized transform coefficients and corresponding quantization step sizes into a first processing network of an entropy model, and acquiring first probability distribution parameters which are output by the first processing network and reflect probability distribution of the quantized transform coefficients;
preprocessing the first probability distribution parameters and the quantized transform coefficients and inputting the preprocessed transform coefficients into a second processing network of the entropy model, and acquiring second probability distribution parameters which are processed and output by the second processing network and reflect probability distribution of the quantized transform coefficients;
determining a probability distribution of the quantized transform coefficients according to the first probability distribution parameter and the second probability distribution parameter;
entropy coding processing is carried out on the quantized transformation coefficient according to the probability distribution to obtain an entropy coding result;
acquiring side information corresponding to the quantized transform coefficients;
and generating a coded stream sent to a decoding end according to the entropy coding result and the side information.
In one possible implementation manner of the present application, the probability distribution is a gaussian distribution, the first probability distribution parameter is a mean value of a corresponding gaussian distribution model, and the second probability distribution parameter is a variance of the corresponding gaussian distribution model; alternatively, the first and second electrodes may be,
the probability distribution is a laplace distribution, the first probability distribution parameter is a position parameter in a corresponding laplace distribution model, and the second probability distribution parameter is a scale parameter in the laplace distribution model.
In one possible implementation manner of the present application, the inputting the quantized transform coefficients and the corresponding quantization step size into a first processing network of an entropy model, and obtaining a first probability distribution parameter reflecting a probability distribution of the quantized transform coefficients, which is output by the first processing network, includes:
inputting the quantized transform coefficients and corresponding quantization step size into a first processing network of an entropy model, obtaining the first probability distribution parameters output after processing by the first processing network and first parameters generated by the first processing network before outputting the first probability distribution parameters;
the second processing network, which preprocesses the first probability distribution parameter and the quantized transform coefficient and inputs the preprocessed transform coefficient to the entropy model, obtains a second probability distribution parameter that is output by the second processing network and that reflects a probability distribution of the quantized transform coefficient, and includes:
preprocessing the first probability distribution parameters and the quantized transform coefficients and inputting the preprocessed transform coefficients into a second processing network of the entropy model, obtaining the second probability distribution parameters output by the second processing network and second parameters generated by the second processing network before outputting the second probability distribution parameters;
the obtaining of the side information corresponding to the quantized transform coefficient includes:
and generating side information according to the quantization step length corresponding to the quantized transform coefficient, the first parameter and the second parameter.
In one possible implementation of the present application, the first processing network of the entropy model includes a first encoder network, a first quantizer and a first decoder network, the first processing network inputting the quantized transform coefficients and corresponding quantization step sizes into the entropy model, acquiring the first probability distribution parameter output after processing by the first processing network and a first parameter generated by the first processing network before outputting the first probability distribution parameter, including:
inputting the quantized transform coefficient into the first encoder network, and acquiring a first super-a-priori parameter output by the first encoder network;
inputting the first prior parameter and the corresponding quantization step size into the first quantizer, and acquiring the first parameter output by the quantizer after quantization;
inputting the first parameter into the first decoder network, obtaining the first probability distribution parameter output by the first decoder network.
In one possible implementation of the present application, the second processing network of the entropy model includes a second encoder network, a second quantizer and a second decoder network, the second processing network preprocessing the first probability distribution parameter and the quantized transform coefficient and inputting the preprocessed first probability distribution parameter and quantized transform coefficient into the entropy model, and acquiring the second probability distribution parameter output by the second processing network and a second parameter generated by the second processing network before outputting the second probability distribution parameter, the second processing network including:
determining an absolute value of a difference of the first probability distribution parameter and the quantized transform coefficient;
inputting the absolute value of the difference value into the second encoder network, and acquiring a second super-a-priori parameter output by the second encoder network;
inputting the second super-a-priori parameter and the corresponding quantization step size into the second quantizer, and obtaining the second parameter output by the second decoder network after quantization;
inputting the second parameter into the second decoder network, and obtaining the second probability distribution parameter output by the second decoder network.
In a possible implementation manner of the present application, the generating side information according to the quantization step corresponding to the quantized transform coefficient, the first parameter, and the second parameter includes:
entropy coding processing is carried out on the first parameter to obtain a first parameter after entropy coding, and entropy coding processing is carried out on the second parameter to obtain a second parameter after entropy coding;
performing entropy coding processing on a quantization step corresponding to the quantized transform coefficient to obtain an entropy coded quantization step;
determining side information based on the entropy-encoded quantization step, the entropy-encoded first parameter, and the entropy-encoded second parameter.
In one possible implementation of the present application, the first encoder network includes a first network structure, the first network structure includes at least one LSTM network element and/or at least one convolutional layer, and the first decoding network includes a network structure symmetric to the first network structure.
In a possible implementation manner of the present application, the second encoder network includes a second network structure, the second network structure includes at least one LSTM network element and/or at least one convolutional layer, and the second decoding network includes a network structure symmetric to the second network structure.
According to a second aspect of embodiments of the present disclosure, there is provided a method of decoding data, the method comprising:
receiving an encoded stream sent by an encoding end, wherein the encoded stream comprises an entropy encoding result and side information;
determining a first probability distribution parameter and a second probability distribution parameter reflecting a probability distribution of the quantized coefficient of variation based on the side information;
determining a probability distribution of quantized transform coefficients based on the first and second probability distribution parameters;
and performing entropy decoding processing on the entropy coding result based on the probability distribution to obtain a quantized transform coefficient.
In one possible implementation manner of the present application, the probability distribution is a gaussian distribution, the first probability distribution parameter is a mean value of a corresponding gaussian distribution model, and the second probability distribution parameter is a variance of the corresponding gaussian distribution model; alternatively, the first and second electrodes may be,
the probability distribution is a laplace distribution, the first probability distribution parameter is a position parameter in a corresponding laplace distribution model, and the second probability distribution parameter is a scale parameter in the laplace distribution model.
In one possible implementation manner of the present application, the side information includes an entropy-encoded first parameter, an entropy-encoded second parameter, and an entropy-encoded quantization step, and the determining, based on the side information, a first probability distribution parameter and a second probability distribution parameter that reflect a probability distribution of a quantized coefficient of variation includes:
performing entropy decoding processing on the entropy-encoded first parameter to obtain a first parameter;
entropy decoding the entropy-encoded second parameter to obtain a second parameter;
inputting the first parameter into a first decoder network, and acquiring a first probability distribution parameter reflecting the probability distribution of the quantized variation coefficient;
and inputting the second parameter into a second decoder network, and acquiring a second probability distribution parameter reflecting the probability distribution of the quantized variation coefficient.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for encoding data, the apparatus comprising:
an obtaining module, configured to input the quantized transform coefficients and corresponding quantization step sizes into a first processing network of an entropy model, and obtain first probability distribution parameters, which are output by the first processing network and used for processing and reflecting probability distributions of the quantized transform coefficients; preprocessing the first probability distribution parameters and the quantized transform coefficients and inputting the preprocessed transform coefficients into a second processing network of the entropy model, and acquiring second probability distribution parameters which are processed and output by the second processing network and reflect probability distribution of the quantized transform coefficients;
a determining module for determining a probability distribution of the quantized transform coefficients according to the first probability distribution parameter and the second probability distribution parameter;
the entropy coding module is used for carrying out entropy coding processing on the quantized transformation coefficient according to the probability distribution to obtain an entropy coding result;
the obtaining module is configured to obtain side information corresponding to the quantized transform coefficient;
and the generating module is used for generating a coding stream sent to a decoding end according to the entropy coding result and the side information.
In one possible implementation manner of the present application, the probability distribution is a gaussian distribution, the first probability distribution parameter is a mean value of a corresponding gaussian distribution model, and the second probability distribution parameter is a variance of the corresponding gaussian distribution model; alternatively, the first and second electrodes may be,
the probability distribution is a laplace distribution, the first probability distribution parameter is a position parameter in a corresponding laplace distribution model, and the second probability distribution parameter is a scale parameter in the laplace distribution model.
In a possible implementation manner of the present application, the obtaining module is configured to:
inputting the quantized transform coefficients and corresponding quantization step size into a first processing network of an entropy model, obtaining the first probability distribution parameters output after processing by the first processing network and first parameters generated by the first processing network before outputting the first probability distribution parameters;
preprocessing the first probability distribution parameters and the quantized transform coefficients and inputting the preprocessed transform coefficients into a second processing network of the entropy model, obtaining the second probability distribution parameters output by the second processing network and second parameters generated by the second processing network before outputting the second probability distribution parameters;
and generating side information according to the quantization step length corresponding to the quantized transform coefficient, the first parameter and the second parameter.
In one possible implementation manner of the present application, the first processing network of entropy models includes a first encoder network, a first quantizer and a first decoder network, and the obtaining module is configured to:
inputting the quantized transform coefficients into the first encoder network, and obtaining first over-the-air parameters output by the first encoder network;
inputting the first prior parameter and the corresponding quantization step size into the first quantizer, and acquiring the first parameter output by the quantizer after quantization;
inputting the first parameter into the first decoder network, obtaining the first probability distribution parameter output by the first decoder network.
In a possible implementation manner of the present application, the second processing network of entropy models includes a second encoder network, a second quantizer and a second decoder network, and the obtaining module is configured to:
determining an absolute value of a difference of the first probability distribution parameter and the quantized transform coefficient;
inputting the absolute value of the difference value into the second encoder network, and acquiring a second super-a-priori parameter output by the second encoder network;
inputting the second super-a-priori parameter and the corresponding quantization step size into the second quantizer, and obtaining the second parameter output by the second decoder network after quantization;
inputting the second parameter into the second decoder network, and obtaining the second probability distribution parameter output by the second decoder network.
In a possible implementation manner of the present application, the generating module is configured to:
entropy coding processing is carried out on the first parameter to obtain a first parameter after entropy coding, and entropy coding processing is carried out on the second parameter to obtain a second parameter after entropy coding;
performing entropy coding processing on a quantization step corresponding to the quantized transform coefficient to obtain an entropy coded quantization step;
determining side information based on the entropy-encoded quantization step, the entropy-encoded first parameter, and the entropy-encoded second parameter.
In one possible implementation of the present application, the first encoder network includes a first network structure, the first network structure includes at least one LSTM network element and/or at least one convolutional layer, and the first decoding network includes a network structure symmetric to the first network structure.
In a possible implementation manner of the present application, the second encoder network includes a second network structure, the second network structure includes at least one LSTM network element and/or at least one convolutional layer, and the second decoding network includes a network structure symmetric to the second network structure.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an apparatus for decoding data, the apparatus comprising:
a receiving module, configured to receive an encoded stream sent by an encoding end, where the encoded stream includes an entropy encoding result and side information;
a determining module for determining a first probability distribution parameter and a second probability distribution parameter reflecting a probability distribution of the quantized coefficient of variation based on the side information; determining a probability distribution of quantized transform coefficients based on the first and second probability distribution parameters;
and the entropy decoding module is used for carrying out entropy decoding processing on the entropy coding result based on the probability distribution to obtain a quantized transformation coefficient.
In one possible implementation manner of the present application, the probability distribution is a gaussian distribution, the first probability distribution parameter is a mean value of a corresponding gaussian distribution model, and the second probability distribution parameter is a variance of the corresponding gaussian distribution model; alternatively, the first and second electrodes may be,
the probability distribution is a laplace distribution, the first probability distribution parameter is a position parameter in a corresponding laplace distribution model, and the second probability distribution parameter is a scale parameter in the laplace distribution model.
In a possible implementation manner of the present application, the side information includes an entropy-encoded first parameter, an entropy-encoded second parameter, and an entropy-encoded quantization step, and the determining module is configured to:
performing entropy decoding processing on the entropy-encoded first parameter to obtain a first parameter;
entropy decoding the entropy-encoded second parameter to obtain a second parameter;
inputting the first parameter into a first decoder network, and acquiring a first probability distribution parameter reflecting the probability distribution of the quantized variation coefficient;
and inputting the second parameter into a second decoder network, and acquiring a second probability distribution parameter reflecting the probability distribution of the quantized variation coefficient.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a video coding and decoding system, the system comprising an encoding end and a decoding end, wherein:
the coding end is used for inputting the quantized transformation coefficient and the corresponding quantization step size into a first processing network of an entropy model, and acquiring a first probability distribution parameter which is processed and output by the first processing network and reflects the probability distribution of the quantized transformation coefficient; preprocessing the first probability distribution parameters and the quantized transform coefficients and inputting the preprocessed transform coefficients into a second processing network of the entropy model, and acquiring second probability distribution parameters which are processed and output by the second processing network and reflect probability distribution of the quantized transform coefficients; determining a probability distribution of the quantized transform coefficients according to the first probability distribution parameter and the second probability distribution parameter; entropy coding processing is carried out on the quantized transformation coefficient according to the probability distribution to obtain an entropy coding result; acquiring side information corresponding to the quantized transform coefficients; generating a coded stream sent to the decoding end according to the entropy coding result and the side information;
the decoding end is configured to receive an encoded stream sent by the encoding end, where the encoded stream includes an entropy encoding result and side information; determining a first probability distribution parameter and a second probability distribution parameter reflecting a probability distribution of the quantized coefficient of variation based on the side information; determining a probability distribution of quantized transform coefficients based on the first and second probability distribution parameters; and performing entropy decoding processing on the entropy coding result based on the probability distribution to obtain a quantized transformation coefficient.
According to a sixth aspect of the embodiments of the present disclosure, there is provided an encoding end, the encoding end comprising a processor, a communication interface, a memory and a communication bus, wherein:
the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is used for executing the program stored in the memory so as to realize the method for coding the data.
According to a seventh aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium having stored therein a computer program, which when executed by a processor implements the above-mentioned method of encoding data.
According to an eighth aspect of the embodiments of the present disclosure, there is provided a decoding end comprising a processor, a communication interface, a memory and a communication bus, wherein:
the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is used for executing the program stored in the memory so as to realize the method for decoding the data.
According to a ninth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the above-described method of decoding data.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
by the method provided by the embodiment of the disclosure, the situation that the first probability distribution parameter is directly set as 0 as the mean value is avoided, the first probability distribution parameter is determined through the quantized transform coefficient and the first processing network, and the determined first probability distribution parameter is more practical compared with a directly set value. And then, obtaining more accurate probability distribution according to the more accurate first probability distribution parameter and the more accurate second probability distribution parameter, wherein the obtained data compression ratio is higher when entropy coding processing is carried out on the quantized transformation coefficient based on the more accurate probability distribution.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. In the drawings:
FIG. 1 is a block diagram illustrating a system for encoding and decoding data in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method of encoding data in accordance with an example embodiment;
FIG. 3 is a flow diagram illustrating a method of encoding data in accordance with an example embodiment;
FIG. 4 is a block diagram illustrating an apparatus for encoding data in accordance with an example embodiment;
FIG. 5 is a block diagram illustrating an apparatus for encoding data in accordance with an example embodiment;
FIG. 6 is a schematic diagram of a network shown in accordance with an exemplary embodiment;
FIG. 7 is a schematic diagram illustrating the structure of a network in accordance with an exemplary embodiment;
FIG. 8 is a block diagram illustrating an apparatus for encoding data in accordance with an example embodiment;
FIG. 9 is a flowchart illustrating a method of decoding data in accordance with an example embodiment;
fig. 10 is a block diagram illustrating an apparatus for decoding data in accordance with an exemplary embodiment;
FIG. 11 is a block diagram illustrating an apparatus for encoding data in accordance with an example embodiment;
fig. 12 is a block diagram illustrating an apparatus for decoding data according to an example embodiment;
fig. 13 is a block diagram illustrating a decoding side according to an exemplary embodiment;
fig. 14 is a schematic diagram illustrating a structure of a decoding end according to an exemplary embodiment.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The embodiment of the disclosure provides a method for encoding data and a method for decoding data, wherein the method for entropy encoding can be realized by an encoding end, and the method for entropy decoding can be realized by a decoding end. As shown in the upper diagram of fig. 1, the encoding end may include a transform module, a quantization module, an entropy coding module, and an entropy model. As shown in the lower diagram of fig. 1, the decoding end may include an inverse transform module, an inverse quantization module, and an entropy decoding module.
For the encoding end, data to be encoded can be obtained, and the data to be encoded can be images, videos, audios and the like, and can be any information which can be described by a matrix or information which can be described by a vector. The data to be coded can be input into the transformation module, transformed and output as transformation coefficients. The transform coefficients may be input to a quantization module, subjected to quantization, and output as quantized transform coefficients. The quantized transform coefficients may be input into an entropy model and output as probability distribution parameters of a probability distribution. The quantized transform coefficients and the probability distribution parameters can be simultaneously input into an entropy coding module for entropy coding processing, and the result is output as an entropy coding result. The entropy coding result may be transmitted to a decoding end. Meanwhile, the entropy model can also output side information. The side information may be sent to a decoding side, and the decoding side may recover the probability distribution parameters based on the side information.
For the decoding end, the entropy coding result and the side information sent by the encoding end can be obtained. The probability distribution parameters may be recovered based on the side information. The probability distribution parameters and the entropy coding result can be simultaneously input into an entropy decoding module for entropy decoding processing and output as quantized transform coefficients. The quantized transform coefficients may be input to an inverse quantization module, subjected to inverse quantization, and output as transform coefficients. The transform coefficients may be input to an inverse transform module, subjected to inverse transform processing, and output as reconstructed data.
An exemplary embodiment of the present disclosure provides a method for encoding data, and as shown in fig. 2, a processing flow of the method may include the following steps:
step S210, the coding end inputs the quantized transformation coefficient and the corresponding quantization step size into a first processing network of the entropy model, and obtains a first probability distribution parameter which is processed and output by the first processing network and reflects the probability distribution of the quantized transformation coefficient.
In an implementation, the encoding side may determine quantized transform coefficients based on the data to be encoded. The quantized transform coefficient may be obtained by transforming and quantizing an image block. The image block can be any image block of an image to be processed after block division, and the image to be processed can be any image or any video image or any image to be coded.
The data to be encoded may be an image, which may be composed of pixel values, with a certain correlation between the pixel values in the image to be encoded. At the encoding end, the transformation module can transform the data to be encoded to obtain a transformation coefficient, so that the correlation between pixel values in the image to be encoded can be eliminated, and the purpose of compressing the image to be encoded can be further realized. The transform coefficients may comprise a set of data. The quantization module may perform quantization processing on the transform coefficient to obtain a quantized transform coefficient, and the quantization module may map the transform coefficient to a limited integer set, so that the transform coefficient is suitable for performing subsequent entropy coding processing. The quantized transform coefficients may be a multi-dimensional tensor comprising a set of data, one bit for each data.
The quantized transform coefficients may be a multi-dimensional tensor comprising a set of data, one bit for each data. For each data bit in the quantized transform coefficient, the value of the data on the data bit may be any value in a limited integer set, the value of the data on the data bit is any data in the limited integer set with a certain probability, and the probability that the value of the data on the data bit is each value in the limited integer set constitutes the probability distribution corresponding to the data bit. All data bits in the quantized transform coefficients have probability distributions corresponding to respective values.
For example, the quantized transform coefficient comprises 10 data bits, and the data on each data bit may take on all integers between 1 and 5, so that it is possible for each data bit to take on values of 1, 2, 3, 4, 5. Taking the first data bit as an example, the probability of the first data bit is 0.1, the probability of the first data bit is 0.2, the probability of the first data bit is 0.4, the probability of the first data bit is 0.1, and the probability of the first data bit is 0.2, wherein the probability of the first data bit is 0.2, the probability of the first data bit is 3, the probability of the first data bit is 0.1, and the probability of the first data bit is 5. The probability of all values of the first data bit is 1 probability distribution. The quantized transform coefficient includes 10 data bits, and the quantized transform coefficient has 10 probability distributions, and the 10 probability distributions can be regarded as a multi-dimensional probability distribution.
It can be assumed that the probability distribution of the value corresponding to each data bit satisfies gaussian distribution, which may also be referred to as normal distribution, and then, after the mean and variance of the gaussian distribution are determined, the value of any variable (data bit) is given, so that the probability of the value can be determined. In a possible implementation manner of the present application, when the probability distribution is gaussian distribution, the first probability distribution parameter is a mean value of the corresponding gaussian distribution model, and the second probability distribution parameter is a variance of the corresponding gaussian distribution model.
The mean may be the sum of all sample data in a set of sample data divided by the number of the set of sample data. The variance may be the square of the difference between each sample data in a set of sample data and the mean divided by the number of sample data in the set.
It can also be assumed that the probability distribution of the value corresponding to each data bit satisfies the laplacian distribution, and after the position parameter and the scale parameter of the laplacian distribution are determined, the value of any variable (data bit) is given, so that the probability of the value can be determined. In one possible implementation manner of the present application, when the probability distribution is a laplacian distribution, the first probability distribution parameter is a position parameter in a corresponding laplacian distribution model, and the second probability distribution parameter is a scale parameter in the laplacian distribution model.
The probability density model of the laplacian distribution can be shown in equation 1.
Figure BDA0001983455170000131
Wherein p (x) is a probability density model of the laplace distribution, x is an independent variable, μ is a position parameter, and λ is a scale parameter.
After the probability distribution of the value corresponding to each data bit is selected and set to meet the Gaussian distribution or the Laplace distribution, the probability distribution parameter corresponding to the probability distribution can be uniquely determined, and the quantized change coefficient is subjected to entropy coding processing based on the probability distribution parameter.
In one possible implementation manner of the present application, step S210 may include: and inputting the quantized transformation coefficients and the corresponding quantization step size into a first processing network of the entropy model, and acquiring first probability distribution parameters output after processing by the first processing network and first parameters generated by the first processing network before outputting the first probability distribution parameters.
In an implementation, the first processing network of entropy models may include a first network of encoders, a first quantizer, and a first network of decoders. The encoding end can input the quantized transformation coefficient into a first encoder network to obtain a first super-prior parameter output by the first encoder network; inputting the first prior parameter and the corresponding quantization step size into a first quantizer, and acquiring a first parameter output by the quantizer after quantization; the first parameter is input into a first decoder network, and a first probability distribution parameter output by the first decoder network is obtained.
The encoding side may obtain the quantized transform coefficient, and determine a first super-prior parameter (hyper-prior) based on the quantized transform coefficient and the first encoder network. The first encoder network may be a neural network, which may be trained by a large number of quantized transform coefficients.
After determining the first prior parameter, the first prior parameter and the corresponding quantization step may be input into a first quantizer, a first parameter output by the quantizer after quantization is obtained, and a first probability distribution parameter is determined based on the first parameter. The first decoder network may also be a neural network, which may be trained by a large number of quantized transform coefficients. The first encoder network and the first decoder network may be used jointly, and when the quantized transform coefficients are input into the first encoder network and the first decoder network, it may output probability distribution parameters corresponding to the probabilities of the data values of each data bit in the quantized transform coefficients.
When it is assumed that the probability distribution of the value corresponding to each data bit satisfies the gaussian distribution, step S210 may include: and inputting the quantized transformation coefficient and the corresponding quantization step size into a first processing network of the entropy model, and acquiring a mean value of a Gaussian distribution model which is output by the first processing network and reflects the quantized transformation coefficient. When it is assumed that the probability distribution of the value corresponding to each data bit satisfies the laplacian distribution, step S210 may include: and inputting the quantized transformation coefficient and the corresponding quantization step size into a first processing network of the entropy model, and acquiring a position parameter of a Laplace model which is output by the first processing network and reflects the quantized transformation coefficient.
Step S220, the encoding end inputs the first probability distribution parameter and the quantized transformation coefficient into a second processing network of the entropy model after preprocessing, and obtains a second probability distribution parameter which is output by the second processing network and reflects the probability distribution of the quantized transformation coefficient.
In an implementation, when it is assumed that the probability distribution of the value corresponding to each data bit satisfies the gaussian distribution, step S220 may include: and preprocessing the mean value and the quantized transformation coefficient, inputting the preprocessed mean value and the quantized transformation coefficient into a second processing network of the entropy model, and acquiring the variance of a Gaussian distribution model which is output by the second processing network and reflects the quantized transformation coefficient. When it is assumed that the probability distribution of the value corresponding to each data bit satisfies the laplacian distribution, step S220 may include: and preprocessing the position parameters and the quantized transformation coefficients and inputting the preprocessed position parameters and quantized transformation coefficients into a second processing network of the entropy model, and acquiring scale parameters of a Laplace model which is processed and output by the second processing network and reflects the quantized transformation coefficients.
In one possible implementation manner of the present application, step S220 may include: and preprocessing the first probability distribution parameters and the quantized transformation coefficients and inputting the preprocessed first probability distribution parameters and the quantized transformation coefficients into a second processing network of the entropy model, and acquiring second probability distribution parameters output by the second processing network and second parameters generated by the second processing network before outputting the second probability distribution parameters.
In an implementation, the second processing network of entropy models may include a second network of encoders, a second quantizer, and a second network of decoders. The encoding end may determine an absolute value of a difference between the first probability distribution parameter and the quantized transform coefficient; inputting the absolute value of the difference value into a second encoder network, and acquiring a second super-first parameter output by the second encoder network; inputting the second super-a-priori parameters and the corresponding quantization step size into a second quantizer, and acquiring second parameters which are quantized and output by a second decoder network; the second parameter is input into a second decoder network, and a second probability distribution parameter output by the second decoder network is obtained.
The second encoder network and the second decoder network may be both neural networks, and the second encoder network and the second decoder network may be used in combination, and when an absolute value of a difference between the quantized transform coefficient and the first probability distribution parameter is input into the first encoder network and the first decoder network, it may output a second probability distribution parameter corresponding to a probability distribution of a value corresponding to each data bit in the quantized transform coefficient.
In step S230, the encoding end determines the probability distribution of the quantized transform coefficients according to the first probability distribution parameter and the second probability distribution parameter.
In an implementation, after the first probability distribution parameter and the second probability distribution parameter are determined, the first probability distribution parameter and the second probability distribution parameter may be substituted into a preset probability distribution model, and the probability distribution of the quantized transform coefficients may be determined.
And step S240, the coding end performs entropy coding processing on the quantized transformation coefficient according to the probability distribution to obtain an entropy coding result.
In implementation, the entropy encoding process may be implemented by arithmetic coding or huffman coding. In which, arithmetic coding is a lossless compression method for compressing images or videos, the range of the signal source over [0,1) can be narrowed to the latest interval according to a certain proportion by representing the coded message as an interval between real numbers 0 and 1 and reading the signals one by one, and this proportion is usually a probability distribution table.
In step S250, the encoding end obtains side information corresponding to the quantized transform coefficient.
In implementation, the encoding end may generate side information according to a quantization step corresponding to the quantized transform coefficient, the first parameter, and the second parameter.
The encoding end may perform entropy encoding processing on the first parameter to obtain an entropy-encoded first parameter, and perform entropy encoding processing on the second parameter to obtain an entropy-encoded second parameter. And carrying out entropy coding processing on the quantization step corresponding to the quantized transformation coefficient to obtain the quantization step after entropy coding. And determining side information based on the quantization step after entropy coding, the first parameter after entropy coding and the second parameter after entropy coding.
The encoding end may transmit the side information to the decoding end, so that the decoding end may determine the first parameter and the second parameter based on the side information, and then determine the first probability distribution parameter and the second probability distribution parameter based on the first parameter and the second parameter. Since the quantized transform coefficients are entropy-encoded on the basis of the first probability distribution parameter and the second probability distribution parameter at the encoding side, it is necessary to perform entropy-decoding processing using the first probability distribution parameter and the second probability distribution parameter at the decoding side. Therefore, the information that can determine the first probability distribution parameter and the second probability distribution parameter needs to be carried in the side information and sent to the decoding end.
In addition to the information that can determine the first probability distribution parameter and the second probability distribution parameter, the side information may also carry parameters such as quantization step size. The quantization step is a parameter used in a process of quantizing data, and for example, the first parameter may be obtained by quantizing a first super-prior parameter based on the quantization step, or the second parameter may be obtained by quantizing a second super-prior parameter based on the quantization step.
In the quantization process, data can be quantized by formula 2.
Figure BDA0001983455170000161
Wherein the content of the first and second substances,
Figure BDA0001983455170000162
for the quantization result round () is the rounding process, ziFor data before quantization, siIs the quantization step size.
Figure BDA0001983455170000163
And s may be a multidimensional tensor, with index i denoting the ith element in the multidimensional tensor.
Step S260, the encoding end generates an encoded stream to be sent to the decoding end according to the entropy encoding result and the side information.
In implementation, through the above steps, data to be encoded may be encoded to achieve the purpose of compressing the data, and the encoded stream may be stored at the encoding end or sent to the decoding end. For example, the encoding end is a monitoring end, and after the monitoring video is collected, the monitoring video can be encoded, the encoded stream is stored locally, and then the encoded stream can be directly decoded and the reconstructed video is played. Alternatively, the encoded stream may be sent to a remote playback end and decoded by the playback end. The decoding side may restore the reconstruction data based on the entropy coding result and the side information, wherein the reconstruction data may be a reconstruction image.
By the method provided by the embodiment of the disclosure, the situation that the first probability distribution parameter is directly set as 0 as the mean value is avoided, the first probability distribution parameter is determined through the quantized transform coefficient and the first processing network, and the determined first probability distribution parameter is more practical compared with a directly set value. And then, obtaining more accurate probability distribution according to the more accurate first probability distribution parameter and the more accurate second probability distribution parameter, wherein the obtained data compression ratio is higher when entropy coding processing is carried out on the quantized transformation coefficient based on the more accurate probability distribution.
Based on the same concept as the above embodiments, an exemplary embodiment of the present disclosure further provides a method for encoding data, and as shown in fig. 3, a processing flow of the method may include the following steps:
step S301, the encoder inputs the quantized transform coefficient into the first encoder network, and obtains the first super-a-priori parameters output by the first encoder network.
The quantized transform coefficient may be a multi-dimensional tensor, which includes a set of data, and each data corresponds to a data bit.
In implementation, as shown in fig. 4, an image I to be encoded may be input to a transform module and output as a transform coefficient Z. Then, the transform coefficient Z and the quantization step S may be input to a quantization module and output as a quantized transform coefficient
Figure BDA0001983455170000171
The quantized transform coefficients may then be processed
Figure BDA0001983455170000172
The entropy model is input, and the output is a probability distribution parameter. Wherein Z, S and
Figure BDA0001983455170000173
may be a multi-dimensional tensor. A specific quantization process can be implemented by equation 1.
The first encoder network may be a neural network, which may be trained by a large number of quantized transform coefficients.
In implementation, as also shown in fig. 4, the entropy model may also be split into multiple sub-modules, each having a different function. The entropy model may comprise an encoder network HE1First quantizer, decoder network HD1Encoder network HE2Second quantizer and decoder network HD2
The quantized transform coefficients may be transformed
Figure BDA0001983455170000174
Input to encoder network HE1(also referred to as first encoder network, higher layer encoder network HE)1) In, the output is the first over-the-first parameter h1
Figure BDA0001983455170000175
Wherein the content of the first and second substances,
Figure BDA0001983455170000176
for quantized transform coefficients, phi is the encoder network HE1The network parameter of (2).
Step S302, the encoding end inputs the first prior parameter and the corresponding quantization step size into a first quantizer, and obtains the first parameter output by the quantizer after quantization.
In practice, the first over-the-air parameter h may be set1And the quantization step S is input into a first quantizer (which may be a quantizer Q), and output as a first parameter
Figure BDA0001983455170000177
In the embodiment of the present disclosure, instead of directly inputting the quantized transform coefficients into one neural network, the first probability distribution parameter output by the neural network is directly obtained, but the first probability distribution parameter is obtained in several steps by dividing the two neural networks. This is because the first probability distribution parameter has a large data amount, is inconvenient to directly transmit to the decoding side,this will greatly increase the transmission code rate. In order to solve the above problem, the feature data of the first probability distribution parameter may be selected to be transmitted to the decoding side, the data amount of the feature data is small, and the feature data may be restored to the first probability distribution parameter based on a certain rule at the decoding side. First parameter
Figure BDA0001983455170000178
It can be used as characteristic data, whose data volume is small, and which can be restored again to the first probability distribution parameter at the decoding end via the first decoder network. It should be noted that, when determining the second probability distribution parameter, the determination is also performed based on a similar principle, and is not described in detail below.
Step S303, the encoding end inputs the first parameter into the first decoder network, and obtains the first probability distribution parameter output by the first decoder network.
The first decoder network may also be a neural network, and may be trained by a large number of quantized transform coefficients. The first encoder network and the first decoder network may be used in combination, and when the quantized transform coefficients are input into the first encoder network and the first decoder network, it may output probability distribution parameters corresponding to probabilities of data values of each data bit in the quantized transform coefficients.
In practice, the first parameter may be
Figure BDA0001983455170000181
Input to decoder network HD1(also referred to as first decoder network, higher layer decoder network HD)1) The output is the first probability distribution parameter m. m may be a mean value or a location parameter.
In one possible implementation of the present application, the first encoder network may comprise a first network structure comprising at least one LSTM network element and/or at least one convolutional layer, and the first decoder network comprises a network structure symmetric to the first network structure.
The first encoder network and the second encoder network may be the same or different. The first decoder network and the second decoder network may be different.
In implementation, as shown in FIG. 5, is an encoder network HE1First quantizer and decoder network HD1Schematic diagram of the internal structure of (1).
In implementation, as shown in FIG. 5, is an encoder network HE1First quantizer and decoder network HD1Schematic diagram of the internal structure of (1). Wherein HE1Representation encoder network HE1,HD1Representation decoder network HD1And Q is the first quantizer. Conv indicates that the size of the convolution kernel is 3 × 3, with a total of 64 convolution kernels per layer. Encoder LSTM represents a network whose internal structure can be seen in FIG. 6. The Decoder LSTM indicates a network, and the internal structure thereof can be seen in fig. 7. M represents the number of convolution kernels in the layer. Activation tanh represents an Activation layer.
In fig. 6, LSTM indicates a long-short term memory network, and a downward arrow indicates downsampling processing. CNNL denotes a convolutional layer, the size of the convolutional kernel therein may be set to 3 × 3, and the number may be set to 256. Z1 to Z4 represent transform domain components. In fig. 7, LSTM represents a long-short term memory network that can be deconvoluted, and the upward arrow represents the upsampling process. CNNL denotes a convolutional layer, the size of the convolutional kernel therein may be set to 3 × 3, and the number may be set to 256.
Compared with the traditional mode, the LSTM network unit breaks away from the conversion from the time-domain dependency to the space-domain dependency, redundancy can be removed, the processing of the LSTM unit depends on the LSTM processing structure of the LSTM result (which can be understood as an image block) at the corresponding position of the last coding unit, and the processing result of the LSTM unit is transmitted to the next LSTM unit and the LSTM unit at the corresponding position of the next coding unit.
In step S304, the encoding side determines an absolute value of a difference between the first probability distribution parameter and the quantized transform coefficient.
In implementation, the encoding end may determine the quantized transform coefficients
Figure BDA0001983455170000194
The absolute value of the difference from the first probability distribution parameter m.
Step S305, the absolute value of the difference is input into the second encoder network, and the second super-a-priori parameter output by the second encoder network is obtained.
In an implementation, the absolute value of the difference may be input to the encoder network HE2(also referred to as a second encoder network) the output is a second super-a parameter h2
Step S306, the coding end inputs the second prior parameter and the corresponding quantization step size into a second quantizer, and obtains a second parameter output by a second decoder network after quantization.
In practice, the second over-the-air parameter h may be set2And the quantization step S is input into a second quantizer (which may be a quantizer Q), and output as a second parameter
Figure BDA0001983455170000191
Step S307, the encoding end inputs the second parameter into the second decoder network, and obtains the second probability distribution parameter output by the second decoder network.
In practice, the second parameter may be
Figure BDA0001983455170000192
Input to decoder network HD2(also referred to as a second decoder network) the output is a second probability distribution parameter v. The second probability distribution parameter v may be a variance or a scale parameter.
In one possible implementation of the present application, the second encoder network may comprise a second network structure comprising at least one LSTM network element and/or at least one convolutional layer, and the second decoder network comprises a network structure symmetric to the second network structure.
FIG. 8 shows an encoder network HE2Second quantizer and decoder networkCollateral HD2Schematic diagram of the internal structure of (1). Wherein, in the absD module, the quantized transform coefficient can be calculated
Figure BDA0001983455170000193
The absolute value of the difference from the first probability distribution parameter m. Wherein HE2Representation encoder network HE2,HD2Representation decoder network HD2And Q denotes a second quantizer. Conv indicates that the size of the convolution kernel is 3 x 3, with a total of 64 or 512 convolution kernels for a layer. Encoder LSTM represents a network whose internal structure can be seen in FIG. 6. The Decoder LSTM indicates a network, and the internal structure thereof can be seen in fig. 7. M represents the number of convolution kernels in that layer. Relu denotes full ligation. Activation tank represents an Activation layer.
The first encoder network includes LSTM network elements and convolutional layers, and the plurality of upsampled LSTM network elements and convolutional layers of the first decoder network (which may perform deconvolution calculations). The second encoder network comprises LSTM network elements and convolutional layers, and the second decoder network comprises a plurality of upsampled LSTM network elements and convolutional layers (which may be deconvoluted).
The LSTM network unit can have a memory function, and comprises a plurality of sequentially connected multi-stage memory units, wherein the multi-stage memory units are used for processing a plurality of image blocks, and each stage of memory unit is used for processing an input image block and transmitting a processing result and/or a network state parameter of the memory unit to a next stage of memory unit. Each level of memory unit at least comprises a plurality of sub memory units (coding LSTM or decoding LSTM) which are connected in sequence, and the sub memory unit in each level of memory unit is connected with the sub memory unit at the corresponding position in the next level of memory unit; processing input data through each sub-memory unit in the memory unit corresponding to the image block, and transmitting a processing result and network state data to the sub-memory unit at a corresponding position in the next-stage memory unit by each sub-memory unit; and taking the processing result output by the last first sub-memory unit in the first memory unit corresponding to the current image block as the output of the LSTM network unit.
The first decoder network and the second decoder network differ in structure and function.
Compared with the traditional mode, the LSTM network unit breaks away from the conversion from the time-domain dependency to the space-domain dependency, redundancy can be removed, the processing of the LSTM unit depends on the LSTM processing structure of the LSTM result (which can be understood as an image block) at the corresponding position of the last coding unit, and the processing result of the LSTM unit is transmitted to the next LSTM unit and the LSTM unit at the corresponding position of the next coding unit.
And step S308, the encoding end determines the probability distribution of the quantized transformation coefficient according to the first probability distribution parameter and the second probability distribution parameter.
Step S309, the coding end performs entropy coding processing on the quantized transformation coefficient according to the probability distribution to obtain an entropy coding result.
Step S310, the encoding end obtains side information corresponding to the quantized transform coefficient.
In implementation, the entropy encoding process may be implemented by arithmetic coding or huffman coding. A probability distribution P can be determined from the first probability distribution parameter m and the second probability distribution parameter v, and the quantized transform coefficients can be quantized according to the probability distribution P
Figure BDA0001983455170000201
And performing entropy coding processing to obtain an entropy coding result. The entropy coding result may be a binary entropy coding result bin1
Meanwhile, the side information may also be determined based on the first parameter and the second parameter.
Can be applied to the first parameter
Figure BDA0001983455170000202
Second parameter
Figure BDA0001983455170000203
And carrying out entropy coding processing on the quantization step S to obtain side information bin2. Wherein, during the process of entropy coding, the first parameter can be based on the default probability distribution parameter
Figure BDA0001983455170000204
Second parameter
Figure BDA0001983455170000205
And performing entropy coding processing on the quantization step S.
In step S311, the encoding end generates an encoded stream to be sent to the decoding end according to the entropy encoding result and the side information.
In implementation, through the above steps, the data to be encoded may be encoded to achieve the purpose of compressing the data, and then the entropy encoding result and the side information obtained by encoding may be sent to the decoding end. The decoding side can restore the reconstructed data based on the entropy coding result and the side information. Wherein the reconstruction data may be a reconstructed image.
By the method provided by the embodiment of the disclosure, the situation that the first probability distribution parameter is directly set as 0 as the mean value is avoided, the first probability distribution parameter is determined through the quantized transform coefficient and the first processing network, and the determined first probability distribution parameter is more practical compared with a directly set value. And then, obtaining more accurate probability distribution according to the more accurate first probability distribution parameter and the more accurate second probability distribution parameter, wherein the obtained data compression ratio is higher when entropy coding processing is carried out on the quantized transformation coefficient based on the more accurate probability distribution.
Based on the same concept as the above embodiments, an exemplary embodiment of the present disclosure further provides a method for encoding data, and as shown in fig. 9, a processing flow of the method may include the following steps:
step S610, the decoding end receives the encoded stream sent by the encoding end.
Wherein the encoded stream includes the entropy encoding result and the side information.
In implementation, the encoded stream may be locally stored data, or may be data that is sent locally by the encoding end.
The coding end carries out coding processing on data to be coded to obtain entropy coding results and side information, and the entropy coding results and the side information are combinedThe side information is sent to the decoding end, and the decoding end can receive the entropy coding result bin1And side information bin2
In step S620, the decoding side determines a first probability distribution parameter and a second probability distribution parameter that reflect the probability distribution of the quantized coefficient of variation based on the side information.
In implementation, as shown in fig. 10, the decoding side may be based on the side information bin2Determining a first parameter
Figure BDA0001983455170000211
And a second parameter
Figure BDA0001983455170000212
At the same time, the quantization step S may also be determined.
In a possible implementation manner of the present application, the side information includes an entropy-encoded first parameter and an entropy-encoded second parameter, and step S620 may include: entropy decoding the entropy-coded first parameter to obtain a first parameter; entropy decoding the second parameter after entropy coding to obtain a second parameter; inputting the first parameter into a first decoder network, and acquiring a first probability distribution parameter reflecting the probability distribution of the quantized variation coefficient; the second parameter is input into a second decoder network, and a second probability distribution parameter reflecting the probability distribution of the quantized coefficient of variation is obtained.
Wherein the network of the first decoding networker network of the decoding end and the network of the first decoder network of the encoding end are identical, so that the first decoding networker network of the decoding end is input with the first parameter to output the identical first probability distribution parameter as the first decoder network of the encoding end.
The network of the second decoding networker network at the decoding end and the network of the second decoder network at the encoding end are identical, so that the second decoding networker network at the decoding end can output a second probability distribution parameter identical to the second probability distribution parameter output by the second decoder network at the encoding end after inputting the second parameter.
In implementation, side information bin can be identified2Entropy decoding is carried out to obtain a quantization step S and a first parameter
Figure BDA0001983455170000221
And a second parameter
Figure BDA0001983455170000222
The decoding end can use the first parameter
Figure BDA0001983455170000223
Input to decoder network HD1The output is the first probability distribution parameter m. The second parameter can also be used
Figure BDA0001983455170000224
Input to decoder network HD2The output is the second probability distribution parameter v.
In the embodiment of the present disclosure, the first probability distribution parameter and the second probability distribution parameter are not directly sent to the decoding end at the encoding end, because the data size of the first probability distribution parameter and the second probability distribution parameter is large, and it is inconvenient to directly transmit them to the decoding end, which may greatly improve the transmission code rate. In order to solve the above problem, the feature data of the first probability distribution parameter and the second probability distribution parameter may be selected to be transmitted to the decoding end, the data amount of the feature data is small, and the feature data may be restored to the first probability distribution parameter and the second probability distribution parameter based on a certain rule at the decoding end. First parameter
Figure BDA0001983455170000225
And a second parameter
Figure BDA0001983455170000226
It can be used as the characteristic data, and its data volume is small, and at the same time it can be restored into the first probability distribution parameter m and the second probability distribution parameter v by decoder network at decoding end.
The quantized transform coefficients may be a multi-dimensional tensor comprising a set of data, one bit for each data. For each data bit in the quantized transform coefficient, the value of the data on the data bit may be any value in a limited integer set, the value of the data on the data bit is any data in the limited integer set with a certain probability, and the probability that the value of the data on the data bit is each value in the limited integer set constitutes the probability distribution corresponding to the data bit. All data bits in the quantized transform coefficients have probability distributions corresponding to respective values.
For example, the quantized transform coefficient comprises 10 data bits, and the data on each data bit may take on all integers between 1 and 5, so that it is possible for each data bit to take on values of 1, 2, 3, 4, 5. Taking the first data bit as an example, the probability of the first data bit is 0.1, the probability of the first data bit is 0.2, the probability of the first data bit is 0.4, the probability of the first data bit is 0.1, and the probability of the first data bit is 0.2, wherein the probability of the first data bit is 0.2, the probability of the first data bit is 3, the probability of the first data bit is 0.1, and the probability of the first data bit is 5. The probability of all values of the first data bit is 1 probability distribution. The quantized transform coefficient includes 10 data bits, and the quantized transform coefficient has 10 probability distributions, and the 10 probability distributions can be regarded as a multi-dimensional probability distribution.
It can be assumed that the probability distribution of the value corresponding to each data bit satisfies gaussian distribution, which may also be referred to as normal distribution, and then, after the mean and variance of the gaussian distribution are determined, the value of any variable (data bit) is given, so that the probability of the value can be determined. In a possible implementation manner of the present application, when the probability distribution is gaussian distribution, the first probability distribution parameter is a mean value of the corresponding gaussian distribution model, and the second probability distribution parameter is a variance of the corresponding gaussian distribution model.
The mean may be the sum of all sample data in a set of sample data divided by the number of sample data in the set. The variance may be the square of the difference between each sample data in a set of sample data and the mean divided by the number of sample data in the set.
It can also be assumed that the probability distribution of the value corresponding to each data bit satisfies the laplacian distribution, and after the position parameter and the scale parameter of the laplacian distribution are determined, the value of any variable (data bit) is given, so that the probability of the value can be determined. In one possible implementation manner of the present application, when the probability distribution is a laplacian distribution, the first probability distribution parameter is a position parameter in a corresponding laplacian distribution model, and the second probability distribution parameter is a scale parameter in the laplacian distribution model.
The probability density model of the laplacian distribution can be shown in equation 3.
Figure BDA0001983455170000231
Wherein p (x) is a probability density model of laplace distribution, x is an independent variable, μ is a position parameter, and λ is a scale parameter.
In step S630, the decoding end determines the probability distribution of the quantized transform coefficients based on the first probability distribution parameter and the second probability distribution parameter.
In an implementation, the decoding end may determine the probability distribution P based on the first probability distribution parameter m and the second probability distribution parameter v.
And step S640, the decoding end performs entropy decoding processing on the entropy coding result based on probability distribution to obtain a quantized transformation coefficient.
In implementation, the decoding end may pair entropy coding result bin according to the probability distribution P1Entropy decoding to obtain quantized transform coefficient
Figure BDA0001983455170000232
In a possible implementation manner of the present application, the decoding end may further generate reconstruction data based on the quantized transform coefficient.
In implementation, the decoding end may quantize the quantization step size S and the quantized transform coefficient
Figure BDA0001983455170000233
The output is the transformation coefficient Z. Then transform the coefficient ZInputting the data into an inverse transformation module, and outputting the data as reconstructed data
Figure BDA0001983455170000234
By the method provided by the embodiment of the disclosure, the situation that the first probability distribution parameter is directly set as 0 as the mean value is avoided, the first probability distribution parameter is determined through the quantized transform coefficient and the first processing network, and the determined first probability distribution parameter is more practical compared with a directly set value. And then, obtaining more accurate probability distribution according to the more accurate first probability distribution parameter and the more accurate second probability distribution parameter, wherein the obtained data compression ratio is higher when entropy coding processing is carried out on the quantized transformation coefficient based on the more accurate probability distribution.
Yet another exemplary embodiment of the present disclosure provides an apparatus for encoding data, as shown in fig. 11, the apparatus including:
an obtaining module 710, configured to input the quantized transform coefficients and corresponding quantization step sizes into a first processing network of an entropy model, and obtain first probability distribution parameters, which are output by the first processing network, and reflect probability distributions of the quantized transform coefficients; preprocessing the first probability distribution parameters and the quantized transform coefficients and inputting the preprocessed transform coefficients into a second processing network of the entropy model, and acquiring second probability distribution parameters which are processed and output by the second processing network and reflect probability distribution of the quantized transform coefficients;
a determining module 720, configured to determine a probability distribution of the quantized transform coefficients according to the first probability distribution parameter and the second probability distribution parameter;
the entropy coding module 730 is configured to perform entropy coding processing on the quantized transform coefficients according to the probability distribution to obtain an entropy coding result;
the obtaining module 710 is configured to obtain side information corresponding to the quantized transform coefficient;
a generating module 740, configured to generate, according to the entropy coding result and the side information, a coded stream sent to a decoding end.
In one possible implementation manner of the present application, the probability distribution is a gaussian distribution, the first probability distribution parameter is a mean value of a corresponding gaussian distribution model, and the second probability distribution parameter is a variance of the corresponding gaussian distribution model; alternatively, the first and second electrodes may be,
the probability distribution is a laplace distribution, the first probability distribution parameter is a position parameter in a corresponding laplace distribution model, and the second probability distribution parameter is a scale parameter in the laplace distribution model.
In a possible implementation manner of the present application, the obtaining module 710 is configured to:
inputting the quantized transform coefficients and corresponding quantization step size into a first processing network of an entropy model, obtaining the first probability distribution parameters output after processing by the first processing network and first parameters generated by the first processing network before outputting the first probability distribution parameters;
preprocessing the first probability distribution parameters and the quantized transform coefficients and inputting the preprocessed transform coefficients into a second processing network of the entropy model, obtaining the second probability distribution parameters output by the second processing network and second parameters generated by the second processing network before outputting the second probability distribution parameters;
and generating side information according to the quantization step length corresponding to the quantized transform coefficient, the first parameter and the second parameter.
In a possible implementation manner of the present application, the first processing network of entropy models includes a first encoder network, a first quantizer and a first decoder network, and the obtaining module 710 is configured to:
inputting the quantized transform coefficients into the first encoder network, and obtaining first over-the-air parameters output by the first encoder network;
inputting the first prior parameter and the corresponding quantization step size into the first quantizer, and acquiring the first parameter output by the quantizer after quantization;
inputting the first parameter into the first decoder network, obtaining the first probability distribution parameter output by the first decoder network.
In a possible implementation manner of the present application, the second processing network of entropy models includes a second encoder network, a second quantizer and a second decoder network, and the obtaining module 710 is configured to:
determining an absolute value of a difference of the first probability distribution parameter and the quantized transform coefficient;
inputting the absolute value of the difference value into the second encoder network, and acquiring a second super-a-priori parameter output by the second encoder network;
inputting the second super-a-priori parameter and the corresponding quantization step size into the second quantizer, and obtaining the second parameter output by the second decoder network after quantization;
inputting the second parameter into the second decoder network, and obtaining the second probability distribution parameter output by the second decoder network.
In a possible implementation manner of the present application, the generating module 740 is configured to:
entropy coding processing is carried out on the first parameter to obtain a first parameter after entropy coding, and entropy coding processing is carried out on the second parameter to obtain a second parameter after entropy coding;
performing entropy coding processing on a quantization step corresponding to the quantized transform coefficient to obtain an entropy coded quantization step;
determining side information based on the entropy-encoded quantization step, the entropy-encoded first parameter, and the entropy-encoded second parameter.
In one possible implementation of the present application, the first encoder network includes a first network structure, the first network structure includes at least one LSTM network element and/or at least one convolutional layer, and the first decoding network includes a network structure symmetric to the first network structure.
In a possible implementation manner of the present application, the second encoder network includes a second network structure, the second network structure includes at least one LSTM network element and/or at least one convolutional layer, and the second decoding network includes a network structure symmetric to the second network structure.
Yet another exemplary embodiment of the present disclosure provides an apparatus for decoding data, as shown in fig. 12, the apparatus including:
a receiving module 810, configured to receive an encoded stream sent by an encoding end, where the encoded stream includes an entropy encoding result and side information;
a determining module 820 for determining a first probability distribution parameter and a second probability distribution parameter reflecting the probability distribution of the quantized coefficient of variation based on the side information; determining a probability distribution of quantized transform coefficients based on the first and second probability distribution parameters;
an entropy decoding module 830, configured to perform entropy decoding processing on the entropy encoding result based on the probability distribution to obtain a quantized transform coefficient.
In one possible implementation manner of the present application, the probability distribution is a gaussian distribution, the first probability distribution parameter is a mean value of a corresponding gaussian distribution model, and the second probability distribution parameter is a variance of the corresponding gaussian distribution model; alternatively, the first and second electrodes may be,
the probability distribution is a laplace distribution, the first probability distribution parameter is a position parameter in a corresponding laplace distribution model, and the second probability distribution parameter is a scale parameter in the laplace distribution model.
In a possible implementation manner of the present application, the side information includes an entropy-encoded first parameter, an entropy-encoded second parameter, and an entropy-encoded quantization step, and the determining module 820 is configured to:
performing entropy decoding processing on the entropy-encoded first parameter to obtain a first parameter;
entropy decoding the second parameter after entropy coding to obtain a second parameter;
inputting the first parameter into a first decoder network, and acquiring a first probability distribution parameter reflecting the probability distribution of the quantized variation coefficient;
and inputting the second parameter into a second decoder network, and acquiring a second probability distribution parameter reflecting the probability distribution of the quantized variation coefficient.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Through the device that this disclosed embodiment provided, avoid directly setting up first probability distribution parameter as the mean value to 0, but determine first probability distribution parameter through transform coefficient and the first processing network after the quantization, the first probability distribution parameter of determining is more laminated reality than the value that directly sets up. And then, obtaining more accurate probability distribution according to the more accurate first probability distribution parameter and the more accurate second probability distribution parameter, wherein the obtained data compression ratio is higher when entropy coding processing is carried out on the quantized transformation coefficient based on the more accurate probability distribution.
It should be noted that: in the above embodiment, when performing video encoding and decoding, the apparatus for encoding data and the apparatus for decoding data are only illustrated by dividing the functional modules, and in practical applications, the above function allocation may be completed by different functional modules according to needs, that is, the internal structure of the encoding end or the decoding end is divided into different functional modules, so as to complete all or part of the above described functions. In addition, the apparatus for encoding data and the apparatus for decoding data provided in the foregoing embodiments belong to the same concept as the method for encoding data and the method for decoding data, and specific implementation processes thereof are described in the method embodiments, and are not described herein again.
Yet another exemplary embodiment of the present disclosure provides a video encoding and decoding system, which includes an encoding end and a decoding end, wherein:
the coding end is used for inputting the quantized transformation coefficient and the corresponding quantization step size into a first processing network of an entropy model, and acquiring a first probability distribution parameter which is processed and output by the first processing network and reflects the probability distribution of the quantized transformation coefficient; preprocessing the first probability distribution parameters and the quantized transform coefficients and inputting the preprocessed transform coefficients into a second processing network of the entropy model, and acquiring second probability distribution parameters which are processed and output by the second processing network and reflect probability distribution of the quantized transform coefficients; determining a probability distribution of the quantized transform coefficients according to the first probability distribution parameter and the second probability distribution parameter; entropy coding processing is carried out on the quantized transformation coefficient according to the probability distribution to obtain an entropy coding result; acquiring side information corresponding to the quantized transform coefficients; generating a coded stream sent to the decoding end according to the entropy coding result and the side information;
the decoding end is configured to receive an encoded stream sent by the encoding end, where the encoded stream includes an entropy encoding result and side information; determining a first probability distribution parameter and a second probability distribution parameter reflecting a probability distribution of the quantized coefficient of variation based on the side information; determining a probability distribution of quantized transform coefficients based on the first and second probability distribution parameters; and performing entropy decoding processing on the entropy coding result based on the probability distribution to obtain a quantized transform coefficient.
With regard to the system in the above embodiment, the specific manner in which the encoding side and the decoding side perform operations has been described in detail in the embodiment related to the method, and will not be elaborated herein.
Fig. 13 shows a schematic structural diagram of an encoding end 1900 provided in an exemplary embodiment of the present disclosure. The encoding end 1900 may have a large difference due to different configurations or performances, and may include one or more processors (CPUs) 1910 and one or more memories 1920. The memory 1920 stores at least one instruction, which is loaded and executed by the processor 1910 to implement the method for encoding data according to the above embodiments.
Fig. 14 shows a schematic structural diagram of a decoding end 2000 according to an exemplary embodiment of the present disclosure. The decoding end 2000 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 2010 and one or more memories 2020. The memory 2020 has at least one instruction stored therein, and the at least one instruction is loaded and executed by the processor 2010 to implement the method for decoding data according to the above embodiment.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (27)

1. A method of encoding data, the method comprising:
inputting the quantized transform coefficients and corresponding quantization step sizes into a first processing network of an entropy model, and acquiring first probability distribution parameters which are output by the first processing network and reflect probability distribution of the quantized transform coefficients;
preprocessing the first probability distribution parameter and the quantized transform coefficient and inputting the preprocessed first probability distribution parameter and the quantized transform coefficient into a second processing network of the entropy model, and acquiring a second probability distribution parameter which is processed and output by the second processing network and reflects the probability distribution of the quantized transform coefficient, wherein the first probability distribution parameter and the second probability distribution parameter are different parameters belonging to the same probability distribution;
determining a probability distribution of the quantized transform coefficients according to the first probability distribution parameter and the second probability distribution parameter;
entropy coding processing is carried out on the quantized transformation coefficient according to the probability distribution to obtain an entropy coding result;
acquiring side information corresponding to the quantized transform coefficients;
and generating a coding stream sent to a decoding end according to the entropy coding result and the side information.
2. The method of claim 1, wherein the probability distribution is a gaussian distribution, the first probability distribution parameter is a mean of a corresponding gaussian distribution model, and the second probability distribution parameter is a variance of the corresponding gaussian distribution model; alternatively, the first and second electrodes may be,
the probability distribution is a laplace distribution, the first probability distribution parameter is a position parameter in a corresponding laplace distribution model, and the second probability distribution parameter is a scale parameter in the laplace distribution model.
3. The method of claim 1, wherein inputting the quantized transform coefficients and corresponding quantization step size into a first processing network of an entropy model, obtaining a first probability distribution parameter output by the first processing network processing that reflects a probability distribution of the quantized transform coefficients, comprises:
inputting the quantized transform coefficients and corresponding quantization step size into a first processing network of an entropy model, obtaining the first probability distribution parameters output after processing by the first processing network and first parameters generated by the first processing network before outputting the first probability distribution parameters;
the second processing network, which preprocesses the first probability distribution parameter and the quantized transform coefficient and inputs the preprocessed transform coefficient to the entropy model, obtains a second probability distribution parameter that is output by the second processing network and that reflects a probability distribution of the quantized transform coefficient, and includes:
preprocessing the first probability distribution parameters and the quantized transform coefficients and inputting the preprocessed transform coefficients into a second processing network of the entropy model, obtaining the second probability distribution parameters output by the second processing network and second parameters generated by the second processing network before outputting the second probability distribution parameters;
the obtaining of the side information corresponding to the quantized transform coefficient includes:
and generating side information according to the quantization step length corresponding to the quantized transform coefficient, the first parameter and the second parameter.
4. A method as claimed in claim 3, wherein the first processing network of entropy models comprises a first encoder network, a first quantizer and a first decoder network, the inputting quantized transform coefficients and corresponding quantization steps into the first processing network of entropy models, obtaining the first probability distribution parameters processed and output by the first processing network and first parameters generated by the first processing network prior to outputting the first probability distribution parameters, comprises:
inputting the quantized transform coefficients into the first encoder network, and obtaining first over-the-air parameters output by the first encoder network;
inputting the first prior parameter and the corresponding quantization step size into the first quantizer, and acquiring the first parameter output by the quantizer after quantization;
inputting the first parameter into the first decoder network, obtaining the first probability distribution parameter output by the first decoder network.
5. A method according to claim 3, wherein the second processing network of entropy models comprises a second encoder network, a second quantizer and a second decoder network, the second processing network pre-processing the first probability distribution parameters and the quantized transform coefficients and inputting them to the entropy models, obtaining the second probability distribution parameters output by the second processing network processing and second parameters generated by the second processing network before outputting the second probability distribution parameters, comprises:
determining an absolute value of a difference of the first probability distribution parameter and the quantized transform coefficient;
inputting the absolute value of the difference value into the second encoder network, and acquiring a second super-a-priori parameter output by the second encoder network;
inputting the second super-a-priori parameter and the corresponding quantization step size into the second quantizer, and obtaining the second parameter output by the second decoder network after quantization;
inputting the second parameter into the second decoder network, and obtaining the second probability distribution parameter output by the second decoder network.
6. The method according to claim 3, wherein the generating side information according to the quantization step corresponding to the quantized transform coefficient, the first parameter and the second parameter comprises:
entropy coding processing is carried out on the first parameter to obtain a first parameter after entropy coding, and entropy coding processing is carried out on the second parameter to obtain a second parameter after entropy coding;
performing entropy coding processing on a quantization step corresponding to the quantized transform coefficient to obtain an entropy coded quantization step;
determining side information based on the entropy-encoded quantization step, the entropy-encoded first parameter, and the entropy-encoded second parameter.
7. The method of claim 4, wherein the first encoder network comprises a first network structure comprising at least one LSTM network element and/or at least one convolutional layer, and wherein the first decoder network comprises a network structure symmetric to the first network structure.
8. The method of claim 5, wherein the second encoder network comprises a second network structure comprising at least one LSTM network element and/or at least one convolutional layer, and wherein the second decoder network comprises a network structure symmetric to the second network structure.
9. A method of decoding data, the method comprising:
receiving an encoded stream sent by an encoding end, wherein the encoded stream is generated by the encoding end by using the method according to any one of claims 1 to 8, and the encoded stream includes an entropy encoding result and side information;
determining a first probability distribution parameter and a second probability distribution parameter reflecting a probability distribution of the quantized coefficient of variation based on the side information;
determining a probability distribution of quantized transform coefficients based on the first probability distribution parameter and the second probability distribution parameter;
and performing entropy decoding processing on the entropy coding result based on the probability distribution to obtain a quantized transform coefficient.
10. The method of claim 9, wherein the probability distribution is a gaussian distribution, the first probability distribution parameter is a mean of a corresponding gaussian distribution model, and the second probability distribution parameter is a variance of a corresponding gaussian distribution model; alternatively, the first and second electrodes may be,
the probability distribution is a laplace distribution, the first probability distribution parameter is a position parameter in a corresponding laplace distribution model, and the second probability distribution parameter is a scale parameter in the laplace distribution model.
11. The method of claim 9, wherein the side information comprises an entropy-encoded first parameter, an entropy-encoded second parameter, and an entropy-encoded quantization step size, and wherein determining the first probability distribution parameter and the second probability distribution parameter that reflect the probability distribution of the quantized coefficient of variation based on the side information comprises:
performing entropy decoding processing on the entropy-encoded first parameter to obtain a first parameter;
entropy decoding the entropy-encoded second parameter to obtain a second parameter;
inputting the first parameter into a first decoder network, and acquiring a first probability distribution parameter reflecting the probability distribution of the quantized variation coefficient;
and inputting the second parameter into a second decoder network, and acquiring a second probability distribution parameter reflecting the probability distribution of the quantized variation coefficient.
12. An apparatus for encoding data, the apparatus comprising:
an obtaining module, configured to input the quantized transform coefficients and corresponding quantization step sizes into a first processing network of an entropy model, and obtain first probability distribution parameters, which are output by the first processing network and used for processing and reflecting probability distributions of the quantized transform coefficients; preprocessing the first probability distribution parameter and the quantized transform coefficient and inputting the preprocessed first probability distribution parameter and the quantized transform coefficient into a second processing network of the entropy model, and acquiring a second probability distribution parameter which is processed and output by the second processing network and reflects the probability distribution of the quantized transform coefficient, wherein the first probability distribution parameter and the second probability distribution parameter are different parameters belonging to the same probability distribution;
a determining module for determining a probability distribution of the quantized transform coefficients according to the first probability distribution parameter and the second probability distribution parameter;
the entropy coding module is used for carrying out entropy coding processing on the quantized transformation coefficient according to the probability distribution to obtain an entropy coding result;
the obtaining module is configured to obtain side information corresponding to the quantized transform coefficient;
and the generating module is used for generating a coding stream sent to a decoding end according to the entropy coding result and the side information.
13. The apparatus of claim 12, wherein the probability distribution is a gaussian distribution, the first probability distribution parameter is a mean of a corresponding gaussian distribution model, and the second probability distribution parameter is a variance of the corresponding gaussian distribution model; alternatively, the first and second electrodes may be,
the probability distribution is a laplace distribution, the first probability distribution parameter is a position parameter in a corresponding laplace distribution model, and the second probability distribution parameter is a scale parameter in the laplace distribution model.
14. The apparatus of claim 12, wherein the obtaining module is configured to:
inputting the quantized transform coefficients and corresponding quantization step size into a first processing network of an entropy model, obtaining the first probability distribution parameters output after processing by the first processing network and first parameters generated by the first processing network before outputting the first probability distribution parameters;
preprocessing the first probability distribution parameters and the quantized transform coefficients and inputting the preprocessed transform coefficients into a second processing network of the entropy model, obtaining the second probability distribution parameters output by the second processing network and second parameters generated by the second processing network before outputting the second probability distribution parameters;
and generating side information according to the quantization step length corresponding to the quantized transform coefficient, the first parameter and the second parameter.
15. The apparatus of claim 14, wherein the first processing network of entropy models comprises a first encoder network, a first quantizer, and a first decoder network, and wherein the obtaining module is configured to:
inputting the quantized transform coefficients into the first encoder network, and obtaining first over-the-air parameters output by the first encoder network;
inputting the first prior parameter and the corresponding quantization step size into the first quantizer, and acquiring the first parameter output by the quantizer after quantization;
inputting the first parameter into the first decoder network, obtaining the first probability distribution parameter output by the first decoder network.
16. The apparatus of claim 14, wherein the second processing network of entropy models comprises a second network of encoders, a second quantizer, and a second network of decoders, and wherein the obtaining module is configured to:
determining an absolute value of a difference of the first probability distribution parameter and the quantized transform coefficient;
inputting the absolute value of the difference value into the second encoder network, and acquiring a second super-a-priori parameter output by the second encoder network;
inputting the second super-a-priori parameter and the corresponding quantization step size into the second quantizer, and obtaining the second parameter output by the second decoder network after quantization;
inputting the second parameter into the second decoder network, and obtaining the second probability distribution parameter output by the second decoder network.
17. The apparatus of claim 14, wherein the generating means is configured to:
entropy coding processing is carried out on the first parameter to obtain a first parameter after entropy coding, and entropy coding processing is carried out on the second parameter to obtain a second parameter after entropy coding;
performing entropy coding processing on a quantization step corresponding to the quantized transform coefficient to obtain an entropy coded quantization step;
determining side information based on the entropy-encoded quantization step, the entropy-encoded first parameter, and the entropy-encoded second parameter.
18. The apparatus of claim 15, wherein the first encoder network comprises a first network structure comprising at least one LSTM network element and/or at least one convolutional layer, and wherein the first decoder network comprises a network structure symmetric to the first network structure.
19. The apparatus of claim 16, wherein the second encoder network comprises a second network structure comprising at least one LSTM network element and/or at least one convolutional layer, and wherein the second decoder network comprises a network structure symmetric to the second network structure.
20. An apparatus for decoding data, the apparatus comprising:
a receiving module, configured to receive an encoded stream sent by an encoding end, where the encoded stream is generated by the encoding end according to the method of any one of claims 1 to 8, and the encoded stream includes an entropy encoding result and side information;
a determining module for determining a first probability distribution parameter and a second probability distribution parameter reflecting a probability distribution of the quantized coefficient of variation based on the side information; determining a probability distribution of quantized transform coefficients based on the first probability distribution parameter and the second probability distribution parameter;
and the entropy decoding module is used for carrying out entropy decoding processing on the entropy coding result based on the probability distribution to obtain a quantized transformation coefficient.
21. The apparatus of claim 20, wherein the probability distribution is a gaussian distribution, the first probability distribution parameter is a mean of a corresponding gaussian distribution model, and the second probability distribution parameter is a variance of the corresponding gaussian distribution model; alternatively, the first and second electrodes may be,
the probability distribution is a laplace distribution, the first probability distribution parameter is a position parameter in a corresponding laplace distribution model, and the second probability distribution parameter is a scale parameter in the laplace distribution model.
22. The apparatus of claim 20, wherein the side information comprises an entropy-encoded first parameter, an entropy-encoded second parameter, and an entropy-encoded quantization step size, and wherein the determining module is configured to:
performing entropy decoding processing on the entropy-encoded first parameter to obtain a first parameter;
entropy decoding the entropy-encoded second parameter to obtain a second parameter;
inputting the first parameter into a first decoder network, and acquiring a first probability distribution parameter reflecting the probability distribution of the quantized variation coefficient;
and inputting the second parameter into a second decoder network, and acquiring a second probability distribution parameter reflecting the probability distribution of the quantized variation coefficient.
23. A video coding/decoding system, the system comprising an encoding side and a decoding side, wherein:
the coding end is used for inputting the quantized transformation coefficient and the corresponding quantization step size into a first processing network of an entropy model, and acquiring a first probability distribution parameter which is processed and output by the first processing network and reflects the probability distribution of the quantized transformation coefficient; preprocessing the first probability distribution parameter and the quantized transform coefficient and inputting the preprocessed first probability distribution parameter and the quantized transform coefficient into a second processing network of the entropy model, and acquiring a second probability distribution parameter which is processed and output by the second processing network and reflects the probability distribution of the quantized transform coefficient, wherein the first probability distribution parameter and the second probability distribution parameter are different parameters belonging to the same probability distribution; determining a probability distribution of the quantized transform coefficients according to the first probability distribution parameter and the second probability distribution parameter; entropy coding processing is carried out on the quantized transformation coefficient according to the probability distribution to obtain an entropy coding result; acquiring side information corresponding to the quantized transform coefficient; generating a coded stream sent to the decoding end according to the entropy coding result and the side information;
the decoding end is configured to receive an encoded stream sent by the encoding end, where the encoded stream includes an entropy encoding result and side information; determining a first probability distribution parameter and a second probability distribution parameter reflecting a probability distribution of the quantized coefficient of variation based on the side information; determining a probability distribution of quantized transform coefficients based on the first and second probability distribution parameters; and performing entropy decoding processing on the entropy coding result based on the probability distribution to obtain a quantized transform coefficient.
24. An encoding side, comprising a processor, a communication interface, a memory, and a communication bus, wherein:
the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to execute the program stored in the memory to implement the method steps of any of claims 1-8.
25. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-8.
26. A decode side, comprising a processor, a communication interface, a memory, and a communication bus, wherein:
the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to execute the program stored in the memory to implement the method steps of any of claims 9-11.
27. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any of the claims 9-11.
CN201910157698.0A 2019-03-01 2019-03-01 Method, device and system for encoding and decoding data Active CN111641826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910157698.0A CN111641826B (en) 2019-03-01 2019-03-01 Method, device and system for encoding and decoding data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910157698.0A CN111641826B (en) 2019-03-01 2019-03-01 Method, device and system for encoding and decoding data

Publications (2)

Publication Number Publication Date
CN111641826A CN111641826A (en) 2020-09-08
CN111641826B true CN111641826B (en) 2022-05-20

Family

ID=72330486

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910157698.0A Active CN111641826B (en) 2019-03-01 2019-03-01 Method, device and system for encoding and decoding data

Country Status (1)

Country Link
CN (1) CN111641826B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112332854A (en) * 2020-11-27 2021-02-05 平安普惠企业管理有限公司 Hardware implementation method and device of Huffman coding and storage medium
CN115604485A (en) * 2021-07-09 2023-01-13 华为技术有限公司(Cn) Video image decoding method and device
CN115883831A (en) * 2021-08-05 2023-03-31 华为技术有限公司 Encoding and decoding method and device
CN115706798A (en) * 2021-08-17 2023-02-17 华为技术有限公司 Entropy encoding and decoding method and device
CN116778002A (en) * 2022-03-10 2023-09-19 华为技术有限公司 Encoding and decoding method, apparatus, device, storage medium, and computer program product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101223573A (en) * 2005-07-15 2008-07-16 微软公司 Selectively using multiple entropy models in adaptive coding and decoding
US20130223528A1 (en) * 2010-11-15 2013-08-29 Electronics And Telecommunications Research Institute Method and apparatus for parallel entropy encoding/decoding
CN103561269A (en) * 2013-08-14 2014-02-05 广西大学 Distributed video coding correlated noise model construction method based on multi-probability distribution
CN106254872A (en) * 2015-06-04 2016-12-21 联发科技股份有限公司 The method of entropy transform coding and relevant apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101223573A (en) * 2005-07-15 2008-07-16 微软公司 Selectively using multiple entropy models in adaptive coding and decoding
US20130223528A1 (en) * 2010-11-15 2013-08-29 Electronics And Telecommunications Research Institute Method and apparatus for parallel entropy encoding/decoding
CN103561269A (en) * 2013-08-14 2014-02-05 广西大学 Distributed video coding correlated noise model construction method based on multi-probability distribution
CN106254872A (en) * 2015-06-04 2016-12-21 联发科技股份有限公司 The method of entropy transform coding and relevant apparatus

Also Published As

Publication number Publication date
CN111641826A (en) 2020-09-08

Similar Documents

Publication Publication Date Title
CN111641826B (en) Method, device and system for encoding and decoding data
CN111641832B (en) Encoding method, decoding method, device, electronic device and storage medium
CN111818346B (en) Image encoding method and apparatus, image decoding method and apparatus
CN109451308B (en) Video compression processing method and device, electronic equipment and storage medium
CN109996073B (en) Image compression method, system, readable storage medium and computer equipment
CN111988609A (en) Image encoding device, probability model generation device, and image decoding device
CN111246206B (en) Optical flow information compression method and device based on self-encoder
CN110753225A (en) Video compression method and device and terminal equipment
CN113747163B (en) Image coding and decoding method and compression method based on context recombination modeling
CN111986278A (en) Image encoding device, probability model generation device, and image compression system
CN113079378B (en) Image processing method and device and electronic equipment
CN111918071A (en) Data compression method, device, equipment and storage medium
CN115426075A (en) Encoding transmission method of semantic communication and related equipment
CN115866252B (en) Image compression method, device, equipment and storage medium
CN111050170A (en) Image compression system construction method, compression system and method based on GAN
CN111080729A (en) Method and system for constructing training picture compression network based on Attention mechanism
KR20200044668A (en) AI encoding apparatus and operating method for the same, and AI decoding apparatus and operating method for the same
CN114501031B (en) Compression coding and decompression method and device
CN115393452A (en) Point cloud geometric compression method based on asymmetric self-encoder structure
CN114519750A (en) Face image compression method and system
CN114450692A (en) Neural network model compression using block partitioning
CN111565314A (en) Image compression method, coding and decoding network training method and device and electronic equipment
US20230239470A1 (en) Video encoding and decoding methods, encoder, decoder, and storage medium
CN111565317A (en) Image compression method, coding and decoding network training method and device and electronic equipment
CN117459727B (en) Image processing method, device and system, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant