WO2023020320A1 - Entropy encoding and decoding method and device - Google Patents

Entropy encoding and decoding method and device Download PDF

Info

Publication number
WO2023020320A1
WO2023020320A1 PCT/CN2022/110827 CN2022110827W WO2023020320A1 WO 2023020320 A1 WO2023020320 A1 WO 2023020320A1 CN 2022110827 W CN2022110827 W CN 2022110827W WO 2023020320 A1 WO2023020320 A1 WO 2023020320A1
Authority
WO
WIPO (PCT)
Prior art keywords
probability distribution
data
information
decoded
estimated probability
Prior art date
Application number
PCT/CN2022/110827
Other languages
French (fr)
Chinese (zh)
Inventor
郭天生
王晶
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023020320A1 publication Critical patent/WO2023020320A1/en

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/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/189Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
    • H04N19/196Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding being specially adapted for the computation of encoding parameters, e.g. by averaging previously computed encoding parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • 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

Definitions

  • the embodiments of the present application relate to the technical field of data compression based on artificial intelligence (AI), and in particular to an entropy encoding and decoding method and device.
  • AI artificial intelligence
  • Video encoding (video encoding and decoding) is widely used in digital video applications, such as broadcast digital TV, video transmission over the Internet and mobile networks, real-time session applications such as video chat and video conferencing, Digital Versatile Disc (DVD) ) and Blu-ray discs, video content capture and editing systems, and camcorders for security applications.
  • digital video applications such as broadcast digital TV, video transmission over the Internet and mobile networks
  • real-time session applications such as video chat and video conferencing, Digital Versatile Disc (DVD) ) and Blu-ray discs
  • video content capture and editing systems such as camcorders for security applications.
  • Video compression devices typically use software and/or hardware on the source side to encode video data prior to transmission or storage, thereby reducing the amount of data required to represent digital video images. The compressed data is then received by the video decompression device at the destination side.
  • the present application provides an entropy encoding and decoding method and device to improve the accuracy of the estimated probability distribution of data to be encoded, reduce the code rate in the process of entropy encoding and decoding, and thereby reduce the overhead of entropy encoding and decoding.
  • the present application provides an entropy encoding method, the method comprising: acquiring data to be encoded, where the data to be encoded is non-first encoded data among multiple data included in the current data stream; acquiring reference information, the The reference information at least includes at least one of first context information and first side information, the first context information is obtained by inputting at least one coded data into the self-attention decoding network, and the first side information is the The plurality of data inputs are obtained from the attention coding network; a first estimated probability distribution is obtained according to the reference information estimation; entropy coding is performed on the data to be encoded according to the first estimated probability distribution to obtain a first code stream .
  • the encoded data refers to the data that has been entropy encoded by the encoder among the multiple data. Since there is no encoded data when entropy encoding is performed on the first data of the current data stream, the data to be encoded needs to be the current data The non-first data of the stream, so that the first context information can be extracted.
  • the first estimated probability distribution estimated according to the reference information may include at least one estimated probability parameter.
  • the at least one estimated probability parameter may include a mean value and a variance, and the mean value and variance form a Gaussian distribution.
  • the encoder may calculate the probability value of the data to be encoded according to the first estimated probability distribution, and then perform entropy encoding on the data to be encoded according to the probability value.
  • the first code stream obtained after performing entropy coding may be in a binary format.
  • Multiple data can also be referred to as multiple data units.
  • Multiple data can include video data, image data, audio data, integer data, and other data with compression/decompression requirements. limited. Wherein, each data corresponds to a piece of position information, and the data to be encoded is not at the first place among the multiple data.
  • the self-attention decoding network is a neural network with a self-attention mechanism (that is, including a self-attention structure).
  • the self-attention mechanism is a variant of the attention mechanism, which has a global receptive field and can better Get internal correlations of data or features.
  • the self-attention decoding network can obtain the weights of all the input encoded data and the data to be encoded, and then weight all or part of the input encoded data with corresponding weights to obtain the first context information. This improves the utilization rate of the coded data in the process of obtaining the first context information, and when the first estimated probability distribution is estimated by using the first context information, the accuracy of the first estimated probability distribution can be improved, and the entropy coding can be further reduced.
  • the code rate in the process can further reduce the entropy coding overhead.
  • the self-attention encoding network has a global receptive field, and can obtain the correlation between all the input data and the data to be encoded.
  • the correlation can be the weight of all the input data relative to the data to be encoded.
  • the self-attention encoding network After the self-attention encoding network obtains the weights of all the input data relative to the data to be encoded, it weights the corresponding data according to the weights to obtain the first side information.
  • the self-attention encoding network can weight all or part of the input data with corresponding weights to obtain the first side information. In this way, the utilization rate of data in the process of obtaining the first side information is improved.
  • the first estimated probability distribution is subsequently estimated by using the first side information, the accuracy of the obtained first estimated probability distribution can be further improved, and the code rate in the entropy encoding process can be further reduced, thereby further reducing the entropy encoding overhead.
  • the reference information may also include at least one of the second context information and the second side information, so the following situations may be included:
  • the reference information includes the first context information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the probability distribution estimation network may be a single neural network, or a structure in the self-attention decoding network, which is not limited in this embodiment of the present application.
  • the reference information includes the first context information and the first side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the first side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • Reference information includes first context information and second context information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the second context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • Reference information includes first context information, first side information and second context information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the first side information and the second context information into the probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network .
  • the reference information includes the first context information and the second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the second side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information includes the first context information, the first side information and the second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the first side information and the second side information into the probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network .
  • Reference information includes first context information, second context information and second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the second context information and the second side information into the probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network .
  • the reference information includes the first context information, the first side information, the second context information and the second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the first side information, the second context information and the second side information into the probability distribution estimation network to obtain the output of the probability distribution estimation network The first estimated probability distribution.
  • the reference information includes the first side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • Reference information includes first side information and context information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first side information and the context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information includes the first side information and the second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first side information and the second side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • Reference information includes first side information, context information and second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first side information, the context information and the second side information into the probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the method further includes: estimating to obtain a second estimated probability distribution; performing entropy encoding on the first side information according to the second estimated probability distribution to obtain a second code stream.
  • the second estimated probability distribution may be obtained by estimating according to preset information.
  • the second estimated probability distribution may be obtained by estimating the learnable model obtained through training. Then calculate the probability value of the first side information according to the second estimated probability distribution, and perform entropy encoding on the first side information according to the probability value.
  • the second code stream can be sent to the decoding side alone, or the second code stream can be added to the first code stream and sent to the decoding side.
  • the embodiment of the present application does not limit the sending method of the second code stream .
  • the reference information further includes second context information
  • the second context information is inputting at least one data that meets a preset condition in the at least one coded data into a masked convolutional network ( Masked Convolution Network) obtained.
  • Masked ConvNets consist of masked convolutional layers or regular convolutional layers.
  • the at least one piece of data that meets the preset condition may be at least one piece of data that is adjacent to the data to be encoded in the at least one piece of encoded data.
  • the neighbors of the data to be coded may be the coded data of the first m bits of the data to be coded, m>0.
  • the neighbors of the data to be encoded can be the adjacent data of the data to be encoded, or the encoded data in the peripheral n circle data of the data to be encoded, etc., n>0, the embodiment of the present application does not limit the neighbors .
  • the coded data is utilized in the process of acquiring the second context information, which can improve the accuracy of the first estimated probability distribution, thereby reducing the code rate in the process of entropy coding and reducing the overhead of entropy coding.
  • Masked convolutional networks have local receptive fields, which include masked convolutional layers or regular convolutional layers.
  • the input of the masking convolutional network is at least one data adjacent to the data to be encoded in the at least one encoded data, and the output is the activation feature of the convolution output, that is, the second context information.
  • the reference information further includes second side information, and the second side information is inputting at least one data meeting a preset condition among the plurality of data into a Hyper Encoder Network (Hyper Encoder Network) ) obtained; the method further includes: estimating and obtaining a third estimated probability distribution; performing entropy encoding on the second side information according to the third estimated probability distribution to obtain a third code stream.
  • Hyper Encoder Network Hyper Encoder Network
  • the at least one piece of data that meets the preset condition may be at least one piece of data that is adjacent to the data to be encoded among the multiple pieces of data.
  • the neighbors to the data to be encoded may be the first m1 bits and/or the last m2 bits of the data to be encoded, m1, m2>0.
  • the adjacent data to the data to be coded may be adjacent data to the data to be coded, or the data of the outer n circles of the data to be coded, etc., n>0.
  • the masked convolutional network has a local receptive field, which includes a conventional convolutional layer.
  • the input of the masked convolutional network is at least one data that is adjacent to the data to be encoded among multiple data, and the output is the activation feature of the convolution output, that is, the second side information.
  • the third code stream can be sent to the decoding side alone, or the third code stream can be added to the first code stream and sent to the decoding side.
  • the embodiment of the present application does not limit the sending method of the third code stream .
  • the method further includes: acquiring the first coded data among the plurality of data; estimating and obtaining a fourth estimated probability distribution according to preset information; Entropy encoding is performed on the encoded data of the first bit to obtain a fourth code stream.
  • the fourth estimated probability distribution may be obtained by estimating according to preset information.
  • the learnable model obtained through training is used to estimate and obtain the fourth estimated probability distribution.
  • the embodiment of the present application does not limit the manner of obtaining the fourth estimated probability distribution.
  • the self-attention encoding network can use, for example, a Transformer Encoder, and the self-attention decoding network, for example, can use a Transformer Decoder.
  • the first code stream may refer to the first coded bit stream (first encoded bitstream)
  • the second code stream may refer to the second coded bit stream (second encoded bitstream)
  • the third code stream may refer to the third coded bit stream (third encoded bitstream)
  • the fourth bitstream may refer to the fourth encoded bitstream (fouth encoded bitstream).
  • the present application provides an entropy decoding method, the method comprising: obtaining a first code stream; obtaining reference information, the reference information at least including at least one of the first context information and the decoded first side information , the first context information is obtained by inputting at least one decoded data into the self-attention decoding network, and the decoded first side information is obtained by entropy decoding the second code stream; it is obtained according to the estimation of the reference information A first estimated probability distribution; performing entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, where the decoded data is non-first decoded data among multiple data included in the current data stream .
  • the received first code stream is obtained by performing entropy encoding on the data to be encoded according to a first estimated probability distribution, and the first estimated probability distribution is obtained based on reference information, and the reference information may include first context information and at least one item of the decoded first side information, the self-attention decoding network can weight all the input encoded data with corresponding weights to obtain the first context information. In this way, the utilization rate of encoded data in the process of acquiring the first context information is improved.
  • the accuracy of the obtained first estimated probability distribution can be improved, and the code rate in the entropy encoding process can be reduced, thereby reducing the transmission of the first code stream to the decoding side.
  • the bandwidth occupancy rate at that time improves the transmission efficiency of the first code stream to the decoding side.
  • the acquiring reference information further includes: acquiring a second code stream; estimating to obtain a second estimated probability distribution; performing entropy decoding on the second code stream according to the second estimated probability distribution To obtain the decoded first side information, correspondingly, the reference information further includes the decoded first side information.
  • the second estimated probability distribution estimated by the decoding side needs to be consistent with the second estimated probability distribution estimated by the encoding side.
  • the reference information may also include at least one of the second context information and the decoded second side information, so it may include the following Condition:
  • the reference information includes the first context information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information includes the first context information and the decoded first side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the decoded first side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • Reference information includes first context information and second context information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the second context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information includes the first context information, the decoded first side information and the second context information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the decoded first side information and the second context information into the probability distribution estimation network, so as to obtain the first estimation output by the probability distribution estimation network Probability distributions.
  • the reference information includes the first context information and the decoded second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the decoded second side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information includes the first context information, the decoded first side information and the decoded second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the decoded first side information and the decoded second side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • An estimated probability distribution may include: inputting the first context information, the decoded first side information and the decoded second side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information includes the first context information, the second context information and the decoded second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the second context information and the decoded second side information into the probability distribution estimation network, so as to obtain the first estimation output by the probability distribution estimation network Probability distributions.
  • the reference information includes the first context information, the decoded first side information, the second context information and the decoded second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the decoded first side information, the second context information and the decoded second side information into the probability distribution estimation network to obtain the probability distribution Estimate a first estimated probability distribution for the output of the network.
  • the reference information includes the decoded first side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the decoded first side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information includes the decoded first side information and context information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the decoded first side information and context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information includes the decoded first side information and the decoded second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the decoded first side information and the decoded second side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information includes decoded first side information, context information and decoded second side information
  • estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the decoded first side information, the context information and the decoded second side information into the probability distribution estimation network to obtain the first estimate output by the probability distribution estimation network Probability distributions.
  • the reference information further includes second context information
  • the second context information is obtained by inputting at least one piece of data that meets preset conditions in the at least one piece of decoded data into a masked convolutional network. of.
  • the acquiring reference information further includes: acquiring a third code stream; estimating to obtain a third estimated probability distribution; performing entropy decoding on the third code stream according to the third estimated probability distribution To obtain the decoded second side information, correspondingly, the reference information further includes the decoded second side information.
  • the third estimated probability distribution estimated by the decoding side needs to be consistent with the third estimated probability distribution estimated by the encoding side.
  • the method further includes: acquiring a fourth code stream; estimating and obtaining a fourth estimated probability distribution according to preset information; performing entropy on the fourth code stream according to the fourth estimated probability distribution decoding to obtain decoded leading data, the decoded leading data being the first decoded data among the plurality of data.
  • the fourth estimated probability distribution estimated by the decoding side needs to be consistent with the fourth estimated probability distribution estimated by the encoding side.
  • the present application provides an entropy coding device, which includes: an acquisition module, configured to acquire data to be encoded, where the data to be encoded is non-first encoded data among multiple data included in the current data stream; Reference information, the reference information includes at least one of first context information and first side information, the first context information is obtained by inputting at least one coded data into a self-attention decoding network, the first The side information is obtained by inputting the plurality of data into the self-attention coding network; the estimation module is used to estimate and obtain the first estimated probability distribution according to the reference information; the coding module is used to pair the first estimated probability distribution according to the first estimated probability distribution Entropy encoding is performed on the data to be encoded to obtain a first code stream.
  • the reference information specifically includes the first context information and the first side information;
  • the estimation module is specifically configured to combine the first context information and the first side information Information is input into a probability distribution estimation network to obtain said first estimated probability distribution output by said probability distribution estimation network.
  • the reference information specifically includes the first context information and second context information
  • the second context information is at least one of the at least one coded data that meets a preset condition. Obtained by inputting data into a concealed convolutional network; the estimation module is specifically configured to input the first context information and the second context information into a probability distribution estimation network, so as to obtain the first output of the probability distribution estimation network An estimated probability distribution.
  • the reference information specifically includes the first context information, the first side information, and second context information
  • the second context information is the At least one data that meets the preset conditions is obtained by inputting a masked convolutional network
  • the estimation module is specifically configured to input the first context information, the first side information, and the second context information into a probability distribution estimation network , to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information specifically includes the first context information and second side information, and the second side information is input of at least one data meeting a preset condition among the plurality of data Obtained by a supercoding network;
  • the estimation module is specifically configured to input the first context information and the second side information into a probability distribution estimation network, so as to obtain the first estimated probability output by the probability distribution estimation network distributed.
  • the reference information specifically includes the first context information, the first side information, and the second side information
  • the second side information is the It is obtained by inputting at least one conditional data into a supercoding network
  • the estimation module is specifically configured to input the first context information, the first side information and the second side information into a probability distribution estimation network to obtain The probability distribution estimation network outputs the first estimated probability distribution.
  • the reference information specifically includes the first context information, the second context information, and the second side information
  • the second side information is the data that meets the preset condition in the plurality of data
  • At least one data input into the super-encoded network is obtained, and the second context information is obtained by inputting at least one data that meets the preset conditions in the at least one encoded data into the masked convolutional network
  • the estimation module is specifically used inputting the first context information, the second context information and the second side information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information specifically includes the first context information, the first side information, the second context information, and the second side information
  • the second side information is a combination of the multiple
  • the second context information is obtained by inputting at least one data that meets the preset conditions into the super-encoding network among the data
  • the second context information is obtained by inputting at least one data that meets the preset conditions among the at least one encoded data into the masked convolutional network
  • the estimation module is specifically configured to input the first context information, the first side information, the second context information and the second side information into a probability distribution estimation network, so as to obtain the probability distribution estimation network Output the first estimated probability distribution.
  • the reference information specifically includes the first side information and second context information
  • the second context information is at least one of the at least one coded data that meets a preset condition. Obtained by inputting data into a masked convolutional network; the estimation module is specifically configured to input the first side information and the second context information into a probability distribution estimation network, so as to obtain the first output of the probability distribution estimation network An estimated probability distribution.
  • the reference information specifically includes the first side information and the second side information, and the second side information is to input at least one data meeting a preset condition among the plurality of data into Obtained by a supercoding network;
  • the estimation module is specifically configured to input the first side information and the second side information into a probability distribution estimation network, so as to obtain the first estimated probability output by the probability distribution estimation network distributed.
  • the reference information specifically includes the first side information, the second context information, and the second side information
  • the second side information is the data that meets the preset condition in the plurality of data
  • At least one data input into the super-encoded network is obtained, and the second context information is obtained by inputting at least one data that meets the preset conditions in the at least one encoded data into the masked convolutional network
  • the estimation module is specifically used inputting the first side information, the second context information and the second side information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the estimation module is further configured to estimate and obtain a second estimated probability distribution; the encoding module is further configured to perform entropy on the first side information according to the second estimated probability distribution Encode to obtain the second code stream.
  • the estimating module is further configured to estimate and obtain the third estimated probability distribution; the encoding module is further configured to process the second side information according to the third estimated probability distribution Entropy coding is performed to obtain a third code stream.
  • the acquiring module is further configured to acquire the first coded data among the plurality of data; the estimating module is further configured to estimate and obtain a fourth estimated probability distribution according to preset information; The encoding module is further configured to perform entropy encoding on the first encoded data according to the fourth estimated probability distribution to obtain a fourth code stream.
  • the present application provides an entropy decoding device, the device comprising: an acquisition module, configured to acquire a first code stream; and acquire reference information, where the reference information includes at least first context information and decoded first side information At least one of the above, the first context information is obtained by inputting at least one decoded data into the self-attention decoding network, and the decoded first side information is obtained by entropy decoding the second code stream; the estimation module , for estimating and obtaining a first estimated probability distribution according to the reference information; a decoding module, for performing entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, the decoded data The non-first decoded data among the multiple data contained in the current data stream.
  • the reference information specifically includes the first context information and the decoded first side information; the estimation module is specifically configured to combine the first context information and the decoded first side information Decoding the first side information is input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information specifically includes the first context information and second context information
  • the second context information is at least one of the at least one decoded data that meets a preset condition. Obtained by inputting data into a concealed convolutional network; the estimation module is specifically configured to input the first context information and the second context information into a probability distribution estimation network, so as to obtain the first output of the probability distribution estimation network An estimated probability distribution.
  • the reference information specifically includes the first context information, the decoded first side information, and second context information
  • the second context information is the at least one decoded At least one data that meets the preset conditions is obtained by inputting a masked convolutional network
  • the estimation module is specifically configured to input the first context information, the decoded first side information, and the second context information a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information specifically includes the first context information and decoded second side information, where the decoded second side information is obtained by performing entropy decoding on the third code stream;
  • the estimation module is specifically configured to input the first context information and the decoded second side information into a probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information specifically includes the first context information, the decoded first side information, and the decoded second side information, and the decoded second side information is for the third
  • the code stream is obtained by performing entropy decoding;
  • the estimation module is specifically configured to input the first context information, the decoded first side information and the decoded second side information into a probability distribution estimation network, so as to obtain the The probability distribution estimation network outputs the first estimated probability distribution.
  • the reference information specifically includes the first context information, the second context information, and the decoded second side information
  • the decoded second side information is an entropy analysis performed on the third code stream.
  • the second context information is obtained by decoding, and the second context information is obtained by inputting at least one data that meets preset conditions in the at least one decoded data into a masked convolutional network; the estimation module is specifically used to use the first context information, the second context information and the decoded second side information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the reference information specifically includes the first context information, the decoded first side information, the second context information, and the decoded second side information, and the decoded second side information
  • the information is obtained by performing entropy decoding on the third code stream
  • the second context information is obtained by inputting at least one piece of data that meets a preset condition in the at least one piece of decoded data into a masked convolutional network
  • the estimation module Specifically for inputting the first context information, the decoded first side information, the second context information and the decoded second side information into a probability distribution estimation network, so as to obtain an output of the probability distribution estimation network
  • the first estimated probability distribution of .
  • the reference information specifically includes the decoded first side information and second context information
  • the second context information is an At least one data input is obtained by a masked convolutional network
  • the estimation module is specifically configured to input the decoded first side information and the second context information into a probability distribution estimation network to obtain an output of the probability distribution estimation network The first estimated probability distribution of .
  • the reference information specifically includes the decoded first side information and the decoded second side information
  • the decoded second side information is obtained by performing entropy decoding on the third code stream
  • the estimation module is specifically configured to input the decoded first side information and the decoded second side information into a probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network .
  • the reference information specifically includes the decoded first side information, the second context information, and the decoded second side information
  • the decoded second side information is a reference to the third code stream Obtained by performing entropy decoding
  • the second context information is obtained by inputting at least one data that meets preset conditions in the at least one decoded data into a masked convolutional network
  • the estimation module is specifically configured to use the Decoding the first side information, the second context information and the decoded second side information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  • the acquiring module is further configured to acquire the second code stream; the estimating module is further configured to estimate obtain a second estimated probability distribution; the decryption module is further configured to perform entropy decoding on the second code stream according to the second estimated probability distribution to obtain the decoded first side information.
  • the acquiring module is further configured to acquire the third code stream; the estimating module is further configured to estimate obtaining a third estimated probability distribution; the decoding module is further configured to perform entropy decoding on the third code stream according to the third estimated probability distribution to obtain the decoded second side information.
  • the acquiring module is further configured to acquire a fourth code stream; the estimating module is further configured to estimate and obtain a fourth estimated probability distribution according to preset information; the decoding module is further configured to use performing entropy decoding on the fourth code stream according to the fourth estimated probability distribution to obtain decoded first data, where the decoded first data is first decoded data among the plurality of data.
  • the present application provides an entropy encoding device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors Executing, so that the one or more processors implement the method described in any one of the above first aspects.
  • the present application provides an entropy decoding device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors Execute, so that the one or more processors implement the method described in any one of the above second aspects.
  • the present application provides a computer-readable storage medium, including a computer program.
  • the computer program When the computer program is executed on a computer, the computer executes the method described in any one of the first to second aspects above.
  • the present application provides a computer program product, the computer program product includes computer program code, and when the computer program code is run on a computer, it causes the computer to execute any one of the above-mentioned first to second aspects. Methods.
  • FIG. 1 is an exemplary block diagram of a decoding system 10 provided in an embodiment of the present application
  • FIG. 2 is an exemplary block diagram of a video encoder provided in an embodiment of the present application
  • FIG. 3 is an exemplary block diagram of a video decoder provided in an embodiment of the present application.
  • FIG. 4 is an exemplary schematic diagram of a candidate image block provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of another application scenario provided by the embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an encoder in an end-to-end encoding and decoding architecture provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a decoder in an end-to-end codec architecture provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an encoder provided in an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a decoder provided in an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of an encoder provided in an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a decoder provided in an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of an encoder provided in an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of a decoder provided in an embodiment of the present application.
  • FIG. 15 is a schematic diagram of a self-attention structure provided by the embodiment of the present application.
  • FIG. 16 is a schematic structural diagram of a self-attention encoding network provided by an embodiment of the present application.
  • FIG. 17 is a schematic structural diagram of a self-attention decoding network provided by an embodiment of the present application.
  • FIG. 18 is a flowchart of a process 100 of the entropy encoding method provided by the embodiment of the present application.
  • FIG. 19 is a flow chart of the process 200 of the entropy decoding method provided by the embodiment of the present application.
  • FIG. 20 is a flowchart of a process 300 of the entropy encoding and decoding method provided by the embodiment of the present application;
  • Fig. 21 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application.
  • Fig. 22 is a schematic diagram of entropy coding performance provided by the embodiment of the present application.
  • FIG. 23 is a flow chart of the process 400 of the entropy encoding and decoding method provided by the embodiment of the present application.
  • Fig. 24 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application.
  • FIG. 25 is a flowchart of a process 500 of the entropy encoding and decoding method provided by the embodiment of the present application.
  • FIG. 26 is a flow chart of the process 600 of the entropy encoding and decoding method provided by the embodiment of the present application.
  • Fig. 27 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application.
  • the embodiment of the present application provides an AI-based data compression/decompression technology, especially a neural network-based data compression/decompression technology, and specifically provides an entropy coding and decoding technology to improve traditional mixed data coding and decoding system.
  • Data encoding and decoding includes two parts: data encoding and data decoding.
  • Data encoding is performed on the source side (or commonly referred to as the encoder side), and typically involves processing (eg, compressing) raw data to reduce the amount of data needed to represent that raw data (and thus more efficient storage and/or transmission).
  • Data decoding is performed on the destination side (or commonly referred to as the decoder side), and usually involves inverse processing relative to the encoder side to reconstruct the original data.
  • the "codec" of data involved in the embodiments should be understood as “encoding” or “decoding” of data.
  • the encoding part and the decoding part are also collectively referred to as codec (encoding and decoding, CODEC).
  • the original data can be reconstructed, i.e. the reconstructed original data is of the same quality as the original data (assuming no transmission loss or other data loss during storage or transmission).
  • further compression is performed by quantization, etc., to reduce the amount of data required to represent the original data, and the decoder side cannot completely reconstruct the original data, that is, the quality of the reconstructed original data is lower than that of the original data or Difference.
  • the embodiments of the present application may be applied to video data, image data, audio data, integer data, and other data that require compression/decompression.
  • video data encoding referred to as video encoding
  • Other types of data can refer to the following description , which will not be described in detail in this embodiment of the present application. It should be noted that, compared with video coding, in the coding process of data such as audio data and integer data, there is no need to divide the data into blocks, but the data can be directly coded.
  • Video coding generally refers to the processing of sequences of images that form a video or video sequence.
  • picture In the field of video coding, the terms “picture”, “frame” or “image” may be used as synonyms.
  • Video coding standards belong to "lossy hybrid video codecs" (ie, combining spatial and temporal prediction in the pixel domain with 2D transform coding in the transform domain for applying quantization).
  • Each image in a video sequence is usually partitioned into a non-overlapping set of blocks, usually encoded at the block level.
  • encoders usually process, i.e.
  • video at the block (video block) level e.g., through spatial (intra) prediction and temporal (inter) prediction to produce a predicted block; from the current block (currently processed/to be processed block) to obtain the residual block; transform the residual block in the transform domain and quantize the residual block to reduce the amount of data to be transmitted (compressed), and the decoder side will be inversely processed relative to the encoder Partially applied to encoded or compressed blocks to reconstruct the current block for representation.
  • the encoder needs to repeat the decoder's processing steps such that the encoder and decoder generate the same predicted (eg, intra and inter) and/or reconstructed pixels for processing, ie encoding, subsequent blocks.
  • the encoder 20 and the decoder 30 are described with reference to FIGS. 1-3 .
  • FIG. 1 is an exemplary block diagram of a decoding system 10 provided by an embodiment of the present application, for example, a video decoding system 10 (or simply referred to as the decoding system 10 ) that can utilize the technology of the present application.
  • Video encoder 20 (or simply encoder 20) and video decoder 30 (or simply decoder 30) in video coding system 10 represent devices, etc. that may be used to perform techniques according to various examples described in this application. .
  • the decoding system 10 includes a source device 12 for providing coded image data 21 such as coded images to a destination device 14 for decoding the coded image data 21 .
  • the source device 12 includes an encoder 20 , and optionally, an image source 16 , a preprocessor (or a preprocessing unit) 18 such as an image preprocessor, and a communication interface (or a communication unit) 22 .
  • Image source 16 may include or be any type of image capture device for capturing real world images, etc., and/or any type of image generation device, such as a computer graphics processor or any type of Devices for acquiring and/or providing real-world images, computer-generated images (e.g., screen content, virtual reality (VR) images, and/or any combination thereof (e.g., augmented reality (AR) images). So
  • the image source may be any type of memory or storage that stores any of the above images.
  • the image (or image data) 17 may also be referred to as an original image (or original image data) 17 .
  • the preprocessor 18 is used to receive the original image data 17 and perform preprocessing on the original image data 17 to obtain a preprocessed image (or preprocessed image data) 19 .
  • preprocessing performed by preprocessor 18 may include cropping, color format conversion (eg, from RGB to YCbCr), color grading, or denoising. It can be understood that the preprocessing unit 18 can be an optional component.
  • a video encoder (or encoder) 20 is used to receive preprocessed image data 19 and provide encoded image data 21 (to be further described below with reference to FIG. 2 etc.).
  • the communication interface 22 in the source device 12 may be used to receive the encoded image data 21 and send the encoded image data 21 (or any other processed version) via the communication channel 13 to another device such as the destination device 14 or any other device for storage Or rebuild directly.
  • the destination device 14 includes a decoder 30 , and may also optionally include a communication interface (or communication unit) 28 , a post-processor (or post-processing unit) 32 and a display device 34 .
  • the communication interface 28 in the destination device 14 is used to receive the coded image data 21 (or any other processed version) directly from the source device 12 or from any other source device such as a storage device, for example, the storage device is a coded image data storage device, And the coded image data 21 is supplied to the decoder 30 .
  • the communication interface 22 and the communication interface 28 can be used to pass through a direct communication link between the source device 12 and the destination device 14, such as a direct wired or wireless connection, etc., or through any type of network, such as a wired network, a wireless network, or any other Combination, any type of private network and public network or any combination thereof, send or receive coded image data (or coded data) 21 .
  • the communication interface 22 can be used to encapsulate the encoded image data 21 into a suitable format such as a message, and/or use any type of transmission encoding or processing to process the encoded image data, so that it can be transmitted over a communication link or communication network on the transmission.
  • the communication interface 28 corresponds to the communication interface 22, eg, can be used to receive the transmission data and process the transmission data using any type of corresponding transmission decoding or processing and/or decapsulation to obtain the encoded image data 21 .
  • Both the communication interface 22 and the communication interface 28 can be configured as a one-way communication interface as indicated by an arrow from the source device 12 to the corresponding communication channel 13 of the destination device 14 in FIG. 1, or a two-way communication interface, and can be used to send and receive messages etc., to establish the connection, confirm and exchange any other information related to the communication link and/or data transmission such as encoded image data transmission, etc.
  • the video decoder (or decoder) 30 is used to receive encoded image data 21 and provide decoded image data (or decoded image data) 31 (which will be further described below with reference to FIG. 3 , etc.).
  • the post-processor 32 is used to perform post-processing on decoded image data 31 (also referred to as reconstructed image data) such as a decoded image to obtain post-processed image data 33 such as a post-processed image.
  • Post-processing performed by post-processing unit 32 may include, for example, color format conversion (e.g., from YCbCr to RGB), color grading, cropping, or resampling, or any other processing for producing decoded image data 31 for display by a display device 34 or the like. .
  • the display device 34 is used to receive the post-processed image data 33 to display the image to a user or viewer or the like.
  • Display device 34 may be or include any type of display for representing the reconstructed image, eg, an integrated or external display screen or display.
  • the display screen may include a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a plasma display, a projector, a micro LED display, a liquid crystal on silicon (LCoS) display, or a liquid crystal on silicon (LCoS) display. ), a digital light processor (DLP), or any type of other display.
  • LCD liquid crystal display
  • OLED organic light emitting diode
  • plasma display e.g., a plasma display, a projector, a micro LED display, a liquid crystal on silicon (LCoS) display, or a liquid crystal on silicon (LCoS) display.
  • DLP digital light processor
  • the decoding system 10 also includes a training engine 25, the training engine 25 is used to train the encoder 20 (especially the entropy encoding unit 270 in the encoder 20) or the decoder 30 (especially the entropy decoding unit 304 in the decoder 30), To process the input image or image area or image block to obtain the reference information of the image block to be encoded, or process the input reference information to estimate the estimated probability distribution of the image block to be encoded, and to obtain the estimated probability distribution of the image block to be encoded according to the estimated probability distribution
  • entropy encoding please refer to the following method embodiment for detailed description of the training engine 25 .
  • FIG. 1 shows the source device 12 and the destination device 14 as independent devices
  • the device embodiment may also include the source device 12 and the destination device 14 or the functions of the source device 12 and the destination device 14 at the same time, that is, include the source device 12 and the destination device 14 at the same time.
  • Device 12 or corresponding function and destination device 14 or corresponding function may be implemented using the same hardware and/or software or by separate hardware and/or software or any combination thereof.
  • FIG. 2 is an exemplary block diagram of a video encoder provided in an embodiment of the present application
  • FIG. 3 is an exemplary block diagram of a video decoder provided in an embodiment of the present application
  • Encoder 20 may be implemented by processing circuitry 46 to include the various modules discussed with reference to encoder 20 of FIG. 2 and/or any other encoder system or subsystem described herein.
  • Decoder 30 may be implemented by processing circuitry 46 to include the various modules discussed with reference to decoder 30 of FIG. 3 and/or any other decoder system or subsystem described herein.
  • the processing circuitry 46 may be used to perform various operations discussed below.
  • the device can store software instructions in a suitable non-transitory computer-readable storage medium, and use one or more processors to execute the instructions in hardware, thereby implementing the technology of the present application.
  • One of the video encoder 20 and the video decoder 30 may be integrated in a single device as part of a combined encoder/decoder (CODEC).
  • Source device 12 and destination device 14 may comprise any of a variety of devices, including any type of handheld or stationary device, such as a notebook or laptop computer, cell phone, smartphone, tablet or tablet computer, camera, Desktop computers, set-top boxes, televisions, display devices, digital media players, video game consoles, video streaming devices (such as content service servers or content distribution servers), broadcast receiving devices, broadcast transmitting devices, and monitoring devices, etc., and No or any type of operating system may be used.
  • the source device 12 and the destination device 14 may also be devices in a cloud computing scenario, such as virtual machines in a cloud computing scenario.
  • source device 12 and destination device 14 may be equipped with components for wireless communication. Accordingly, source device 12 and destination device 14 may be wireless communication devices.
  • the source device 12 and the destination device 14 may install a virtual scene application (application, APP) such as a virtual reality (virtual reality, VR) application, an augmented reality (augmented reality, AR) application or a mixed reality (mixed reality, MR) application, and A VR application, an AR application or an MR application may be run based on user operations (such as clicking, touching, sliding, shaking, voice control, etc.).
  • APP virtual scene application
  • the source device 12 and the destination device 14 can collect images/videos of any objects in the environment through cameras and/or sensors, and then display virtual objects on the display device according to the collected images/videos.
  • the virtual objects can be VR scenes, AR scenes or Virtual objects in the MR scene (that is, objects in the virtual environment).
  • the virtual scene applications in the source device 12 and the destination device 14 can be built-in applications in the source device 12 and the destination device 14, or can be third-party service providers installed by the user
  • the provided application is not specifically limited.
  • source device 12 and destination device 14 may install real-time video transmission applications, such as live broadcast applications.
  • the source device 12 and the destination device 14 can collect images/videos through cameras, and then display the collected images/videos on a display device.
  • the video coding system 10 shown in FIG. 1 is merely exemplary, and the techniques provided herein are applicable to video coding settings (e.g., video coding or video decoding) that do not necessarily include coding devices and Decode any data communication between devices.
  • data is retrieved from local storage, sent over a network, and so on.
  • a video encoding device may encode and store data into memory, and/or a video decoding device may retrieve and decode data from memory.
  • encoding and decoding are performed by devices that do not communicate with each other but simply encode data to memory and/or retrieve and decode data from memory.
  • a video coding system may include an imaging device, a video encoder, a video decoder (and/or a video encoder/decoder implemented by a processing circuit), an antenna, one or more processors, one or more memory stores, and/or or display device.
  • Imaging devices, antennas, processing circuits, video encoders, video decoders, processors, memory storage and/or display devices can communicate with each other.
  • a video coding system may include only a video encoder or only a video decoder.
  • an antenna may be used to transmit or receive an encoded bitstream of video data.
  • a display device may be used to present video data.
  • the processing circuit may include application-specific integrated circuit (application-specific integrated circuit, ASIC) logic, a graphics processor, a general-purpose processor, and the like.
  • ASIC application-specific integrated circuit
  • the video decoding system may also include an optional processor, and the optional processor may similarly include application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, and the like.
  • the memory storage can be any type of memory, such as volatile memory (for example, static random access memory (static random access memory, SRAM), dynamic random access memory (dynamic random access memory, DRAM), etc.) or nonvolatile memory permanent memory (for example, flash memory, etc.) and the like.
  • volatile memory for example, static random access memory (static random access memory, SRAM), dynamic random access memory (dynamic random access memory, DRAM), etc.
  • nonvolatile memory permanent memory for example, flash memory, etc.
  • memory storage may be implemented by cache memory.
  • processing circuitry may include memory (eg, cache memory, etc.) for implementing image buffers, etc.
  • video encoder 20 implemented with logic circuitry may include an image buffer (eg, implemented with processing circuitry or memory storage) and a graphics processing unit (eg, implemented with processing circuitry).
  • a graphics processing unit may be communicatively coupled to the image buffer.
  • Graphics processing unit may include video encoder 20 implemented with processing circuitry to implement the various modules discussed with reference to FIG. 2 and/or any other encoder system or subsystem described herein.
  • Logic circuits may be used to perform the various operations discussed herein.
  • video decoder 30 may be implemented by processing circuitry in a similar manner to implement the various modules discussed with reference to video decoder 30 of FIG. 3 and/or any other decoder system or subsystem described herein .
  • logic circuit implemented video decoder 30 may include an image buffer (implemented by processing circuitry or memory storage) and a graphics processing unit (eg, implemented by processing circuitry).
  • a graphics processing unit may be communicatively coupled to the image buffer.
  • the graphics processing unit may include video decoder 30 implemented by processing circuitry to implement the various modules discussed with reference to FIG. 3 and/or any other decoder system or subsystem described herein.
  • an antenna may be used to receive an encoded bitstream of video data.
  • an encoded bitstream may contain data related to encoded video frames, indicators, index values, mode selection data, etc., as discussed herein, such as data related to encoding partitions (e.g., transform coefficients or quantized transform coefficients , (as discussed) an optional indicator, and/or data defining an encoding split).
  • the video coding system may also include video decoder 30 coupled to the antenna and for decoding the encoded bitstream. Display devices are used to render video frames.
  • the video decoder 30 may be used to perform a reverse process.
  • the video decoder 30 may be configured to receive and parse such syntax elements and decode the associated video data accordingly.
  • video encoder 20 may entropy encode the syntax elements into an encoded video bitstream.
  • video decoder 30 may parse such syntax elements and decode the related video data accordingly.
  • VVC general video coding
  • VCEG video coding experts group
  • MPEG motion picture experts group
  • HEVC high-efficiency video coding
  • the video encoder 20 includes an input terminal (or input interface) 201, a residual calculation unit 204, a transformation processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transformation processing unit 212, a reconstruction unit 214, Loop filter 220 , decoded picture buffer (decoded picture buffer, DPB) 230 , mode selection unit 260 , entropy coding unit 270 and output terminal (or output interface) 272 .
  • Mode selection unit 260 may include inter prediction unit 244 , intra prediction unit 254 , and partition unit 262 .
  • Inter prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown).
  • the video encoder 20 shown in FIG. 2 may also be called a hybrid video encoder or a video encoder based on a hybrid video codec.
  • the inter-frame prediction unit is a trained target model (also called a neural network), and the neural network is used to process an input image or an image region or an image block to generate a prediction value of the input image block.
  • a neural network for inter-frame prediction is used to receive an input image or image region or image block and generate a prediction value for the input image or image region or image block.
  • the residual calculation unit 204, the transform processing unit 206, the quantization unit 208, and the mode selection unit 260 constitute the forward signal path of the encoder 20, while the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the buffer 216, the loop A path filter 220, a decoded picture buffer (decoded picture buffer, DPB) 230, an inter prediction unit 244, and an intra prediction unit 254 form the backward signal path of the encoder, wherein the backward signal path of the encoder 20 corresponds to the decoding signal path of the decoder (see decoder 30 in FIG. 3).
  • Inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, loop filter 220, decoded picture buffer 230, inter prediction unit 244, and intra prediction unit 254 also make up the "built-in decoder" of video encoder 20 .
  • the encoder 20 is operable to receive, via an input 201 or the like, an image (or image data) 17, eg an image in a sequence of images forming a video or a video sequence.
  • the received image or image data may also be a preprocessed image (or preprocessed image data) 19 .
  • image 17 may also be referred to as a current image or an image to be encoded (especially when the current image is distinguished from other images in video encoding, other images such as the same video sequence, that is, the video sequence that also includes the current image, before encoding post image and/or decoded image).
  • a (digital) image is or can be viewed as a two-dimensional array or matrix of pixel points with intensity values. Pixels in the array may also be referred to as pixels (pixel or pel) (short for image element). The number of pixels in the array or image in the horizontal and vertical directions (or axes) determines the size and/or resolution of the image. In order to represent a color, three color components are usually used, that is, an image can be represented as or include three pixel arrays. In the RBG format or color space, an image includes corresponding red, green and blue pixel arrays.
  • each pixel is usually expressed in a luminance/chroma format or color space, such as YCbCr, including a luminance component indicated by Y (sometimes also indicated by L) and two chrominance components indicated by Cb and Cr.
  • the luminance (luma) component Y represents brightness or grayscale level intensity (e.g., both are the same in a grayscale image), while the two chrominance (chroma) components Cb and Cr represent chrominance or color information components .
  • an image in the YCbCr format includes a luminance pixel point array of luminance pixel point values (Y) and two chrominance pixel point arrays of chrominance values (Cb and Cr).
  • Images in RGB format can be converted or transformed to YCbCr format and vice versa, a process also known as color transformation or conversion. If the image is black and white, the image may only include an array of luminance pixels. Correspondingly, the image can be, for example, an array of luma pixels in monochrome format or an array of luma pixels and two corresponding arrays of chrominance pixels in 4:2:0, 4:2:2 and 4:4:4 color formats .
  • an embodiment of the video encoder 20 may include an image segmentation unit (not shown in FIG. 2 ) for segmenting the image 17 into a plurality of (typically non-overlapping) image blocks 203 .
  • These blocks can also be called root blocks, macroblocks (H.264/AVC) or coding tree blocks (CTB), or coding tree units (coding tree unit, CTU) in the H.265/HEVC and VVC standards ).
  • the segmentation unit can be used to use the same block size for all images in a video sequence and to use a corresponding grid that defines the block size, or to vary the block size between images or subsets or groups of images and segment each image into corresponding piece.
  • the video encoder may be adapted to directly receive the blocks 203 of the image 17 , for example one, several or all blocks making up said image 17 .
  • the image block 203 may also be referred to as a current image block or an image block to be encoded.
  • the image block 203 is also or can be regarded as a two-dimensional array or matrix composed of pixels with intensity values (pixel values), but the image block 203 is smaller than that of the image 17 .
  • block 203 may comprise one pixel point array (for example, a luminance array in the case of a monochrome image 17 or a luminance array or a chrominance array in the case of a color image) or three pixel point arrays (for example, in the case of a color image 17 one luma array and two chrominance arrays) or any other number and/or type of arrays depending on the color format employed.
  • a block may be an array of M ⁇ N (M columns ⁇ N rows) pixel points, or an array of M ⁇ N transform coefficients, and the like.
  • the video encoder 20 shown in FIG. 2 is used to encode the image 17 block by block, eg, performing encoding and prediction on each block 203 .
  • the video encoder 20 shown in FIG. 2 can also be used to segment and/or encode an image using slices (also called video slices), where an image can use one or more slices (typically non-overlapping ) for segmentation or encoding.
  • slices also called video slices
  • Each slice may include one or more blocks (for example, a coding tree unit CTU) or one or more block groups (for example, a coding block (tile) in the H.265/HEVC/VVC standard and a tile in the VVC standard ( brick).
  • the video encoder 20 shown in FIG. 2 can also be configured to use slices/coded block groups (also called video coded block groups) and/or coded blocks (also called video coded block groups) ) to segment and/or encode an image, where an image may be segmented or encoded using one or more slices/coded block groups (usually non-overlapping), each slice/coded block group may consist of one or more A block (such as a CTU) or one or more coding blocks, etc., wherein each coding block may be in the shape of a rectangle or the like, and may include one or more complete or partial blocks (such as a CTU).
  • slices/coded block groups also called video coded block groups
  • coded blocks also called video coded block groups
  • the residual calculation unit 204 is used to calculate the residual block 205 according to the image block (or original block) 203 and the prediction block 265 (the prediction block 265 will be described in detail later): for example, pixel by pixel (pixel by pixel) from the image
  • the pixel value of the predicted block 265 is subtracted from the pixel value of the block 203 to obtain the residual block 205 in the pixel domain.
  • the transform processing unit 206 is configured to perform discrete cosine transform (discrete cosine transform, DCT) or discrete sine transform (discrete sine transform, DST) etc. on the pixel point values of the residual block 205 to obtain transform coefficients 207 in the transform domain.
  • the transform coefficients 207 may also be referred to as transform residual coefficients, representing the residual block 205 in the transform domain.
  • Transform processing unit 206 may be configured to apply an integer approximation of DCT/DST, such as the transform specified for H.265/HEVC. This integer approximation is usually scaled by some factor compared to the orthogonal DCT transform. To maintain the norm of the forward and inverse transformed residual blocks, other scaling factors are used as part of the transformation process. The scaling factor is usually chosen according to certain constraints, such as the scaling factor being a power of 2 for the shift operation, the bit depth of the transform coefficients, the trade-off between accuracy and implementation cost, etc.
  • specifying a specific scaling factor for the inverse transform at the encoder 20 side by the inverse transform processing unit 212 (and for the corresponding inverse transform at the decoder 30 side by, for example, the inverse transform processing unit 312), and correspondingly, can The side 20 specifies the corresponding scaling factor for the forward transform through the transform processing unit 206 .
  • the video encoder 20 (correspondingly, the transform processing unit 206) can be used to output transform parameters such as one or more transform types, for example, directly output or output after encoding or compression by the entropy encoding unit 270 , for example, so that the video decoder 30 can receive and use the transformation parameters for decoding.
  • transform parameters such as one or more transform types, for example, directly output or output after encoding or compression by the entropy encoding unit 270 , for example, so that the video decoder 30 can receive and use the transformation parameters for decoding.
  • the quantization unit 208 is configured to quantize the transform coefficient 207 by, for example, scalar quantization or vector quantization, to obtain a quantized transform coefficient 209 .
  • Quantized transform coefficients 209 may also be referred to as quantized residual coefficients 209 .
  • the quantization process may reduce the bit depth associated with some or all of the transform coefficients 207 .
  • n-bit transform coefficients may be rounded down to m-bit transform coefficients during quantization, where n is greater than m.
  • the degree of quantization can be modified by adjusting a quantization parameter (quantization parameter, QP).
  • QP quantization parameter
  • QP quantization parameter
  • a smaller quantization step size corresponds to finer quantization
  • a larger quantization step size corresponds to coarser quantization.
  • a suitable quantization step size can be indicated by a quantization parameter (quantization parameter, QP).
  • a quantization parameter may be an index to a predefined set of suitable quantization step sizes.
  • Quantization may include dividing by a quantization step size, while corresponding or inverse dequantization performed by the inverse quantization unit 210 or the like may include multiplying by a quantization step size.
  • Embodiments according to some standards such as HEVC may be used to determine the quantization step size using quantization parameters.
  • the quantization step size can be calculated from the quantization parameter using a fixed-point approximation of an equation involving division.
  • the video encoder 20 (correspondingly, the quantization unit 208) can be used to output a quantization parameter (quantization parameter, QP), for example, directly output or output after being encoded or compressed by the entropy encoding unit 270, for example, making the video Decoder 30 may receive and use the quantization parameters for decoding.
  • a quantization parameter quantization parameter, QP
  • the inverse quantization unit 210 is used to perform the inverse quantization of the quantization unit 208 on the quantization coefficients to obtain the dequantization coefficients 211, for example, perform the inverse quantization of the quantization scheme performed by the quantization unit 208 according to or use the same quantization step size as that of the quantization unit 208 plan.
  • the dequantized coefficients 211 may also be referred to as dequantized residual coefficients 211 , corresponding to the transform coefficients 207 , but due to loss caused by quantization, the dequantized coefficients 211 are usually not exactly the same as the transform coefficients.
  • the inverse transform processing unit 212 is configured to perform an inverse transform of the transform performed by the transform processing unit 206, for example, an inverse discrete cosine transform (discrete cosine transform, DCT) or an inverse discrete sine transform (discrete sine transform, DST), to transform in the pixel domain
  • DCT inverse discrete cosine transform
  • DST inverse discrete sine transform
  • a reconstructed residual block 213 (or corresponding dequantization coefficients 213) is obtained.
  • the reconstructed residual block 213 may also be referred to as a transform block 213 .
  • the reconstruction unit 214 (e.g., summer 214) is used to add the transform block 213 (i.e., the reconstructed residual block 213) to the predicted block 265 to obtain the reconstructed block 215 in the pixel domain, for example, the reconstructed residual block 213
  • the pixel value is added to the pixel value of the prediction block 265 .
  • the loop filter unit 220 (or “loop filter” 220 for short) is used to filter the reconstructed block 215 to obtain the filtered block 221, or generally used to filter the reconstructed pixels to obtain filtered pixel values.
  • a loop filter unit is used to smooth pixel transitions or improve video quality.
  • the loop filter unit 220 may include one or more loop filters, such as deblocking filters, pixel adaptive offset (sample-adaptive offset, SAO) filters, or one or more other filters, such as auto Adaptive loop filter (ALF), noise suppression filter (NSF), or any combination.
  • the loop filter unit 220 may include a deblocking filter, an SAO filter, and an ALF filter.
  • the order of the filtering process may be deblocking filter, SAO filter and ALF filter.
  • add a process called luma mapping with chroma scaling (LMCS) ie adaptive in-loop shaper. This process is performed before deblocking.
  • LMCS luma mapping with chroma scaling
  • the deblocking filtering process can also be applied to internal sub-block edges, such as affine sub-block edges, ATMVP sub-block edges, sub-block transform (sub-block transform, SBT) edges and intra sub-partition (ISP )edge.
  • loop filter unit 220 is shown in FIG. 2 as a loop filter, in other configurations, loop filter unit 220 may be implemented as a post-loop filter.
  • the filtering block 221 may also be referred to as a filtering reconstruction block 221 .
  • video encoder 20 (correspondingly, loop filter unit 220) can be used to output loop filter parameters (such as SAO filter parameters, ALF filter parameters or LMCS parameters), for example, directly or by entropy
  • the encoding unit 270 performs entropy encoding to output, for example, so that the decoder 30 can receive and use the same or different loop filter parameters for decoding.
  • a decoded picture buffer (DPB) 230 may be a reference picture memory that stores reference picture data for use by the video encoder 20 when encoding video data.
  • the DPB 230 may be formed from any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous DRAM (synchronous DRAM, SDRAM), magnetoresistive RAM (magnetoresistive RAM, MRAM), Resistive RAM (resistive RAM, RRAM) or other types of storage devices.
  • DRAM dynamic random access memory
  • the decoded picture buffer 230 may be used to store one or more filter blocks 221 .
  • the decoded picture buffer 230 may also be used to store other previously filtered blocks, such as the previously reconstructed and filtered block 221, of the same current picture or a different picture such as a previous reconstructed picture, and may provide the complete previously reconstructed, i.e. decoded picture (and the corresponding reference blocks and pixels) and/or a partially reconstructed current image (and corresponding reference blocks and pixels), for example for inter-frame prediction.
  • the decoded image buffer 230 can also be used to store one or more unfiltered reconstruction blocks 215, or generally store unfiltered reconstruction pixels, for example, the reconstruction blocks 215 that have not been filtered by the loop filter unit 220, or have not been filtered. Any other processed reconstruction blocks or reconstructed pixels.
  • the mode selection unit 260 includes a segmentation unit 262, an inter prediction unit 244, and an intra prediction unit 254 for receiving or obtaining raw raw image data such as block 203 (current block 203 of current image 17) and reconstructed image data, e.g. filtered and/or unfiltered reconstructed pixels of the same (current) image and/or one or more previously decoded images or Rebuild blocks.
  • the reconstructed image data is used as reference image data required for prediction such as inter-frame prediction or intra-frame prediction to obtain a prediction block 265 or a prediction value 265 .
  • the mode selection unit 260 can be used to determine or select a partition for the current block (including no partition) and a prediction mode (such as intra or inter prediction mode), and generate a corresponding prediction block 265 to calculate and calculate the residual block 205
  • the reconstruction block 215 is reconstructed.
  • mode selection unit 260 is operable to select a partitioning and prediction mode (e.g., from among the prediction modes supported or available by mode selection unit 260) that provides the best match or the smallest residual (minimum Residual refers to better compression in transmission or storage), or provides minimal signaling overhead (minimum signaling overhead refers to better compression in transmission or storage), or considers or balances both of the above.
  • the mode selection unit 260 may be configured to determine the partition and prediction mode according to rate distortion optimization (RDO), that is, to select the prediction mode that provides the minimum rate distortion optimization.
  • RDO rate distortion optimization
  • best do not necessarily refer to “best”, “lowest”, “best” in general, but may refer to situations where termination or selection criteria are met, e.g., Values above or below thresholds or other constraints may result in “sub-optimal selection”, but reduce complexity and processing time.
  • segmentation unit 262 may be used to segment images in a video sequence into a sequence of coding tree units (CTUs), and CTUs 203 may be further segmented into smaller block portions or sub-blocks (again forming blocks), e.g. By iteratively using quad-tree partitioning (QT) partitioning, binary-tree partitioning (BT) partitioning or triple-tree partitioning (TT) partitioning or any combination thereof, and for example or each of the sub-blocks to perform prediction, wherein the mode selection includes selecting the tree structure of the partition block 203 and selecting the prediction mode to be applied to the block portion or each of the sub-blocks.
  • QT quad-tree partitioning
  • BT binary-tree partitioning
  • TT triple-tree partitioning
  • partitioning eg, performed by partition unit 262
  • prediction processing eg, performed by inter-prediction unit 244 and intra-prediction unit 254
  • the segmentation unit 262 may divide (or divide) an image block (or CTU) 203 into smaller parts, such as square or rectangular shaped small blocks.
  • a CTU consists of N ⁇ N luma pixel blocks and two corresponding chrominance pixel blocks.
  • the maximum allowed size of a luma block in a CTU is specified as 128 ⁇ 128 in the developing Versatile Video Coding (VVC) standard, but may be specified in the future to a value other than 128 ⁇ 128, such as 256 ⁇ 256.
  • VVC Versatile Video Coding
  • the CTUs of an image can be pooled/grouped into slices/coded block groups, coded blocks or bricks.
  • a coding block covers a rectangular area of an image, and a coding block can be divided into one or more bricks.
  • a brick consists of multiple CTU rows within an encoded block.
  • a coded block that is not partitioned into multiple bricks may be called a brick.
  • bricks are a true subset of coded blocks and are therefore not called coded blocks.
  • VVC supports two coded block group modes, namely raster scan slice/coded block group mode and rectangular slice mode.
  • RSCBG mode a slice/CBG contains a sequence of CBGs in a coded block raster scan of an image.
  • rectangular tile mode a tile contains multiple tiles of an image that together form a rectangular area of the image.
  • the tiles within the rectangular slice are arranged in the photo's tile raster scan order.
  • These smaller blocks can be further divided into smaller parts.
  • This is also known as tree splitting or hierarchical tree splitting, where the root block at root tree level 0 (hierarchy level 0, depth 0) etc. can be recursively split into blocks of two or more next lower tree levels, For example a node at tree level 1 (hierarchy level 1, depth 1).
  • These blocks can in turn be split into two or more blocks at the next lower level, e.g. tree level 2 (hierarchy level 2, depth 2), etc., until the end of the split (because the end criteria are met, e.g. maximum tree depth or minimum block size).
  • Blocks that are not further divided are also called leaf blocks or leaf nodes of the tree.
  • a tree divided into two parts is called a binary-tree (BT)
  • a tree divided into three parts is called a ternary-tree (TT)
  • a tree divided into four parts is called a quadtree ( quad-tree, QT).
  • a coding tree unit may be or include a CTB of luma pixels, two corresponding CTBs of chroma pixels of an image having an array of three pixels, or a CTB of pixels of a monochrome image or using three
  • a coding tree block can be an N ⁇ N pixel block, where N can be set to a certain value so that the components are divided into CTBs, which is segmentation.
  • a coding unit may be or include a coding block of luma pixels, two corresponding coding blocks of chrominance pixels of an image having three pixel arrays, or a coding block of pixels of a monochrome image or An encoded block of pixels of an image encoded using three separate color planes and syntax structures (for encoding pixels).
  • a coding block can be M ⁇ N pixel blocks, where M and N can be set to a certain value so that the CTB is divided into coding blocks, which is division.
  • a coding tree unit may be divided into a plurality of CUs according to HEVC by using a quadtree structure represented as a coding tree.
  • the decision whether to encode an image region using inter (temporal) prediction or intra (spatial) prediction is made at the leaf-CU level.
  • Each leaf-CU can be further divided into one, two or four PUs according to the PU division type.
  • the same prediction process is used within a PU, and relevant information is transmitted to the decoder in units of PUs.
  • the leaf CU can be partitioned into transform units (TUs) according to other quadtree structures similar to the coding tree used for the CU.
  • VVC Versatile Video Coding
  • a combined quadtree of nested multi-type trees (such as binary and ternary trees) is used to partition The segmentation structure of the tree unit.
  • the CU can be square or rectangular.
  • the coding tree unit (CTU) is first divided by the quadtree structure.
  • the quadtree leaf nodes are further composed of multi-type Tree structure segmentation.
  • Multi-type leaf nodes are called is a coding unit (CU), unless the CU is too large for the maximum transform length, such a segment is used for prediction and transform processing without any other partition.In most cases, this means that CU, PU and TU are in the quad.
  • CU coding unit
  • the block size in the coding block structure of the tree-nested multi-type tree is the same. This exception occurs when the maximum supported transform length is less than the width or height of the color component of the CU.
  • VVC has a quad-tree nested multi-type tree
  • the signaling mechanism the coding tree unit (CTU) is first divided by the quadtree structure as the root of the quadtree. Then each quadtree leaf node (when enough can be further split into a multi-type tree structure.
  • the first flag mtt_split_cu_flag
  • the second flag mtt_split_cu_vertical_flag
  • the decoder can derive the multi-type tree division mode (MttSplitMode) of the CU based on predefined rules or tables.
  • TT division when the width or height of the luma coding block is greater than 64, TT division is not allowed .
  • the width or height of the chroma encoding block is greater than 32, TT division is also not allowed.
  • the pipeline design divides the image into multiple virtual pipeline data units (virtual pipeline data unit, VPDU), and each VPDU is defined in the image as mutual Non-overlapping units.
  • VPDU virtual pipeline data unit
  • consecutive VPDUs are processed simultaneously in multiple pipeline stages.
  • the VPDU size is roughly proportional to the buffer size, so VPD needs to be kept small U.
  • the VPDU size can be set to the maximum transform block (TB) size.
  • TT ternary tree
  • BT binary tree
  • the tree node block is forced to be divided until all pixels of each coded CU are located within the image boundary.
  • the intra sub-partitions (intra sub-partitions, ISP) tool may vertically or horizontally divide the luma intra prediction block into two or four sub-parts according to the block size.
  • mode selection unit 260 of video encoder 20 may be configured to perform any combination of the segmentation techniques described above.
  • the video encoder 20 is configured to determine or select the best or optimal prediction mode from a set of (predetermined) prediction modes.
  • the set of prediction modes may include, for example, intra prediction modes and/or inter prediction modes.
  • the set of intra prediction modes can include 35 different intra prediction modes, e.g. non-directional modes like DC (or mean) mode and planar mode, or directional modes as defined by HEVC, or can include 67 different Intra prediction modes, eg non-directional modes like DC (or mean) mode and planar mode, or directional modes as defined in VVC.
  • intra prediction modes e.g. non-directional modes like DC (or mean) mode and planar mode, or directional modes as defined in VVC.
  • PDPC position dependent intra prediction combination
  • the intra prediction unit 254 is configured to generate an intra prediction block 265 by using reconstructed pixels of adjacent blocks of the same current image according to an intra prediction mode in the intra prediction mode set.
  • Intra prediction unit 254 (or generally mode selection unit 260) is also configured to output intra prediction parameters (or generally information indicating the selected intra prediction mode for a block) in the form of syntax elements 266 to entropy encoding unit 270 , to be included in the encoded image data 21, so that the video decoder 30 can perform operations such as receiving and using prediction parameters for decoding.
  • the intra prediction modes in HEVC include DC prediction mode, planar prediction mode and 33 angle prediction modes, a total of 35 candidate prediction modes.
  • the current block can be intra-predicted using the pixels of the reconstructed image blocks on the left and above as references.
  • An image block used for performing intra-frame prediction on the current block in the peripheral area of the current block becomes a reference block, and pixels in the reference block are called reference pixels.
  • the DC prediction mode is suitable for the area with flat texture in the current block, and all pixels in this area use the average value of the reference pixels in the reference block as prediction;
  • the planar prediction mode is suitable for image blocks with smooth texture changes , the current block that meets this condition uses the reference pixels in the reference block to perform bilinear interpolation as the prediction of all pixels in the current block;
  • the angle prediction mode uses the characteristic that the texture of the current block is highly correlated with the texture of the adjacent reconstructed image block , copy the value of the reference pixel in the corresponding reference block along a certain angle as the prediction of all the pixels in the current block.
  • the HEVC encoder selects an optimal intra prediction mode from 35 candidate prediction modes for the current block, and writes the optimal intra prediction mode into the video stream.
  • the encoder/decoder will derive the three most probable modes from the respective optimal intra prediction modes of the reconstructed image blocks in the surrounding area using intra prediction. If given to the current block The selected optimal intra prediction mode is one of the three most probable modes, then encode a first index indicating that the selected optimal intra prediction mode is one of the three most probable modes; if selected The optimal intra prediction mode is not the three most probable modes, then encode a second index indicating that the selected optimal intra prediction mode is the other 32 modes (except the above three most probable modes among the 35 candidate prediction modes one of the other modes).
  • the HEVC standard uses a 5-bit fixed-length code as the aforementioned second index.
  • the method for the HEVC encoder to derive the three most probable modes includes: selecting the optimal intra prediction mode of the left adjacent image block and the upper adjacent image block of the current block into the set, if the two optimal intra prediction modes are the same, only one can be kept in the set. If the two optimal intra prediction modes are the same and both are angle prediction modes, then select two angle prediction modes adjacent to the angle direction to add to the set; otherwise, select planar prediction mode, DC mode mode and vertical prediction mode in turn Patterns are added to the set until the number of patterns in the set reaches 3.
  • the HEVC decoder After the HEVC decoder performs entropy decoding on the code stream, it obtains the mode information of the current block, which includes an indicator indicating whether the optimal intra prediction mode of the current block is among the three most probable modes, and the optimal intra prediction mode of the current block.
  • the set of inter prediction modes depends on available reference pictures (i.e., e.g. at least some previously decoded pictures previously stored in DBP 230) and other inter prediction parameters, e.g. on whether the entire reference picture is used or only Use part of the reference image, e.g. the search window area around the area of the current block, to search for the best matching reference block, and/or e.g. depending on whether half-pel, quarter-pel and/or 16th interpolation is performed pixel interpolation.
  • available reference pictures i.e., e.g. at least some previously decoded pictures previously stored in DBP 230
  • other inter prediction parameters e.g. on whether the entire reference picture is used or only Use part of the reference image, e.g. the search window area around the area of the current block, to search for the best matching reference block, and/or e.g. depending on whether half-pel, quarter-pel and/or 16th interpolation is performed pixel interpolation.
  • skip mode and/or direct mode may also be employed.
  • the merge candidate list for this mode consists of the following five candidate types in order: Spatial MVP from spatially adjacent CUs, Temporal MVP from collocated CUs, History-based MVP from FIFO table, Pairwise MVP Average MVP and zero MV.
  • Decoder side motion vector refinement (DMVR) based on bilateral matching can be used to increase the accuracy of MV in merge mode.
  • Merge mode with MVD (merge mode with MVD, MMVD) comes from merge mode with motion vector difference. Send the MMVD flag immediately after sending the skip flag and the merge flag to specify whether the CU uses MMVD mode.
  • a CU-level adaptive motion vector resolution (AMVR) scheme may be used. AMVR supports CU's MVD encoding at different precisions.
  • the MVD of the current CU is adaptively selected.
  • a combined inter/intra prediction (CIIP) mode can be applied to the current CU.
  • a weighted average is performed on the inter-frame and intra-frame prediction signals to obtain CIIP prediction.
  • the affine motion field of a block is described by the motion information of 2 control points (4 parameters) or 3 control points (6 parameters) motion vector.
  • SBTMVP subblock-based temporal motion vector prediction
  • TMVP temporal motion vector prediction
  • Bi-directional optical flow (BDOF), formerly known as BIO, is a simplified version that reduces computation, especially in terms of the number of multiplications and the size of the multiplier.
  • the triangular partition mode the CU is evenly divided into two triangular parts in two ways: diagonal division and anti-diagonal division.
  • the bidirectional prediction mode extends simple averaging to support weighted averaging of two prediction signals.
  • the inter prediction unit 244 may include a motion estimation (motion estimation, ME) unit and a motion compensation (motion compensation, MC) unit (both are not shown in FIG. 2 ).
  • the motion estimation unit is operable to receive or acquire image block 203 (current image block 203 of current image 17) and decoded image 231, or at least one or more previously reconstructed blocks, e.g., of one or more other/different previously decoded images 231 Reconstruct blocks for motion estimation.
  • a video sequence may comprise a current picture and a previous decoded picture 231, or in other words, the current picture and a previous decoded picture 231 may be part of or form a sequence of pictures forming the video sequence.
  • encoder 20 may be configured to select a reference block from a plurality of reference blocks in the same or different images in a plurality of other images, and assign the reference image (or reference image index) and/or the position (x, y coordinates) of the reference block ) and the position of the current block (spatial offset) are provided to the motion estimation unit as inter prediction parameters.
  • This offset is also called a motion vector (MV).
  • the motion compensation unit is configured to obtain, for example, receive, inter-frame prediction parameters, and perform inter-frame prediction according to or using the inter-frame prediction parameters to obtain an inter-frame prediction block 246 .
  • Motion compensation performed by the motion compensation unit may include extracting or generating a prediction block from a motion/block vector determined by motion estimation, and may include performing interpolation to sub-pixel precision. Interpolation filtering can generate pixels of other pixels from pixels of known pixels, thereby potentially increasing the number of candidate predictive blocks that can be used to encode an image block.
  • the motion compensation unit may locate the prediction block pointed to by the motion vector in one of the reference image lists.
  • the motion compensation unit may also generate block- and video-slice-related syntax elements for use by video decoder 30 when decoding image blocks of video slices. Additionally, or instead of slices and corresponding syntax elements, coding block groups and/or coding blocks and corresponding syntax elements may be generated or used.
  • the motion vector (motion vector, MV) that can be added to the candidate motion vector list as an alternative includes the spatial phase of the current block
  • the MVs of adjacent and temporally adjacent image blocks, wherein the MVs of spatially adjacent image blocks may include the MV of the left candidate image block on the left of the current block and the MV of the upper candidate image block above the current block.
  • FIG. 4 is an exemplary schematic diagram of candidate image blocks provided by the embodiment of the present application. As shown in FIG.
  • the set of candidate image blocks on the left includes ⁇ A0, A1 ⁇ , and the upper
  • the set of candidate image blocks includes ⁇ B0, B1, B2 ⁇
  • the set of temporally adjacent candidate image blocks includes ⁇ C, T ⁇ .
  • the order can be to give priority to the set ⁇ A0, A1 ⁇ of the left candidate image block of the current block (consider A0 first, A0 is not available and then consider A1), and secondly consider the set of candidate image blocks above the current block ⁇ B0, B1, B2 ⁇ (consider B0 first, consider B1 if B0 is not available, and then consider B2 if B1 is not available), and finally consider the set ⁇ C, T ⁇ of candidate image blocks adjacent to the current block in time domain (consider T first, T is not available Consider C) again.
  • the optimal MV is determined from the candidate motion vector list through the rate distortion cost (RD cost), and the candidate motion vector with the smallest RD cost is used as the motion vector predictor (motion vector predictor, MVP).
  • RD cost rate distortion cost
  • MVP motion vector predictor
  • J represents RD cost
  • SAD is the absolute error sum (sum of absolute differences, SAD) between the pixel value of the prediction block obtained after motion estimation using the candidate motion vector and the pixel value of the current block
  • R represents the code rate
  • represents the Lagrangian multiplier
  • the encoding end transmits the determined index of the MVP in the candidate motion vector list to the decoding end. Further, the motion search can be performed in the neighborhood centered on the MVP to obtain the actual motion vector of the current block, and the encoding end calculates the motion vector difference (motion vector difference, MVD) between the MVP and the actual motion vector, and calculates the MVD passed to the decoder.
  • the decoding end parses the index, finds the corresponding MVP in the candidate motion vector list according to the index, parses the MVD, and adds the MVD and the MVP to obtain the actual motion vector of the current block.
  • the motion information that can be added to the candidate motion information list as an alternative includes the motion information of the image blocks adjacent to the current block in the spatial domain or in the temporal domain, where the spatial domain Adjacent image blocks and temporally adjacent image blocks can refer to Figure 4.
  • the candidate motion information corresponding to the spatial domain in the candidate motion information list comes from five spatially adjacent blocks (A0, A1, B0, B1, and B2) , if the neighboring blocks in space are unavailable or are intra-frame predicted, their motion information will not be added to the candidate motion information list.
  • the candidate motion information in the time domain of the current block is obtained by scaling the MV of the corresponding position block in the reference frame according to the picture order count (POC) of the reference frame and the current frame, and first judges the block whose position is T in the reference frame Whether it is available, if not available, select the block with position C. After obtaining the above candidate motion information list, determine the optimal motion information from the candidate motion information list through RD cost as the motion information of the current block.
  • the encoding end transmits the index value (denoted as merge index) of the position of the optimal motion information in the candidate motion information list to the decoding end.
  • the entropy encoding unit 270 includes a trained self-attention decoding network 2071 and a self-attention encoding network 2072, and the self-attention decoding network 2071 is used to process an input image or image region or image block to obtain first context information ;
  • the self-attention encoding network 2072 is used to process the input image or image region or image block to obtain the first side information.
  • the entropy coding unit 270 is used to use an entropy coding algorithm or scheme (for example, a variable length coding (variable length coding, VLC) scheme, a context adaptive VLC scheme (context adaptive VLC, CALVC), an arithmetic coding scheme, a binarization algorithm, Context Adaptive Binary Arithmetic Coding (CABAC), Syntax-based context-adaptive Binary Arithmetic Coding (SBAC), Probability Interval Partitioning Entropy (PIPE) ) encoding or other entropy encoding methods or techniques) are applied to the quantized residual coefficient 209, inter prediction parameters, intra prediction parameters, loop filter parameters and/or other syntax elements, and the obtained bit stream can be encoded by the output terminal 272 21 etc., so that the video decoder 30 etc. can receive and use parameters for decoding.
  • Encoded bitstream 21 may be transmitted to video decoder 30 or stored in memory for later transmission or retrieval by video decoder 30 .
  • a non-transform based encoder 20 may directly quantize the residual signal without a transform processing unit 206 for certain blocks or frames.
  • encoder 20 may have quantization unit 208 and inverse quantization unit 210 combined into a single unit.
  • the video decoder 30 is used to receive the encoded image data 21 (eg encoded bit stream 21 ) encoded by the encoder 20 to obtain a decoded image 331 .
  • the coded image data or bitstream comprises information for decoding said coded image data, eg data representing image blocks of a coded video slice (and/or coded block group or coded block) and associated syntax elements.
  • the decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transform processing unit 312, a reconstruction unit 314 (such as a summer 314), a loop filter 320, a decoded picture buffer (DBP ) 330, mode application unit 360, inter prediction unit 344, and intra prediction unit 354.
  • Inter prediction unit 344 may be or include a motion compensation unit.
  • video decoder 30 may perform a decoding process that is substantially inverse to the encoding process described with reference to video encoder 100 of FIG. 2 .
  • the entropy decoding unit 304 includes a trained self-attention decoding network 3041 , and the self-attention decoding network 3041 is used to process an input image or image region or image block to obtain first context information.
  • inverse quantization unit 210 can be functionally the same as the inverse quantization unit 210
  • the inverse transform processing unit 312 can be functionally the same as the inverse transform processing unit 212
  • the reconstruction unit 314 can be functionally the same as the reconstruction unit 214
  • the loop The filter 320 may be functionally the same as the loop filter 220
  • the decoded picture buffer 330 may be functionally the same as the decoded picture buffer 230 . Therefore, the explanation of the corresponding elements and functions of the video encoder 20 applies to the corresponding elements and functions of the video decoder 30 accordingly.
  • the entropy decoding unit 304 is used to analyze the bit stream 21 (or generally coded image data 21) and perform entropy decoding on the coded image data 21 to obtain quantization coefficients 309 and/or decoded coding parameters (not shown in FIG. 3 ), etc. , such as inter prediction parameters (such as reference image index and motion vector), intra prediction parameters (such as intra prediction mode or index), transformation parameters, quantization parameters, loop filter parameters and/or other syntax elements, etc. either or all.
  • the entropy decoding unit 304 may be configured to apply a decoding algorithm or scheme corresponding to the encoding scheme of the entropy encoding unit 270 of the encoder 20 .
  • Entropy decoding unit 304 may also be configured to provide inter-prediction parameters, intra-prediction parameters, and/or other syntax elements to mode application unit 360, as well as other parameters to other units of decoder 30.
  • Video decoder 30 may receive video slice and/or video block level syntax elements. Additionally, or instead of slices and corresponding syntax elements, coding block groups and/or coding blocks and corresponding syntax elements may be received or used.
  • the inverse quantization unit 310 may be configured to receive a quantization parameter (quantization parameter, QP) (or generally information related to inverse quantization) and quantization coefficients from the encoded image data 21 (for example, parsed and/or decoded by the entropy decoding unit 304), and based on The quantization parameter performs inverse quantization on the decoded quantization coefficient 309 to obtain an inverse quantization coefficient 311 , and the inverse quantization coefficient 311 may also be called a transform coefficient 311 .
  • the inverse quantization process may include using quantization parameters calculated by video encoder 20 for each video block in the video slice to determine the degree of quantization, as well as the degree of inverse quantization that needs to be performed.
  • the inverse transform processing unit 312 is operable to receive inverse quantization coefficients 311 , also referred to as transform coefficients 311 , and apply a transform to the inverse quantization coefficients 311 to obtain a reconstructed residual block 213 in the pixel domain.
  • the reconstructed residual block 213 may also be referred to as a transform block 313 .
  • the transform may be an inverse transform, such as an inverse DCT, an inverse DST, an inverse integer transform, or a conceptually similar inverse transform process.
  • the inverse transform processing unit 312 may also be configured to receive transform parameters or corresponding information from the encoded image data 21 (eg, parsed and/or decoded by the entropy decoding unit 304 ) to determine the transform to apply to the dequantized coefficients 311 .
  • the reconstruction unit 314 (for example, the summer 314) is used to add the reconstruction residual block 313 to the prediction block 365 to obtain the reconstruction block 315 in the pixel domain, for example, the pixel value of the reconstruction residual block 313 and the prediction block 365 pixel values are added.
  • the loop filter unit 320 is used (in the encoding loop or after) to filter the reconstructed block 315 to obtain the filtered block 321 to smooth pixel transformation or improve video quality, etc.
  • the loop filter unit 320 may include one or more loop filters, such as deblocking filters, pixel adaptive offset (sample-adaptive offset, SAO) filters, or one or more other filters, such as auto Adaptive loop filter (ALF), noise suppression filter (NSF), or any combination.
  • the loop filter unit 220 may include a deblocking filter, an SAO filter, and an ALF filter. The order of the filtering process may be deblocking filter, SAO filter and ALF filter.
  • LMCS luma mapping with chroma scaling
  • This process is performed before deblocking.
  • the deblocking filtering process can also be applied to internal sub-block edges, such as affine sub-block edges, ATMVP sub-block edges, sub-block transform (sub-block transform, SBT) edges and intra sub-partition (ISP )edge.
  • loop filter unit 320 is shown in FIG. 3 as a loop filter, in other configurations, loop filter unit 320 may be implemented as a post-loop filter.
  • the decoded video block 321 in one picture is then stored in a decoded picture buffer 330 which stores the decoded picture 331 as a reference picture for subsequent motion compensation in other pictures and/or for respective output display.
  • the decoder 30 is used to output the decoded image 311 through the output terminal 312 and so on, for displaying or viewing by the user.
  • the inter prediction unit 344 may be functionally the same as the inter prediction unit 244 (especially the motion compensation unit), and the intra prediction unit 354 may be functionally the same as the inter prediction unit 254, and is based on the coded image data 21 (eg Partitioning and/or prediction parameters or corresponding information received by the entropy decoding unit 304 (parsed and/or decoded) determines partitioning or partitioning and performs prediction.
  • the mode application unit 360 can be used to perform prediction (intra-frame or inter-frame prediction) for each block according to the reconstructed image, block or corresponding pixels (filtered or unfiltered), to obtain the predicted block 365 .
  • the intra prediction unit 354 in the mode application unit 360 is used to generate an input frame based on the indicated intra prediction mode and data from a previously decoded block of the current picture.
  • a prediction block 365 based on an image block of the current video slice.
  • inter prediction unit 344 e.g., motion compensation unit
  • the element generates a prediction block 365 for a video block of the current video slice.
  • the predicted blocks may be generated from one of the reference pictures in one of the reference picture lists.
  • Video decoder 30 may construct reference frame list 0 and list 1 from the reference pictures stored in DPB 330 using a default construction technique.
  • slices e.g., video slices
  • the same or similar process can be applied to embodiments of encoding block groups (e.g., video encoding block groups) and/or encoding blocks (e.g., video encoding blocks),
  • video may be encoded using I, P or B coding block groups and/or coding blocks.
  • the mode application unit 360 is configured to determine prediction information for a video block of the current video slice by parsing motion vectors and other syntax elements, and use the prediction information to generate a prediction block for the current video block being decoded. For example, the mode application unit 360 uses some of the received syntax elements to determine the prediction mode (such as intra prediction or inter prediction), the inter prediction slice type (such as B slice, P slice or GPB slice) for encoding the video block of the video slice. slice), construction information for one or more reference picture lists for the slice, motion vectors for each inter-coded video block of the slice, inter prediction state for each inter-coded video block of the slice, Other information to decode video blocks within the current video slice.
  • the prediction mode such as intra prediction or inter prediction
  • the inter prediction slice type such as B slice, P slice or GPB slice
  • construction information for one or more reference picture lists for the slice motion vectors for each inter-coded video block of the slice, inter prediction state for each inter-coded video block of the slice, Other information to decode video blocks within the
  • encoding block groups e.g., video encoding block groups
  • encoding blocks e.g., video encoding blocks
  • video may be encoded using I, P or B coding block groups and/or coding blocks.
  • the video encoder 30 of FIG. 3 can also be used to segment and/or decode an image using slices (also called video slices), where an image can be segmented using one or more slices (typically non-overlapping). split or decode.
  • slices also called video slices
  • Each slice may include one or more blocks (eg, CTUs) or one or more block groups (eg, coded blocks in the H.265/HEVC/VVC standard and tiles in the VVC standard.
  • the video decoder 30 shown in FIG. 3 can also be configured to use slices/coded block groups (also called video coded block groups) and/or coded blocks (also called video coded block groups) ) to segment and/or decode an image, where an image may be segmented or decoded using one or more slices/coded block groups (usually non-overlapping), each slice/coded block group may consist of one or more A block (such as a CTU) or one or more coding blocks, etc., wherein each coding block may be in the shape of a rectangle or the like, and may include one or more complete or partial blocks (such as a CTU).
  • slices/coded block groups also called video coded block groups
  • coded blocks also called video coded block groups
  • video decoder 30 may be used to decode encoded image data 21 .
  • decoder 30 may generate an output video stream without loop filter unit 320 .
  • the non-transform based decoder 30 can directly inverse quantize the residual signal if some blocks or frames do not have the inverse transform processing unit 312 .
  • video decoder 30 may have inverse quantization unit 310 and inverse transform processing unit 312 combined into a single unit.
  • the processing result of the current step can be further processed, and then output to the next step.
  • further operations such as clipping or shifting operations, may be performed on the processing results of interpolation filtering, motion vector derivation or loop filtering.
  • the value of the motion vector is limited to a predefined range according to the representation bits of the motion vector. If the representation bit of the motion vector is bitDepth, the range is -2 ⁇ (bitDepth-1) to 2 ⁇ (bitDepth-1)-1, where " ⁇ " represents a power. For example, if the bitDepth is set to 16, the range is -32768 to 32767; if the bitDepth is set to 18, the range is -131072 to 131071.
  • the value of deriving a motion vector (e.g. the MVs of 4 4x4 sub-blocks in an 8x8 block) is constrained such that the maximum difference between the integer parts of the 4 4x4 sub-blocks MVs is not More than N pixels, for example, no more than 1 pixel.
  • a motion vector e.g. the MVs of 4 4x4 sub-blocks in an 8x8 block
  • bitDepth two ways to limit motion vectors based on bitDepth.
  • embodiments of the decoding system 10, encoder 20, and decoder 30, as well as other embodiments described herein may also be used for still image processing or codecs, That is, the processing or coding of a single image in a video codec independently of any previous or successive images.
  • image processing is limited to a single image 17, inter prediction unit 244 (encoder) and inter prediction unit 344 (decoder) may not be available.
  • All other functions (also referred to as tools or techniques) of video encoder 20 and video decoder 30 are equally applicable to still image processing, such as residual calculation 204/304, transform 206, quantization 208, inverse quantization 210/310, (inverse ) transformation 212/312, segmentation 262/362, intra prediction 254/354 and/or loop filtering 220/320, entropy encoding 270 and entropy decoding 304.
  • the video decoding device can be a decoder, such as the video decoder 30 in FIG. 1, or an encoder, such as the video decoder 30 in FIG. 1. Encoder 20.
  • the video decoding device includes: an input port (or input port) and a receiving unit (receiver unit, Rx) for receiving data; a processor, a logic unit or a central processing unit (central processing unit, CPU) for processing data;
  • the processor here may be a neural network processor; a transmitter unit (transmitter unit, Tx) and an output port (or output port) for transmitting data; and a memory for storing data.
  • the video decoding device may also include an optical-to-electrical (OE) component and an electrical-to-optical (EO) component coupled to the input port, the receiving unit, the transmitting unit and the output port, for optical signals or The exit or entrance of an electrical signal.
  • OE optical-to-electrical
  • EO electrical-to-optical
  • a processor may be implemented as one or more processor chips, cores (eg, multi-core processors), FPGAs, ASICs, and DSPs.
  • the processor communicates with the ingress port, the receiving unit, the transmitting unit, the egress port and the memory.
  • the processor includes a decoding module (eg, a neural network based decoding module).
  • the coding module implements the embodiments disclosed above. For example, the decoding module performs, processes, prepares, or provides various encoding operations. Thus, a substantial improvement in the functionality of the video decoding device is provided by the decoding module and the switching of the video decoding device to different states is effected.
  • the decode module is implemented as instructions stored in memory and executed by a processor.
  • Memory including one or more magnetic disks, tape drives, and solid-state drives, may be used as an overflow data storage device for storing programs when such programs are selected for execution, and for storing instructions and data that are read during program execution.
  • Memory can be volatile and/or nonvolatile, and can be read-only memory (ROM), random access memory (RAM), ternary content -addressable memory, TCAM) and/or static random-access memory (static random-access memory, SRAM).
  • An embodiment of the present application provides an apparatus, which may include a processor, a memory, and a bus.
  • the apparatus may be used as either or both of source device 12 and destination device 14 in FIG. 1 .
  • the processor in the device may be a central processing unit.
  • a processor may be any other type or devices, existing or later developed, capable of manipulating or processing information. While the disclosed implementations can be implemented using a single processor, such as the one shown, it is faster and more efficient to use more than one processor.
  • the memory in the apparatus may be a read only memory (ROM) device or a random access memory (RAM) device. Any other suitable type of storage device may be used as memory.
  • the memory can include code and data accessed by the processor through the bus.
  • the memory may also include an operating system and application programs, including at least one program that allows the processor to perform the methods described herein.
  • the application programs may include applications 1 through N, and also include a video coding application that performs the methods described herein.
  • An apparatus may also include one or more output devices, such as displays.
  • the display can be a touch sensitive display that combines the display with touch sensitive elements that can be used to sense touch input.
  • a display can be coupled to the processor via a bus.
  • bus in the device is described herein as a single bus, the bus may include multiple buses. Additionally, secondary storage may be directly coupled to other components of the device or accessed over a network, and may comprise a single integrated unit such as a memory card or multiple units such as multiple memory cards. Accordingly, the device may have a wide variety of configurations.
  • Neural network (neural network, NN) is a machine learning model.
  • a neural network can be composed of neural units.
  • a neural unit can refer to a computing unit that takes xs and intercept 1 as input.
  • the output of the computing unit can be:
  • Ws is the weight of xs
  • b is the bias of the neural unit.
  • f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer.
  • the activation function may be a sigmoid function.
  • a neural network is a network formed by connecting many of the above-mentioned single neural units, that is, the output of one neural unit can be the input of another neural unit.
  • the input of each neural unit can be connected with the local receptive field of the previous layer to extract the features of the local receptive field.
  • the local receptive field can be an area composed of several neural units.
  • a deep neural network also known as a multilayer neural network
  • DNN can be understood as a neural network with many hidden layers, and there is no special metric for the "many” here.
  • the neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer.
  • the first layer is the input layer
  • the last layer is the output layer
  • the layers in the middle are all hidden layers.
  • the layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer.
  • the coefficient of the kth neuron of the L-1 layer to the jth neuron of the L layer is defined as It should be noted that the input layer has no W parameter.
  • more hidden layers make the network more capable of describing complex situations in the real world. Theoretically speaking, a model with more parameters has a higher complexity and a greater "capacity", which means that it can complete more complex learning tasks.
  • Training the deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (the weight matrix formed by the vector W of many layers).
  • CNN Convolutional neural network
  • a convolutional neural network consists of a feature extractor consisting of convolutional and pooling layers. The feature extractor can be seen as a filter, and the convolution process can be seen as using a trainable filter to convolve with an input image or convolutional feature map.
  • the convolutional layer refers to the neuron layer that performs convolution processing on the input signal in the convolutional neural network.
  • the convolution layer can include many convolution operators, which are also called kernels, and their role in image processing is equivalent to a filter that extracts specific information from the input image matrix.
  • the convolution operator can essentially Is a weight matrix, this weight matrix is usually pre-defined, in the process of convolution operation on the image, the weight matrix is usually along the horizontal direction of the input image pixel by pixel (or two pixels by two pixels... ...This depends on the value of the stride) to complete the work of extracting specific features from the image.
  • the size of the weight matrix should be related to the size of the image.
  • the depth dimension of the weight matrix is the same as the depth dimension of the input image.
  • the weight matrix will be extended to The entire depth of the input image. Therefore, convolution with a single weight matrix will produce a convolutional output with a single depth dimension, but in most cases instead of using a single weight matrix, multiple weight matrices of the same size (row ⁇ column) are applied, That is, multiple matrices of the same shape.
  • the output of each weight matrix is stacked to form the depth dimension of the convolution image, where the dimension can be understood as determined by the "multiple" mentioned above. Different weight matrices can be used to extract different features in the image.
  • one weight matrix is used to extract image edge information
  • another weight matrix is used to extract specific colors of the image
  • another weight matrix is used to filter unwanted noise in the image. Do blurring etc.
  • the multiple weight matrices have the same size (row ⁇ column), and the feature maps extracted by the multiple weight matrices of the same size are also of the same size, and then the extracted multiple feature maps of the same size are combined to form the convolution operation. output.
  • the weight values in these weight matrices need to be obtained through a lot of training in practical applications, and each weight matrix formed by the weight values obtained through training can be used to extract information from the input image, so that the convolutional neural network can make correct predictions.
  • the initial convolutional layer often extracts more general features, which can also be called low-level features; as the depth of the convolutional neural network deepens,
  • the features extracted by the later convolutional layers become more and more complex, such as high-level semantic features, and the higher semantic features are more suitable for the problem to be solved.
  • pooling layer After a convolutional layer. It can be a convolutional layer followed by a pooling layer, or a multi-layer convolutional layer followed by a pooling layer. layer or multiple pooling layers.
  • the sole purpose of pooling layers is to reduce the spatial size of the image.
  • the pooling layer may include an average pooling operator and/or a maximum pooling operator for sampling an input image to obtain an image of a smaller size.
  • the average pooling operator can calculate the pixel value in the image within a specific range to generate an average value as the result of average pooling.
  • the maximum pooling operator can take the pixel with the largest value within a specific range as the result of maximum pooling.
  • the operators in the pooling layer should also be related to the size of the image.
  • the size of the image output after being processed by the pooling layer may be smaller than the size of the image input to the pooling layer, and each pixel in the image output by the pooling layer represents the average or maximum value of the corresponding sub-region of the image input to the pooling layer.
  • the convolutional neural network After being processed by the convolutional layer/pooling layer, the convolutional neural network is not enough to output the required output information. Because as mentioned earlier, the convolutional layer/pooling layer only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (required class information or other relevant information), the convolutional neural network needs to use the neural network layer to generate an output of one or a set of required classes. Therefore, the neural network layer can include multiple hidden layers, and the parameters contained in the multi-layer hidden layers can be pre-trained according to the relevant training data of the specific task type. For example, the task type can include image recognition, Image classification, image super-resolution reconstruction and more.
  • the output layer of the entire convolutional neural network is also included.
  • This output layer has a loss function similar to the classification cross entropy, which is specifically used to calculate the prediction error.
  • Recurrent neural networks are used to process sequence data.
  • the layers are fully connected, and each node in each layer is unconnected.
  • RNN Recurrent neural networks
  • this ordinary neural network solves many problems, it is still powerless to many problems. For example, if you want to predict what the next word in a sentence is, you generally need to use the previous words, because the preceding and following words in a sentence are not independent. The reason why RNN is called a recurrent neural network is that the current output of a sequence is also related to the previous output.
  • RNN can process sequence data of any length.
  • the training of RNN is the same as that of traditional CNN or DNN.
  • the error backpropagation algorithm is also used, but there is a difference: that is, if the RNN is expanded to the network, then the parameters, such as W, are shared; while the above-mentioned traditional neural network is not the case.
  • the output of each step depends not only on the network of the current step, but also depends on the state of the previous several steps of the network. This learning algorithm is called Back propagation Through Time (BPTT) based on time.
  • BPTT Back propagation Through Time
  • the convolutional neural network can use the error back propagation (back propagation, BP) algorithm to correct the size of the parameters in the initial super-resolution model during the training process, so that the reconstruction error loss of the super-resolution model becomes smaller and smaller. Specifically, passing the input signal forward until the output will generate an error loss, and updating the parameters in the initial super-resolution model by backpropagating the error loss information, so that the error loss converges.
  • the backpropagation algorithm is a backpropagation movement dominated by error loss, aiming to obtain the parameters of the optimal super-resolution model, such as the weight matrix.
  • GAN Generative adversarial networks
  • the model includes at least two modules: one module is a Generative Model, and the other is a Discriminative Model. These two modules learn from each other through games to produce better output.
  • Both the generative model and the discriminative model can be neural networks, specifically deep neural networks or convolutional neural networks.
  • the basic principle of GAN is as follows: Taking the GAN that generates pictures as an example, suppose there are two networks, G (Generator) and D (Discriminator), where G is a network that generates pictures, which receives a random noise z, and passes this noise Generate a picture, denoted as G(z); D is a discriminant network, used to determine whether a picture is "real".
  • Its input parameter is x
  • x represents a picture
  • the output D(x) represents the probability that x is a real picture. If it is 1, it means that 100% is a real picture. If it is 0, it means that it cannot be real. picture.
  • the goal of the generation network G is to generate real pictures as much as possible to deceive the discriminant network D
  • the goal of the discriminant network D is to distinguish the pictures generated by G from the real pictures as much as possible. Come. In this way, G and D constitute a dynamic "game” process, which is the "confrontation" in the "generative confrontation network”.
  • Fig. 5 is a schematic diagram of an application scenario provided by an embodiment of the present application, and Fig. 5 is illustrated by taking data including images/videos as an example.
  • the application scenario is that the device acquires images/videos, performs entropy encoding on the acquired images/videos to obtain code streams, and stores the code streams. When the image/video needs to be output subsequently, the code stream is entropy decoded to obtain the image/video.
  • the device may integrate the functions of the aforementioned source device and destination device.
  • the device includes an encoding network, a super-encoding network, an entropy encoding network, a saving module, a loading module, a super-decoding network, an entropy decoding network and a decoding network.
  • the encoding network is used to extract features from the input images/videos to obtain feature images/videos with low redundancy.
  • the super-encoding network is used to estimate the estimated probability value of each feature element in the feature image/video.
  • the entropy encoding module is used to perform entropy encoding on the corresponding feature element according to the estimated probability value of each feature element to obtain the code stream and store the code stream through the saving module.
  • the subsequent loading module can load the code stream, and the super decoding network is used to estimate the estimated probability value of the code stream corresponding to each feature element in the code stream.
  • the entropy decoding module is used to perform entropy decoding on the corresponding code stream according to the estimated probability value of the code stream corresponding to each feature element to obtain the feature image/video.
  • the decoding network is used to perform inverse feature extraction on feature images/videos to obtain images/videos.
  • the device compresses the image/video to save storage space.
  • the device can store compressed images/videos in an album or a cloud album.
  • FIG. 6 is a schematic diagram of another application scenario provided by the embodiment of the present application.
  • FIG. 6 is illustrated by taking data including images/videos as an example.
  • the application scenario is to acquire images/videos locally, perform image (JPEG) encoding on the acquired data to obtain compressed images/videos, and then send compressed images/videos to the cloud.
  • the cloud performs JPEG decoding on the compressed image/video to obtain the image/video, and then performs entropy encoding on the image/video to obtain the code stream and store the code stream.
  • JPEG image
  • the cloud When the local needs to obtain images/videos from the cloud, the cloud performs entropy decoding on the code stream to obtain images/videos, and then JPEG encodes the images/videos to obtain compressed images/videos, and sends compressed images/videos to the local. Locally perform JPEG decoding on compressed images/videos to obtain images/videos.
  • the cloud may be integrated with the functions of the aforementioned source device and destination device.
  • the cloud and the usage of each module reference may be made to the structure of FIG. 5 and the usage of each module, and the embodiment of the present application will not repeat them here.
  • JPEG encoding is performed locally or on the cloud to reduce transmission bandwidth
  • image/video compression is performed on the cloud to save storage space.
  • FIG. 7 is a schematic structural diagram of an encoder in an end-to-end encoding and decoding architecture provided by an embodiment of the present application.
  • the encoder includes an encoding network, a quantization module, a super-encoding network, a super-decoding network and an entropy encoding module.
  • the encoding network is used to perform feature extraction on the input current data stream to obtain feature data.
  • the quantization module is used to quantize the feature data, and the quantized feature data passes through the super-encoding network to obtain the code stream 2 of side information. Code stream 2 gets side information through the super decoding network.
  • the entropy encoding module is used to perform entropy encoding on the input feature data by using side information to obtain code stream 1 .
  • FIG. 8 is a schematic structural diagram of a decoder in an end-to-end codec architecture provided by an embodiment of the present application.
  • the decoder includes a decoding network, an entropy decoding module and a super decoding network.
  • the code stream 2 is decoded by the super-decoding network to obtain side information, and the entropy decoding module is used to perform entropy decoding on the code stream 1 according to the side information to obtain feature data.
  • the decoding network is used to perform anti-feature extraction on the feature data to obtain the current data stream.
  • the encoder can obtain reference information, and then estimate the estimated probability distribution of the data to be encoded according to the reference information, and use the estimated probability distribution of the data to be encoded to perform entropy encoding on the data to be encoded to obtain a code stream .
  • the decoder can obtain the reference information, and then estimate the estimated probability distribution of the code stream according to the reference information, and perform entropy decoding on the code stream by using the estimated probability distribution of the code stream.
  • the reference information may include first context information and/or first side information, and further, the reference information may further include second context information and second side information.
  • the current data stream When performing entropy encoding on the data to be encoded included in the current data stream, the current data stream includes multiple data, the first context information is obtained by inputting at least one encoded data in the multiple data into the self-attention decoding network, the first Side information is obtained by feeding multiple data in the current data stream into the self-attention encoding network.
  • the second context information is obtained by inputting at least one of the at least one coded data meeting the preset condition into the masked convolutional network.
  • the second side information is obtained by inputting at least one data meeting the preset condition among the multiple data into the supercoding network.
  • the at least one piece of data meeting the preset condition in the at least one piece of coded data may include at least one piece of data in the coded data that is adjacent to the data to be coded.
  • the neighbors of the data to be coded may be the coded data of the first m bits of the data to be coded, m>0.
  • the neighbors of the data to be encoded can be the adjacent data of the data to be encoded, or the encoded data in the peripheral n circle data of the data to be encoded, etc., n>0, the embodiment of the present application does not limit the neighbors .
  • the first context information is obtained based on at least one encoded data among the plurality of data
  • the second context information is obtained based on at least one data adjacent to the data to be encoded among the at least one encoded data.
  • the first context information has a higher utilization rate of encoded data and more comprehensive content.
  • the at least one piece of data that meets the preset condition among the pieces of data may include at least one piece of data that is adjacent to the data to be encoded among the pieces of data.
  • the neighbors to the data to be encoded may be the first m 1 bits and/or the last m 2 bits of the data to be encoded, m 1 , m 2 >0.
  • the neighbors of the data to be encoded may be the adjacent data of the data to be encoded, or the data of the outer n circles of the data to be encoded, etc., n>0, and the embodiment of the present application does not limit the neighbors.
  • the first side information is obtained based on a plurality of data
  • the second side information is obtained based on at least one data adjacent to the data to be encoded among the plurality of data.
  • the first side information has a higher utilization rate of data and more comprehensive content.
  • the first context information is obtained by inputting at least one decoded data into the self-attention decoding network
  • the first side information is obtained by entropy decoding the code stream of the first side information.
  • the second context information is obtained by inputting at least one piece of data meeting the preset condition in the at least one piece of decoded data into the masked convolutional network.
  • the second side information is obtained by performing entropy decoding on the code stream of the second side information.
  • the reference information only includes the first context information.
  • FIG. 9 The structure diagram of a decoder provided as an example.
  • the encoder includes an encoding network, a quantization module, a self-attention decoding network and an entropy encoding module.
  • the functions of the same network or module as in FIG. 8 are also the same, and the embodiment of the present application will not repeat them here.
  • the self-attention decoding network is used to extract the first context information from the quantized feature data, and the entropy coding module is used to perform entropy coding on the quantized feature data according to the first context information to obtain a code stream.
  • the decoder includes a self-attention decoding network, an entropy decoding module, and a decoding network.
  • the self-attention decoding network is used to extract the first context information from the decoded data, and the entropy decoding module is used to perform entropy decoding on the code stream according to the first context information.
  • FIG. 11 is a schematic structural diagram of an encoder provided in an embodiment of the present application
  • the encoder includes an encoding network, a self-attention encoding network, a quantization module, a decomposition entropy model, an entropy encoding module, an entropy decoding module, and a self-attention decoding network.
  • the self-attention coding network is used to extract the first side information from the feature data after feature extraction, the decomposition entropy model is used to estimate the estimated probability distribution of the first side information, and the entropy coding module is used to estimate the first side information
  • the probability distribution performs entropy coding on the first side information to obtain code stream 2.
  • the entropy decoding module is configured to perform entropy decoding on the code stream 2 according to the estimated probability distribution of the first side information to obtain the first side information.
  • the self-attention decoding network is used to estimate the estimated probability distribution of the current data stream according to the first side information.
  • the entropy encoding module is used to perform entropy encoding on the quantized feature data according to the estimated probability distribution of the current data stream to obtain the code stream 1 .
  • the decoder includes an entropy decoding module, a self-attention decoding network, and a decoding network.
  • the entropy decoding module is used to perform entropy decoding on the code stream 2 to obtain the first side information
  • the self-attention decoding network is used to estimate the estimated probability distribution of the code stream 1 according to the first side information
  • the entropy decoding module is used to obtain the estimated probability distribution of the code stream 1 according to the Estimate the probability distribution to perform entropy decoding on code stream 1.
  • the reference information includes the first context information and the first side information.
  • FIG. 13 is a schematic structural diagram of an encoder provided by an embodiment of the present application.
  • 14 is a schematic structural diagram of a decoder provided in the embodiment of the present application.
  • the encoder includes an encoding network, a self-attention encoding network, a quantization module, a decomposition entropy model, an entropy encoding module, an entropy decoding module and a self-attention decoding network.
  • the self-attention decoding network is used to extract the first context information from the quantized feature data, and estimate the estimated probability distribution of the current data stream according to the first context information and the first side information.
  • the decoder includes an entropy decoding module, a self-attention decoding network, and a decoding network.
  • the self-attention decoding network is used to extract the first context information from the decoded data, and estimate the estimated probability distribution of code stream 1 according to the first context information and the first side information.
  • Both the self-attention decoding network and the self-attention encoding network are neural networks with a self-attention mechanism (ie, including a self-attention structure).
  • the self-attention mechanism is a variant of the attention mechanism, which reduces the dependence on external information and can better obtain the internal correlation of data or features.
  • FIG. 15 is a schematic diagram of a self-attention structure provided by the embodiment of the present application.
  • the input of the self-attention structure includes three tensor queries (Query, Q), keys (Key, K) and values ( Value, V).
  • the self-attention structure includes matrix multiplication (MatMul) operations, scaling (Scale) operations, mask (Mask) operations, and exponential normalization (Softmax) operations.
  • Figure 16 is a schematic structural diagram of a self-attention encoding network provided by the embodiment of the present application.
  • the self-attention encoding network includes the operation of embedding position encoding into the input and the N1 part.
  • the N1 part includes a multi-head attention mechanism. operations, summation and normalization operations, and feedforward operations.
  • FIG. 17 is a schematic structural diagram of a self-attention decoding network provided by an embodiment of the present application.
  • the self-attention decoding network includes the operation of embedding position codes into the input and the N2 part.
  • the N2 part includes masked multi-head attention Force mechanism operations, summation and normalization operations, and feedforward operations.
  • FIG. 18 is a flowchart of a process 100 of the entropy encoding method provided by the embodiment of the present application.
  • the process 100 can be executed by an encoder, specifically, it can be executed by an entropy coding unit of the encoder.
  • the process 100 is described as a series of steps or operations. It should be understood that the process 100 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 18 . Assuming that a current data stream with multiple data is using an encoder, a process 100 including the following steps is performed to entropy encode data.
  • Process 800 may include:
  • Step 101 Obtain the data to be encoded, where the data to be encoded is the non-first encoded data among the multiple data included in the current data stream.
  • Step 102 obtain reference information, the reference information includes at least one of the first context information and the first side information, the first context information is obtained by inputting at least one coded data into the self-attention decoding network, the first side information It is obtained by feeding multiple data into the self-attention encoding network.
  • Step 103 estimating and obtaining a first estimated probability distribution according to the reference information.
  • Step 104 Perform entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain a first code stream.
  • FIG. 19 is a flowchart of a process 200 of an entropy decoding method provided by an embodiment of the present application.
  • the process 200 can be executed by a decoder, specifically, it can be executed by an entropy decoding unit of the decoder.
  • the process 200 is described as a series of steps or operations. It should be understood that the process 200 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 19 . Assuming that a current data stream with multiple data is using a decoder, a process 200 including the following steps is performed to entropy encode and decode data.
  • Process 200 may include:
  • Step 201 Acquire a first code stream.
  • Step 202 Obtain reference information.
  • the reference information includes at least one of the first context information and the decoded first side information.
  • the first context information is obtained by inputting at least one decoded data into the self-attention decoding network. After decoding
  • the first side information is obtained by performing entropy decoding on the second code stream.
  • Step 203 estimating and obtaining a first estimated probability distribution according to the reference information.
  • Step 204 Perform entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, where the decoded data is non-first decoded data among multiple data included in the current data stream.
  • FIG. 20 is a flowchart of a process 300 of the entropy encoding and decoding method provided by the embodiment of the present application.
  • the process 300 can be performed by an encoder and a decoder, specifically, it can be performed by an entropy encoding unit of the encoder and an entropy decoding unit of the decoder.
  • the process 300 is described as a series of steps or operations. It should be understood that the process 300 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 20 . Assuming that a current data stream with multiple data is using an encoder and a decoder, a process 300 including the following steps is performed to entropy encode and decode data.
  • Process 300 may include:
  • step 301 the encoder acquires data to be encoded, and the data to be encoded is the non-first encoded data among multiple data included in the current data stream.
  • Multiple data can also be referred to as multiple data units.
  • Multiple data can include video data, image data, audio data, integer data, and other data with compression/decompression requirements. limited. Wherein, each data corresponds to a piece of position information, and the data to be encoded is not at the first place among the multiple data.
  • the current data stream may be in a one-dimensional format or a two-dimensional format, and the embodiment of the present application does not limit the format of the current data stream.
  • the encoder can directly use the initial data stream as the current data stream, or can flatten the initial data stream in a non-one-dimensional format into a one-dimensional format , to get the current data flow, at this time each data can be regarded as a "word" in the text.
  • an initial data stream in a non-one-dimensional format into a one-dimensional format it may be flattened in a preset order.
  • the two-dimensional initial data stream can be flattened in the order of top to bottom and left to right, or in the order of bottom to top and left to right, or in the order of The preset sequence is equal to flattening, and the embodiment of the present application does not limit the sequence of flattening.
  • the data to be coded after obtaining the data to be coded, can also be quantized, which can reduce the amount of data required to represent the data to be coded, so that the code rate in the subsequent entropy coding process is reduced, thereby effectively reducing the entropy Encoding overhead.
  • the quantization process may be performed in a manner such as scalar quantization or vector quantization, and the embodiment of the present application does not limit the quantization process manner.
  • entropy encoding is generally performed on the first data first, and then entropy encoding is performed on the data to be encoded.
  • the fourth estimated probability distribution may be obtained by estimating according to preset information.
  • a fourth estimated probability distribution is estimated by using a learnable model obtained through training, and then entropy encoding is performed on the first encoded data according to the fourth estimated probability distribution to obtain a fourth code stream.
  • the embodiment of the present application does not limit the manner of obtaining the fourth estimated probability distribution.
  • step 302 the encoder acquires first context information.
  • the first context information is obtained by inputting at least one encoded data among the plurality of data included in the current data stream into the self-attention decoding network, and the encoded data refers to data that has been entropy-encoded by the encoder among the plurality of data. Since there is no encoded data when performing entropy encoding on the first data of the current data stream, the data to be encoded needs to be the non-first data of the current data stream, so that the first context information can be extracted.
  • the first context information obtained based on at least one of the encoded data among the plurality of data has less data redundancy, and the utilization rate of the encoded data is higher.
  • the code rate in the entropy encoding process is smaller, so inputting at least one encoded data in the plurality of data into the self-attention decoding network to obtain the first context information can reduce the entropy The code rate in the encoding process, thereby reducing the overhead of entropy encoding.
  • the code rate is an average code length required for entropy coding unit data.
  • the self-attention decoding network is a neural network with a self-attention mechanism (that is, including a self-attention structure), which has a global receptive field, and can obtain the correlation between all the input encoded data and the data to be encoded.
  • the correlation can be expressed as The weight of all encoded data entered relative to the data to be encoded.
  • the self-attention decoding network After the self-attention decoding network obtains the weights of all the input encoded data relative to the data to be encoded, it weights the corresponding encoded data according to the weights to obtain the first context information.
  • the self-attention decoding network may weight all input encoded data with corresponding weights to obtain the first context information.
  • the utilization rate of encoded data in the process of acquiring the first context information is improved.
  • the first estimated probability distribution is subsequently estimated by using the first context information, the accuracy of the obtained first estimated probability distribution can be further improved, and the code rate in the entropy encoding process can be further reduced, thereby further reducing the entropy encoding overhead.
  • the self-attention decoding network may select the input part of the encoded data according to the obtained weight, and weight the part of the encoded data with the corresponding weight to obtain the first context information.
  • the obtained weights may be sorted in descending order, and the coded data corresponding to the top i 1 weights are selected for weighting.
  • the obtained weights are sorted in ascending order, and the encoded data corresponding to the last i 2 weights are selected for weighting.
  • the utilization rate of the coded data with higher weight in the process of obtaining the first context information can be guaranteed, and when the first estimated probability distribution is estimated by using the first context information subsequently , can further improve the accuracy of the obtained first estimated probability distribution, and further reduce the code rate in the process of entropy coding, thereby further reducing the overhead of entropy coding.
  • the self-attention decoding network can perform an embedding operation on each data in the current data stream.
  • the embedding operation refers to converting each data from the original data space to another space .
  • positional encoding on each data to obtain the positional information of each data, and combine the positional information of each data with the data.
  • Each data has coordinate information
  • location coding refers to extracting the location information of each data according to the coordinate information of each data.
  • the location information of each data can be combined with the data by bitwise addition or concatenation, and the embodiment of the present application does not limit the location encoding method.
  • the input of the self-attention decoding network includes three tensors Q, K and V.
  • Q, K, and V go through masked multi-head self-attention mechanism, summation and normalization operation, multi-head attention mechanism, summation and normalization operation, feedforward operation, summation and normalization operation, and linearization Operation, output the first context information.
  • Q, K, and V refer to tensors of coded data, for example, tensors obtained by performing embedding operations and position coding on non-prime coded data in the foregoing process.
  • Step 303 the encoder estimates and obtains a first estimated probability distribution according to the first context information.
  • the first estimated probability distribution may comprise at least one estimated probability parameter.
  • the at least one estimated probability parameter may include a mean (mean) and a variance (scale), and the mean and the scale form a Gaussian distribution.
  • the first context information may be input into the probability distribution estimation network to obtain a first estimated probability distribution output by the probability distribution estimation network.
  • the probability distribution estimation network may be a single neural network, or a structure in the self-attention decoding network, which is not limited in this embodiment of the present application.
  • Figure 21 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application.
  • Figure 21 takes the initial data stream as a two-dimensional format and needs to flatten the initial data stream as an example.
  • the initial data Stream a includes 16 positions a1 to a16 arranged in 4 ⁇ 4, each position corresponding to one piece of data.
  • the data corresponding to position a10 is data to be encoded, the data corresponding to positions a1 to a9 are all encoded data, and the data corresponding to other positions are unencoded data, and each encoded data corresponds to a first estimated probability distribution.
  • the initial data stream a is flattened into a one-dimensional format from top to bottom and from left to right to obtain a current data stream b including 16 positions a1 to a16 arranged in sequence.
  • the current data stream b is input into the self-attention decoding network, and the self-attention decoding network determines the position information of each data in the current data stream b, and combines the position information of each data with the data.
  • the self-attention decoding network outputs the first context information based on the encoded data in the data stream b combined with position information (ie, the data corresponding to positions a1 to a9), and the first context information is input to the probability distribution estimation network, and the probability distribution estimation The network outputs the first estimated probability distribution, that is, the estimated probability distribution of the data corresponding to position a10.
  • the process shown in FIG. 21 is only an exemplary description, and does not limit the process of obtaining the first estimated probability distribution.
  • Step 304 the encoder performs entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain a first code stream.
  • the encoder may calculate the probability value of the data to be encoded according to the first estimated probability distribution, and then perform entropy encoding on the data to be encoded according to the probability value.
  • the first code stream may be in binary format.
  • the aforementioned steps 301 to 304 are described by taking the estimation to obtain the first estimated probability distribution, and performing entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain the first code stream as an example.
  • Each non-first data included in the current data stream can be used as the data to be encoded respectively, and the first estimated probability distribution is obtained according to the process shown in the aforementioned steps 301 to 304, and entropy encoding is performed according to the first estimated probability distribution, so as to obtain each A code stream of non-first data. It should be noted that, after each piece of data is encoded, the data is added to the encoded data.
  • Step 305 the encoder sends the first code stream to the decoder.
  • the encoder and the decoder have a communication interface with established communication connections, and the encoder can send the first code stream to the communication interface of the decoder through the communication interface.
  • the encoder performs entropy encoding on each non-first encoded data included in the current data stream to obtain a code stream of each non-first data. Furthermore, the current code stream is obtained according to the code stream of each non-prime data, and the current code stream includes code streams of multiple non-prime coded data arranged according to the encoding order of the multiple non-prime data by the encoder. Of course, the current code stream includes the first code stream. Then the encoder can send the current code stream including the first code stream to the decoder.
  • the fourth code stream may be included in the current code stream to be transmitted to the decoder.
  • the encoder sends the fourth code stream to the decoder independently, and this embodiment of the present application does not limit the way of sending the fourth code stream.
  • Step 306 the decoder acquires the first context information.
  • the first code stream belongs to a code stream in the current code stream received by the decoder, and the decoded data obtained after decoding the first code stream is the non-first bit among the multiple data contained in the current data stream decoded data.
  • the first context information may be obtained by inputting at least one piece of decoded data into the self-attention decoding network, and the decoded data refers to data obtained by performing entropy decoding before decoding the first code stream. Since there is no decoded data when performing entropy decoding on the fourth code stream, the decoded data obtained after decoding the first code stream is the non-first decoded data among the multiple data contained in the current data stream, so as to extract Get the first context information.
  • the aforementioned step 302 for the acquisition process of the first context information, reference may be made to the aforementioned step 302, and details are not described here in this embodiment of the present application.
  • the decoder when it performs entropy decoding on each code stream in the received current code stream, it usually performs entropy decoding on the fourth code stream first.
  • the decoder can estimate and obtain the fourth estimated probability distribution according to preset information. Or use the learnable model obtained through training to estimate the fourth estimated probability distribution, and then perform entropy decoding on the fourth code stream according to the fourth estimated probability distribution to obtain the decoded first bit data, the decoded first bit data is the first bit decoded among the plurality of data data.
  • the embodiment of the present application does not limit the manner of obtaining the fourth estimated probability distribution.
  • the fourth estimated probability distribution estimated by the decoder needs to be consistent with the fourth estimated probability distribution estimated by the encoder. For example, when the encoder estimates and obtains the fourth estimated probability distribution according to preset information, the decoder obtains the fourth estimated probability distribution according to the same fixed information. When the encoder estimates the fourth estimated probability distribution by using the learnable model obtained through training, the decoder estimates the fourth estimated probability distribution according to the same learnable model, and the estimated fourth estimated probability distribution is the same.
  • Step 307 the decoder estimates and obtains a first estimated probability distribution according to the first context information.
  • the first context information may be input into the probability distribution estimation network to obtain a first estimated probability distribution output by the probability distribution estimation network.
  • the probability distribution estimation network may be input into the probability distribution estimation network to obtain a first estimated probability distribution output by the probability distribution estimation network.
  • Step 308 the decoder performs entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, where the decoded data is non-first decoded data among multiple data included in the current data stream.
  • the decoder may calculate the probability value of the first code stream according to the first estimated probability distribution, and then perform entropy decoding on the first code stream according to the probability value. It should be noted that after each piece of decoded data is obtained through decoding, the decoded data is added to the decoded data.
  • the aforementioned steps 306 to 308 are described by taking the first estimated probability distribution obtained through estimation, and performing entropy decoding on the first code stream according to the first estimated probability distribution as an example.
  • Each code stream included in the current code stream can be used as the first code stream respectively, and the first estimated probability distribution is obtained according to the process shown in the foregoing step 306 to step 308, and entropy decoding is performed according to the first estimated probability distribution.
  • the obtained decoded data is in a one-dimensional format.
  • the decoder may transform the format of the decoded data into one-dimensional according to the two-dimensional distribution information of the decoded data, so as to obtain the two-dimensional decoded data having the same arrangement as the current data stream acquired by the encoder.
  • the two-dimensional distribution information may include the number and arrangement of decoded data arranged in the length direction and width direction of the two-dimensional plane, respectively.
  • the two-dimensional distribution information can be pre-stored in the decoder, or can be sent by the encoder.
  • the embodiment of the present application does not limit the content and acquisition method of the two-dimensional distribution information, as long as the two-dimensional decoded data can be guaranteed to be compatible with the encoder.
  • the arrangement of the obtained current data streams may be the same.
  • the adjacent encoded data of the data to be encoded is determined according to the position information of each data, and the context information is extracted from the adjacent encoded data by using the masked convolutional neural network, and then entropy encoding is performed on the data to be encoded based on the context information .
  • the adjacent decoded data of the data corresponding to the code stream to be decoded is determined, and the context information is extracted from the adjacent decoded data by using the masked convolutional neural network, and then based on the context information, the data to be decoded is The code stream is entropy decoded.
  • the first context information is extracted from at least one encoded data or decoded data, without considering the position encoding of each data, so the entropy encoding or entropy decoding process of multiple data can be executed in parallel, parallel execution
  • the time consumption is shorter, and the efficiency of entropy encoding and entropy decoding is improved compared with related technologies.
  • the masked convolutional neural network is used to extract context information.
  • context information only a local receptive field is used, and the utilization rate of encoded data or decoded data is low, resulting in an estimated probability distribution based on context information. is less accurate, resulting in high overhead for entropy encoding and entropy decoding.
  • the self-attention decoding network with self-attention mechanism can be used to obtain the weights of all the input encoded data or decoded data, and then part/all of the input encoded data or part/all of the decoded data The data is weighted with corresponding weights to obtain the first context information.
  • the utilization rate of the encoded data or the decoded data is improved, the data redundancy of the extracted first context information is less, and the accuracy of the obtained estimated probability distribution is further improved.
  • the code rate in the process of entropy encoding is reduced, thereby reducing the overhead of entropy encoding and entropy decoding.
  • Fig. 22 is a schematic diagram of the entropy coding performance provided by the embodiment of the present application, the coordinate system (22a) in Fig. -SSIM) using the embodiment of the present application and related technologies to perform entropy encoding on the test set respectively, the coordinate system (22b) shows the use of the present application under the peak signal-to-noise ratio (Peak Signal to Noise Ratio, PSNR) index
  • PSNR Peak Signal-to-noise ratio
  • the embodiments and related technologies respectively perform entropy coding performance on a test set.
  • the test set is the Kodak test set, and the Kodak test set includes 24 images in Portable Network Graphics (PNG) format.
  • the resolution of the 24 images can be 768 ⁇ 512 or 512 ⁇ 768.
  • the abscissa represents the pixel depth (Bits per pixel, BPP), and the ordinate represents the code rate.
  • BPP represents the average number of bits used by a pixel, and the smaller the value, the smaller the compression rate.
  • MS-SSIM and PSNR are objective standards for evaluating images, and the higher the value, the better the image quality.
  • the broken line e1 in the coordinate system (22a) and the coordinate system (22b) represents the embodiment of the present application, and the broken line e2 represents the related technology.
  • the MSSSIM index and PSNR index of the embodiment of the present application are higher than those of the related art at each code rate point, and the code rate of the embodiment of the present application is lower than that of the related art under the same compression quality.
  • the technology is 17% smaller and 15% smaller than related technologies at high bit rate points. That is, the compression performance of the embodiment of the present application is higher than that of the related art, and the embodiment of the present application can improve the accuracy of the estimated probability distribution of acquired data to be encoded or data to be decoded.
  • the encoder obtains the current data stream and the first context information, and then estimates the first estimated probability distribution according to the first context information, and treats it according to the first estimated probability distribution
  • Entropy encoding is performed on the encoded data to obtain a first code stream, and then the first code stream is sent to the decoder, and the decoder obtains the first code stream and first context information, estimates and obtains a first estimated probability distribution according to the first context information, and then
  • the first code stream is entropy decoded according to the first estimated probability distribution
  • the first context information is obtained by inputting at least one encoded data or decoded data into the self-attention decoding network, and the self-attention decoding network can analyze all the input
  • the encoded data is weighted with corresponding weights to obtain the first context information.
  • the utilization rate of encoded data in the process of acquiring the first context information is improved.
  • the accuracy of the obtained first estimated probability distribution can be improved, the code rate in the entropy encoding process can be further reduced, and the entropy encoding overhead can be further reduced. Therefore, the bandwidth occupancy rate of the first code stream transmitted to the decoder is reduced, and the transmission efficiency of the first code stream transmitted to the decoding side is improved.
  • FIG. 23 is a flowchart of a process 400 of the entropy encoding and decoding method provided by the embodiment of the present application.
  • the process 400 can be performed by an encoder and a decoder, specifically, it can be performed by an entropy encoding unit of the encoder and an entropy decoding unit of the decoder.
  • the process 400 is described as a series of steps or operations. It should be understood that the process 400 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 23 . Assuming that a current data stream with multiple data is using an encoder and decoder, a process 400 including the following steps is performed to entropy encode and decode data.
  • Process 400 may include:
  • step 401 the encoder acquires data to be encoded included in the current data stream.
  • the data to be encoded may be the first encoded data or the non-first encoded data among multiple data contained in the current data stream, and the embodiment of the present application does not limit the position of the to-be-encoded data in the current data stream.
  • the aforementioned step 301 reference may be made to the aforementioned step 301, and details are not described here in this embodiment of the present application.
  • Step 402 the encoder obtains the first side information.
  • the first side information is obtained by feeding multiple data into the self-attention encoding network. Taking the initial data stream a shown in FIG. 21 as an example, the data corresponding to positions a1 to a16 can be input into the self-attention encoding network to obtain the first side information.
  • the content of the first side information obtained based on multiple data is relatively comprehensive.
  • the second estimated probability distribution is subsequently estimated by using the first side information, the accuracy of the obtained second estimated probability distribution can be improved, thereby reducing the code rate in the entropy encoding process, and reducing the entropy encoding overhead.
  • the self-attention encoding network is a neural network with a self-attention mechanism (ie, including a self-attention structure). It has better feature transformation ability, and the quality of the extracted first side information is better.
  • the first estimated probability distribution is estimated by using the first side information, the accuracy of the first estimated probability distribution can be improved. Therefore, the code rate in the process of entropy encoding is reduced, and the overhead of entropy encoding is reduced.
  • the self-attention encoding network has a global receptive field, and can obtain the correlation between all the input data and the data to be encoded.
  • the correlation can be the weight of all the input data relative to the data to be encoded.
  • the self-attention encoding network After the self-attention encoding network obtains the weights of all the input data relative to the data to be encoded, it weights the corresponding data according to the weights to obtain the first side information.
  • the self-attention encoding network can weight all input data with corresponding weights to obtain the first side information. In this way, the utilization rate of data in the process of obtaining the first side information is improved.
  • the first estimated probability distribution is subsequently estimated by using the first side information, the accuracy of the obtained first estimated probability distribution can be further improved, and the code rate in the entropy encoding process can be further reduced, thereby further reducing the entropy encoding overhead.
  • the self-attention encoding network can select part of the input data according to the obtained weight, and weight the part of the data with the corresponding weight to obtain the first side information.
  • the aforementioned step 302 which will not be described in detail here in this embodiment of the present application.
  • the flexibility in the process of obtaining the first side information can be improved.
  • the utilization rate of data with higher weight in the process of obtaining the first side information can be guaranteed, and the first estimated probability distribution can be further improved when the first side information is used to estimate the first estimated probability distribution.
  • the accuracy of the obtained first estimated probability distribution further reduces the code rate in the process of entropy coding, thereby further reducing the overhead of entropy coding.
  • the structure of the self-attention encoding network can refer to the aforementioned FIG. 16 , which will not be described in detail here in the embodiment of the present application.
  • the input of the self-attention encoding network includes three tensors Q, K, and V, and Q, K, and V sequentially undergo a multi-head attention mechanism, summation and normalization operations, feedforward operations, and summation The sum and normalization operations output the first side information.
  • Q, K, and V refer to tensors of data, for example, tensors obtained by embedding and position encoding the data in the current data stream in the foregoing process.
  • Step 403 the encoder obtains a first estimated probability distribution according to the first side information estimation.
  • the first side information may be input into the probability distribution estimation network to obtain a first estimated probability distribution output by the probability distribution estimation network.
  • the probability distribution estimation network may be a single neural network, or a structure in the self-attention decoding network, which is not limited in this embodiment of the present application.
  • Figure 24 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application.
  • Figure 24 uses the initial data stream as a two-dimensional format, which needs to be flattened and self-attention
  • the decoding network performs probability distribution estimation as an example.
  • the initial data stream a includes 16 positions a1 to a16 arranged in 4 ⁇ 4, and each position corresponds to one piece of data.
  • the initial data stream a is flattened into a one-dimensional format from top to bottom and from left to right to obtain a current data stream b including 16 positions a1 to a16 arranged in sequence.
  • the self-attention coding network determines the position information of each data in the current data stream b, and combines the position information of each data with the data, based on the data combined with the position information All the data in the stream b (that is, the data corresponding to the positions a1 to a16) output the first side information.
  • the entropy encoding module uses the second estimated probability distribution to entropy encode the first side information to obtain the code stream of the first side information
  • the entropy decoding module uses the second estimated probability distribution to encode the first side information
  • Entropy decoding is performed on the code stream of the information to obtain the first side information.
  • the first side information is input to the self-attention decoding network, and the self-attention decoding network outputs the first estimated probability distribution (ie, the estimated probability distribution of the data corresponding to position a10).
  • the self-attention decoding network outputs the first estimated probability distribution (ie, the estimated probability distribution of the data corresponding to position a10).
  • step 404 the encoder performs entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain a first code stream.
  • the encoder may calculate the probability value of the data to be encoded according to the first estimated probability distribution, and then perform entropy encoding on the data to be encoded according to the probability value.
  • the first code stream may be in binary format. For this process, reference may be made to the foregoing step 304 , and details are not described here in this embodiment of the present application.
  • Step 405 the encoder sends the first code stream to the decoder.
  • Step 406 the encoder estimates and obtains a second estimated probability distribution.
  • the second estimated probability distribution may be obtained by estimating according to preset information.
  • the second estimated probability distribution is obtained by estimating the learnable model obtained through training.
  • the embodiment of the present application does not limit the manner of obtaining the second estimated probability distribution.
  • Step 407 the encoder performs entropy encoding on the first side information according to the second estimated probability distribution to obtain a second code stream.
  • the encoder may calculate the probability value of the first side information according to the second estimated probability distribution, and then perform entropy encoding on the first side information according to the probability value.
  • the second code stream may be in binary format.
  • Step 408 the encoder sends the second code stream to the decoder.
  • Step 409 the decoder estimates and obtains a second estimated probability distribution.
  • the second estimated probability distribution may be obtained by estimating according to preset information.
  • the second estimated probability distribution may be obtained by estimating the learnable model obtained through training.
  • the embodiment of the present application does not limit the manner of obtaining the second estimated probability distribution.
  • the second estimated probability distribution estimated by the decoder needs to be consistent with the second estimated probability distribution estimated by the encoder. For example, when the encoder estimates and obtains the second estimated probability distribution according to preset information, the decoder obtains the second estimated probability distribution according to the same fixed information. When the encoder estimates the second estimated probability distribution using the learnable model obtained through training, the decoder estimates the second estimated probability distribution according to the same learnable model, and the estimated second estimated probability distributions are the same.
  • Step 410 the decoder performs entropy decoding on the second code stream according to the second estimated probability distribution to obtain the decoded first side information.
  • the decoder may calculate the probability value of the second code stream according to the second estimated probability distribution, and then perform entropy decoding on the second code stream according to the probability value.
  • Step 411 the decoder estimates and obtains a first estimated probability distribution according to the decoded first side information.
  • the decoded first side information may be input into the probability distribution estimation network to obtain a first estimated probability distribution output by the probability distribution estimation network.
  • the decoded first side information may be input into the probability distribution estimation network to obtain a first estimated probability distribution output by the probability distribution estimation network.
  • Step 412 the decoder performs entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data.
  • the decoder may calculate the probability value of the first code stream according to the first estimated probability distribution, and then perform entropy decoding on the first code stream according to the probability value. For this process, reference may be made to the foregoing step 308 , and details are not described here in this embodiment of the present application.
  • the encoder obtains the data to be encoded and the first side information contained in the current data stream, and then estimates the first estimated probability distribution according to the first side information, and then obtains the first estimated probability distribution according to the first side information.
  • the first side information is obtained by inputting a plurality of data into the self-attention coding network, and the self-attention The force encoding network can weight all the input data with corresponding weights to obtain the first side information.
  • the content of the first side information obtained in this way is relatively comprehensive.
  • the first estimated probability distribution is subsequently estimated using the first side information, the accuracy of the obtained first estimated probability distribution can be improved, and the code rate in the entropy coding process can be reduced, thereby reducing the entropy coding overhead and the first code
  • the bandwidth occupancy rate when the stream is transmitted to the decoder improves the transmission efficiency of the first code stream transmitted to the decoder.
  • FIG. 25 is a flowchart of a process 500 of the entropy encoding and decoding method provided by the embodiment of the present application.
  • the process 500 can be performed by an encoder and a decoder, specifically, it can be performed by an entropy encoding unit of the encoder and an entropy decoding unit of the decoder.
  • the process 500 is described as a series of steps or operations. It should be understood that the process 500 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 25 . Assuming that a current data stream with multiple data is using an encoder and decoder, a process 500 including the following steps is performed to entropy encode and decode data.
  • Process 500 may include:
  • step 501 the encoder obtains data to be encoded, and the data to be encoded is the non-first encoded data among multiple data included in the current data stream.
  • Step 502 the encoder acquires first context information and first side information.
  • Step 503 the encoder estimates and obtains a first estimated probability distribution according to the first context information and the first side information.
  • the encoder may aggregate the first context information and the first side information, and estimate and obtain a first estimated probability distribution according to the aggregated information.
  • the encoder may aggregate the first context information and the first side information through an aggregation network.
  • the aggregation network can include a self-attention decoding network.
  • the self-attention decoding network has a self-attention mechanism, which can fully obtain the complementarity of the first context information and the first side information, and then use these two information to efficiently estimate the second An estimated probability distribution, thereby improving the accuracy of the estimated first estimated probability distribution.
  • Step 504 the encoder performs entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain a first code stream.
  • Step 505 the encoder sends the first code stream to the decoder.
  • the encoder performs entropy encoding on each non-first encoded data included in the current data stream to obtain a code stream of each non-first data. Furthermore, the current code stream is obtained according to the code stream of each non-first data. For the first coded data, its code stream can be included in the current code stream to be transmitted to the decoder. Or the encoder sends its bitstream to the decoder alone. For this process, reference may be made to the foregoing step 305 , and details are not described here in this embodiment of the present application.
  • Step 506 the encoder estimates to obtain a second estimated probability distribution.
  • Step 507 the encoder performs entropy encoding on the first side information according to the second estimated probability distribution to obtain a second code stream.
  • Step 508 the encoder sends the second code stream to the decoder.
  • the encoder can send the second code stream to the decoder alone, or add the second code stream to the first code stream and send it to the decoder. Do limited.
  • Step 509 the decoder obtains the first context information.
  • step 306 For the manner of acquiring the first context information, reference may be made to the aforementioned step 306, which will not be described in detail here in this embodiment of the present application.
  • Step 510 the decoder estimates and obtains a second estimated probability distribution.
  • the second code stream is the code stream of the first side information.
  • Step 511 the decoder performs entropy decoding on the second code stream according to the second estimated probability distribution to obtain the decoded first side information.
  • Step 512 the decoder estimates and obtains a first estimated probability distribution according to the first context information and the decoded first side information.
  • Step 513 the decoder performs entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, where the decoded data is non-first decoded data among multiple data included in the current data stream.
  • step 308 For the process of performing entropy decoding on the first code stream, reference may be made to the foregoing step 308, and details are not described here in this embodiment of the present application. It should be noted that after each piece of data is decoded, the data is added to the decoded data.
  • the encoder obtains the current data stream, the first context information and the first pass information, and then estimates the first estimated probability according to the first context information and the first side information distribution, and perform entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain the first code stream, and then send the first code stream to the decoder, and the encoder estimates the second estimated probability distribution, and according to the second estimated probability distribution, the first code stream Perform entropy encoding on one side of the information to obtain the second code stream, and send the second code stream to the decoder, the decoder estimates the second estimated probability distribution, and performs entropy decoding on the second code stream according to the second estimated probability distribution to obtain the second code stream side information, the decoder estimates the first estimated probability distribution according to the first context information and the first side information, and then performs entropy decoding on the first code stream according to the first estimated probability distribution, the first context
  • the first side information is obtained by inputting multiple data into the self-attention encoding network, and the self-attention encoding network can weight all the input data with corresponding weights to obtain the first side information. In this way, the utilization rate of encoded data in the process of acquiring the first context information is improved, and the content of the obtained first side information is more comprehensive.
  • the accuracy of the obtained first estimated probability distribution can be improved, the code rate in the entropy coding process can be further reduced, and the entropy coding overhead can be further reduced , thereby reducing the entropy encoding overhead and the bandwidth occupancy rate when the first code stream is transmitted to the decoder, and improving the transmission efficiency of the first code stream transmitted to the decoder.
  • FIG. 26 is a flowchart of a process 600 of the entropy encoding and decoding method provided by the embodiment of the present application.
  • the process 600 can be performed by an encoder and a decoder, specifically, it can be performed by an entropy encoding unit of the encoder and an entropy decoding unit of the decoder.
  • the process 600 is described as a series of steps or operations. It should be understood that the process 600 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 26 . Assuming that a current data stream with multiple data is using an encoder and a decoder, a process 600 including the following steps is performed to entropy encode and decode data.
  • Process 600 may include:
  • step 601 the encoder acquires data to be encoded, and the data to be encoded is the non-first encoded data among multiple data included in the current data stream.
  • entropy encoding is generally performed on the first data first, and then entropy encoding is performed on the data to be encoded.
  • the fourth estimated probability distribution may be obtained by estimating according to preset information.
  • the fourth estimated probability distribution is obtained by estimating the learnable model obtained through training. Or estimate and obtain the fourth estimated probability distribution according to the first side information and/or the second side information.
  • Entropy encoding is then performed on the first encoded data according to the fourth estimated probability distribution to obtain a fourth code stream.
  • the embodiment of the present application does not limit the manner of obtaining the fourth estimated probability distribution.
  • Step 602 the encoder acquires first context information, second context information, first side information and second side information.
  • step 302 For the manner of acquiring the first context information, refer to the aforementioned step 302, and for the manner of acquiring the first side information, refer to the aforementioned step 402, which will not be repeated in this embodiment of the present application.
  • the second context information is obtained by inputting at least one piece of data that meets the preset condition in the at least one coded data into a masked convolution network (Masked Convolution network).
  • the at least one piece of data that meets the preset condition may be at least one piece of data that is adjacent to the data to be encoded among the at least one encoded data of the plurality of data.
  • the encoded data is used in the process of obtaining the second context information, which can improve the accuracy of the first estimated probability distribution obtained by the subsequent estimation, thereby reducing the code rate in the process of entropy encoding and reducing the overhead of entropy encoding.
  • the first context information in the embodiment shown in FIG. 20 is obtained based on at least one coded data among the plurality of data
  • the second context information in step 602 is obtained based on the at least one coded data. Obtained from at least one piece of data adjacent to the data to be encoded.
  • the first context information is obtained based on the data corresponding to positions a1 to a9
  • the second context information is obtained based on at least one decoded data adjacent to position a10 (for example, positions a6 and The data corresponding to position a9) is obtained. That is, compared with the second context information, the first context information has a higher utilization rate of encoded data and more comprehensive content.
  • the second side information is obtained by inputting at least one data that meets the preset conditions among the multiple data into a hyperencoder network (Hyper Encoder).
  • the at least one piece of data that meets the preset condition may be at least one piece of data that is adjacent to the data to be encoded among the multiple pieces of data.
  • the first side information in the embodiment shown in FIG. 23 is obtained based on a plurality of data
  • the second side information in step 602 is based on at least one data adjacent to the data to be encoded among the plurality of data. owned.
  • the first side information is obtained based on the data corresponding to positions a1 to a16
  • the second side information is obtained based on at least one data adjacent to position a10 (such as position a6, position a9 , data corresponding to position a11 and position a14) obtained. That is, compared with the second side information, the first side information has a higher utilization rate of data and more comprehensive content.
  • Masked convolutional networks or superencoded networks have local receptive fields.
  • the masked convolutional network includes a masked convolutional layer or a regular convolutional layer, the input of which is at least one piece of data adjacent to the data to be encoded in at least one encoded data, and the output is the activation feature of the convolution output, that is, the second context information.
  • the super-encoding network includes a conventional convolutional layer, whose input is at least one data adjacent to the data to be encoded among the multiple data, and the output is the activation feature of the convolution output, that is, the second side information.
  • the way the encoder obtains the second context information through the masked convolutional network, the way the encoder obtains the second side information through the super-encoded network, and the architecture of the masked convolutional network and the super-encoded network can all refer to the self-attention in step 302 above.
  • the relevant content of the decoding network is not described here in this embodiment of the present application.
  • the first estimated probability distribution can be obtained by combining the first context information, the first side information, the second context information and the second side information, which can further improve the accuracy of the obtained first estimated probability distribution, so that Reduce the code rate in the process of entropy encoding to realize the reduction of entropy encoding overhead.
  • Step 603 the encoder estimates and obtains a first estimated probability distribution according to the first context information, the second context information, the first side information and the second side information.
  • the encoder may aggregate the first context information, the second context information, the first side information, and the second side information, and estimate and obtain a first estimated probability distribution according to the aggregated information.
  • the encoder may aggregate the first context information, the second context information, the first side information and the second side information through an aggregation network.
  • the aggregation network can include a self-attention decoding network.
  • the self-attention decoding network has a self-attention mechanism, which can fully obtain the complementarity of the first context information, the first side information, the second context information and the second side information.
  • the four pieces of information are efficiently estimated to obtain the first estimated probability distribution, thereby improving the accuracy of the estimated first estimated probability distribution.
  • FIG. 27 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application.
  • FIG. 27 takes the initial data flow shown in FIG. The sequence from bottom to bottom and from left to right is flattened into a one-dimensional format, and the current data stream b including 16 positions a1 to a16 arranged in sequence is obtained.
  • the current data stream b is fed into the super-encoding network, self-attention encoding network, self-attention decoding network and masked convolutional network respectively.
  • the super-encoding network and the self-attention encoding network output the second side information and the first side information respectively, decompose the entropy model estimation to obtain the second estimated probability distribution, and the hyper-entropy model estimation obtains the third estimated probability distribution.
  • the entropy encoding module entropy encodes the first side information according to the second estimated probability distribution, the entropy decoding module performs entropy decoding on the first side information according to the second estimated probability distribution, and inputs the entropy decoded first side information into the aggregation network.
  • the entropy encoding module entropy encodes the second side information according to the third estimated probability distribution, the entropy decoding module performs entropy decoding on the second side information according to the third estimated probability distribution, and inputs the entropy decoded second side information into the aggregation network.
  • the self-attention decoding network and the masking convolutional network output the first context information and the second context information respectively, and both the first context information and the second context information are input to the aggregation network.
  • the aggregation network aggregates the input first context information, second context information, first side information and second side information, and outputs the first estimated probability distribution (ie, the estimated probability distribution of the data corresponding to position a10).
  • the process shown in FIG. 27 is only an exemplary description, and does not limit the process of obtaining the first estimated probability distribution.
  • step 604 the encoder performs entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain a first code stream.
  • Step 605 the encoder sends the first code stream to the decoder.
  • the encoder performs entropy encoding on each non-first encoded data included in the current data stream to obtain a code stream of each non-first data. Furthermore, the current code stream is obtained according to the code stream of each non-first data. For data coded at the first bit, the fourth code stream can be included in the current code stream for transmission to the decoder. Or the encoder sends the fourth code stream to the decoder separately. For this process, reference may be made to the foregoing step 305 , and details are not described here in this embodiment of the present application.
  • Step 606 the encoder estimates and obtains a second estimated probability distribution.
  • Step 607 the encoder performs entropy encoding on the first side information according to the second estimated probability distribution to obtain a second code stream.
  • Step 608 the encoder sends the second code stream to the decoder.
  • the encoder can send the second code stream to the decoder alone, or add the second code stream to the first code stream and send it to the decoder. Do limited.
  • Step 609 the encoder estimates and obtains a third estimated probability distribution.
  • Step 610 the encoder performs entropy encoding on the second side information according to the third estimated probability distribution to obtain a third code stream.
  • Step 611 the encoder sends the third code stream to the decoder.
  • the encoder can send the third code stream to the decoder alone, or add the third code stream to the first code stream and send it to the decoder. Do limited.
  • Step 612 the decoder acquires the first context information and the second context information.
  • step 306 For the manner of acquiring the first context information, reference may be made to the aforementioned step 306, which will not be described in detail here in this embodiment of the present application.
  • the first code stream belongs to a code stream in the current code stream received by the decoder, and the decoded data after decoding is the non-first decoded data among the multiple data contained in the current code stream.
  • the second context information may be obtained by inputting at least one piece of at least one piece of decoded data that meets a preset condition into the masked convolutional network.
  • the masked convolutional network reference may be made to the foregoing step 602, which will not be described in detail here in this embodiment of the present application.
  • the decoder when it performs entropy decoding on each code stream in the received current code stream, it usually performs entropy decoding on the fourth code stream first.
  • the decoder can estimate and obtain the fourth estimated probability distribution according to preset information.
  • the fourth estimated probability distribution is obtained by estimating the learnable model obtained through training. Or estimate and obtain the fourth estimated probability distribution according to the first side information and/or the second side information. Then perform entropy decoding on the fourth code stream according to the fourth estimated probability distribution to obtain decoded first data, where the decoded first data is first decoded data among the plurality of data.
  • the fourth estimated probability distribution estimated by the decoder needs to be consistent with the fourth estimated probability distribution estimated by the encoder. For example, when the encoder estimates and obtains the fourth estimated probability distribution according to preset information, the decoder obtains the fourth estimated probability distribution according to the same fixed information. When the encoder estimates the fourth estimated probability distribution by using the learnable model obtained through training, the decoder estimates the fourth estimated probability distribution according to the same learnable model, and the estimated fourth estimated probability distribution is the same. When the encoder estimates and obtains the fourth estimated probability distribution according to the first side information and the second side information, the decoder obtains the fourth estimated probability distribution according to the first side information and the second side information.
  • Step 613 the decoder estimates and obtains a second estimated probability distribution.
  • the second estimated probability distribution estimated by the decoder needs to be consistent with the second estimated probability distribution estimated by the encoder.
  • Step 614 the decoder performs entropy decoding on the second code stream according to the second estimated probability distribution to obtain the decoded first side information.
  • Step 615 the decoder estimates and obtains a third estimated probability distribution.
  • the third estimated probability distribution estimated by the decoder needs to be consistent with the third estimated probability distribution estimated by the encoder.
  • Step 616 the decoder performs entropy decoding on the third code stream according to the third estimated probability distribution to obtain decoded second side information.
  • Step 617 the decoder estimates and obtains a first estimated probability distribution according to the first context information, the second context information, the decoded first side information and the decoded second side information.
  • Step 618 The decoder performs entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, where the decoded data is non-first decoded data among multiple data included in the current data stream.
  • step 308 For the process of performing entropy decoding on the first code stream, reference may be made to the foregoing step 308, and details are not described here in this embodiment of the present application. It should be noted that after each piece of data is decoded, the data is added to the decoded data.
  • the encoder obtains the data to be encoded, the first context information, the second context information, the first side information and the second side information contained in the current data stream, and then according to The first context information, the second context information, the first side information and the second side information are estimated to obtain the first estimated probability distribution, and the data to be encoded is entropy encoded according to the first estimated probability distribution to obtain the first code stream, and then decoded
  • the encoder sends the first code stream, the encoder estimates the second estimated probability distribution and the third estimated probability distribution, and performs entropy encoding on the first side information and the second side information according to the second estimated probability distribution and the third estimated probability distribution to obtain Obtain the second code stream and the third code stream, and send the second code stream and the third code stream to the decoder, the decoder obtains the first context information and the second context information, and estimates the second estimated probability distribution and the second estimated probability distribution respectively Three estimated probability distributions
  • steps 603 to 605, steps 606 to 608, and steps 609 to 611 can be executed at the same time.
  • Step 612 , steps 613 to 614, and steps 615 to 616 can be executed simultaneously.
  • each step of the above-mentioned method embodiments may be completed by an integrated logic circuit of hardware in a processor or instructions in the form of software.
  • the processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other possible Program logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the steps of the methods disclosed in the embodiments of the present application may be directly implemented by a hardware coded processor, or executed by a combination of hardware and software modules in the coded processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
  • the memories mentioned in the above embodiments may be volatile memories or nonvolatile memories, or may include both volatile and nonvolatile memories.
  • the non-volatile memory can be read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically programmable Erases programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory can be random access memory (RAM), which acts as external cache memory.
  • RAM random access memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • SDRAM double data rate synchronous dynamic random access memory
  • ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM direct memory bus random access memory
  • direct rambus RAM direct rambus RAM
  • the disclosed systems, devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (personal computer, server, or network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disc and other media that can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present application provides an entropy encoding and decoding method and device. The entropy encoding method in the present application comprises: obtaining data to be encoded, where the data to be encoded is non-first-bit data among multiple pieces of data contained in a current data stream; acquiring reference information, where the reference information comprises at least one of first context information and first side information, the first context information is obtained by inputting at least one piece of encoded data into a self-attention decoding network, and the first side information is obtained by inputting the plurality of pieces of data into a self-attention encoding network; obtaining a first estimated probability distribution according to the reference information; and performing entropy encoding on the data to be encoded according to the first estimated probability distribution so as to obtain a first code stream. The present application can improve the transmission efficiency of the multiple pieces of data contained in the current data stream.

Description

熵编解码方法和装置Entropy encoding and decoding method and device
本申请要求于2021年8月17日提交中国专利局、申请号为202110944357.5、申请名称为“熵编解码方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110944357.5 and the application name "entropy coding and decoding method and device" submitted to the China Patent Office on August 17, 2021, the entire contents of which are incorporated in this application by reference.
技术领域technical field
本申请实施例涉及基于人工智能(artificial intelligence,AI)的数据压缩技术领域,尤其涉及一种熵编解码方法和装置。The embodiments of the present application relate to the technical field of data compression based on artificial intelligence (AI), and in particular to an entropy encoding and decoding method and device.
背景技术Background technique
视频编码(视频编码和解码)广泛用于数字视频应用,例如广播数字电视、互联网和移动网络上的视频传输、视频聊天和视频会议等实时会话应用、数字多功能影音光盘(Digital Versatile Disc,DVD)和蓝光光盘、视频内容采集和编辑系统以及可携式摄像机的安全应用。Video encoding (video encoding and decoding) is widely used in digital video applications, such as broadcast digital TV, video transmission over the Internet and mobile networks, real-time session applications such as video chat and video conferencing, Digital Versatile Disc (DVD) ) and Blu-ray discs, video content capture and editing systems, and camcorders for security applications.
即使在影片较短的情况下也需要对大量的视频数据进行描述,当数据要在带宽容量受限的网络中发送或以其它方式传输时,这样可能会造成困难。因此,视频数据通常要先压缩然后在现代电信网络中传输。由于内存资源可能有限,当在存储设备上存储视频时,视频的大小也可能成为问题。视频压缩设备通常在信源侧使用软件和/或硬件,以在传输或存储之前对视频数据进行编码,从而减少用来表示数字视频图像所需的数据量。然后,压缩的数据在目的地侧由视频解压缩设备接收。在有限的网络资源以及对更高视频质量的需求不断增长的情况下,需要改进压缩和解压缩技术,这些改进的技术能够提高压缩率而几乎不影响图像质量。Large amounts of video data need to be described even in the case of short movies, which can cause difficulties when the data is to be sent or otherwise transmitted over a network with limited bandwidth capacity. Therefore, video data is usually compressed before being transmitted over modern telecommunications networks. Since memory resources may be limited, the size of the video may also be an issue when storing the video on a storage device. Video compression devices typically use software and/or hardware on the source side to encode video data prior to transmission or storage, thereby reducing the amount of data required to represent digital video images. The compressed data is then received by the video decompression device at the destination side. With limited network resources and growing demand for higher video quality, there is a need for improved compression and decompression techniques that can increase compression ratios with little impact on image quality.
近年来,将深度学习应用于图像或视频编解码领域逐渐成为一种趋势。相关技术采用预先设置的固定概率分布或者由训练得到的可学习模型确定概率分布,进而基于概率分布对待编/解码数据进行编/解码。但是上述方法获取的概率分布的准确性较低,导致熵编码开销较大,进而导致数据传输效率较低。In recent years, it has gradually become a trend to apply deep learning to the field of image or video coding and decoding. Related technologies use a preset fixed probability distribution or a learned model obtained through training to determine the probability distribution, and then encode/decode data to be encoded/decoded based on the probability distribution. However, the accuracy of the probability distribution obtained by the above method is low, which leads to a large overhead of entropy coding, which in turn leads to low data transmission efficiency.
发明内容Contents of the invention
本申请提供一种熵编解码方法和装置,以提高待编码数据的估计概率分布的准确性,减小熵编解码过程中的码率,从而减小熵编解码开销。The present application provides an entropy encoding and decoding method and device to improve the accuracy of the estimated probability distribution of data to be encoded, reduce the code rate in the process of entropy encoding and decoding, and thereby reduce the overhead of entropy encoding and decoding.
第一方面,本申请提供一种熵编码方法,所述方法包括:获取待编码数据,所述待编码数据是当前数据流包含的多个数据中非首位编码的数据;获取参照信息,所述参照信息至少包括第一上下文信息和第一边信息中的至少一项,所述第一上下文信息是将至少一个已编码数据输入自注意力解码网络得到的,所述第一边信息是将所述多个数据输入自注意力编码网络得到的;根据所述参照信息估计得到第一估计概率分布;根据所述第一估计概率分布对所述待编码数据进行熵编码,以得到第一码流。In a first aspect, the present application provides an entropy encoding method, the method comprising: acquiring data to be encoded, where the data to be encoded is non-first encoded data among multiple data included in the current data stream; acquiring reference information, the The reference information at least includes at least one of first context information and first side information, the first context information is obtained by inputting at least one coded data into the self-attention decoding network, and the first side information is the The plurality of data inputs are obtained from the attention coding network; a first estimated probability distribution is obtained according to the reference information estimation; entropy coding is performed on the data to be encoded according to the first estimated probability distribution to obtain a first code stream .
其中,已编码数据指的是多个数据中编码器已经进行熵编码的数据,由于当对当前数据流的首位数据进行熵编码时,还未存在已编码数据,因此待编码数据需要为当前数据流 的非首位数据,这样才能提取得到第一上下文信息。Among them, the encoded data refers to the data that has been entropy encoded by the encoder among the multiple data. Since there is no encoded data when entropy encoding is performed on the first data of the current data stream, the data to be encoded needs to be the current data The non-first data of the stream, so that the first context information can be extracted.
根据参照信息估计得到的第一估计概率分布可以包括至少一个估计概率参数。示例地,该至少一个估计概率参数可以包括均值和方差,均值和方差组成高斯分布。编码器可以根据第一估计概率分布计算待编码数据的概率值,之后根据该概率值对待编码数据进行熵编码。进行熵编码后得到的第一码流可以是二进制格式。The first estimated probability distribution estimated according to the reference information may include at least one estimated probability parameter. Exemplarily, the at least one estimated probability parameter may include a mean value and a variance, and the mean value and variance form a Gaussian distribution. The encoder may calculate the probability value of the data to be encoded according to the first estimated probability distribution, and then perform entropy encoding on the data to be encoded according to the probability value. The first code stream obtained after performing entropy coding may be in a binary format.
多个数据也可以称为多个数据单元,多个数据可以包括视频数据、图像数据、音频数据、整数型数据以及其他具有压缩/解压缩需求的数据等,本申请实施例对数据类型不做限定。其中,每个数据对应一个位置信息,待编码数据在多个数据中位于非首位。Multiple data can also be referred to as multiple data units. Multiple data can include video data, image data, audio data, integer data, and other data with compression/decompression requirements. limited. Wherein, each data corresponds to a piece of position information, and the data to be encoded is not at the first place among the multiple data.
该熵编码方法中,自注意力解码网络为具备自注意力机制(即包括自注意力结构)的神经网络,自注意力机制是注意力机制的变体,具备全局感受野,能够较好地获取数据或特征的内部相关性。自注意力解码网络可以得到输入的所有已编码数据与待编码数据的权重,之后对输入的所有或部分已编码数据利用相应的权重进行加权得到第一上下文信息。这样提高了获取第一上下文信息的过程中对已编码数据的利用率,在利用第一上下文信息估计得到第一估计概率分布时,能够提高第一估计概率分布的准确性,进一步减小熵编码过程中的码率,从而进一步减小熵编码开销。In this entropy encoding method, the self-attention decoding network is a neural network with a self-attention mechanism (that is, including a self-attention structure). The self-attention mechanism is a variant of the attention mechanism, which has a global receptive field and can better Get internal correlations of data or features. The self-attention decoding network can obtain the weights of all the input encoded data and the data to be encoded, and then weight all or part of the input encoded data with corresponding weights to obtain the first context information. This improves the utilization rate of the coded data in the process of obtaining the first context information, and when the first estimated probability distribution is estimated by using the first context information, the accuracy of the first estimated probability distribution can be improved, and the entropy coding can be further reduced. The code rate in the process can further reduce the entropy coding overhead.
自注意力编码网络具备全局感受野,可以得到输入的所有数据与待编码数据的相关性,该相关性可以为输入的所有数据相对于待编码数据的权重。自注意力编码网络在得到输入的所有数据相对于待编码数据的权重后,根据权重对相应的数据进行加权得到第一边信息。The self-attention encoding network has a global receptive field, and can obtain the correlation between all the input data and the data to be encoded. The correlation can be the weight of all the input data relative to the data to be encoded. After the self-attention encoding network obtains the weights of all the input data relative to the data to be encoded, it weights the corresponding data according to the weights to obtain the first side information.
可选地,自注意力编码网络可以对输入的所有或部分数据利用相应的权重进行加权得到第一边信息。这样,提高了获取第一边信息的过程中对数据的利用率。在后续利用第一边信息估计得到第一估计概率分布时,能够进一步提高得到的第一估计概率分布的准确性,进一步减小熵编码过程中的码率,从而进一步减小熵编码开销。Optionally, the self-attention encoding network can weight all or part of the input data with corresponding weights to obtain the first side information. In this way, the utilization rate of data in the process of obtaining the first side information is improved. When the first estimated probability distribution is subsequently estimated by using the first side information, the accuracy of the obtained first estimated probability distribution can be further improved, and the code rate in the entropy encoding process can be further reduced, thereby further reducing the entropy encoding overhead.
参照信息至少包括第一上下文信息和第一边信息中的至少一项之外,还可以包括第二上下文信息和第二边信息中的至少一种信息,因此可以包括以下几种情况:In addition to at least one of the first context information and the first side information, the reference information may also include at least one of the second context information and the second side information, so the following situations may be included:
(1)参照信息包括第一上下文信息(1) The reference information includes the first context information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。该概率分布估计网络可以为单独的一个神经网络,也可以是自注意力解码网络中的一个结构,本申请实施例对此不做限定。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network. The probability distribution estimation network may be a single neural network, or a structure in the self-attention decoding network, which is not limited in this embodiment of the present application.
(2)参照信息包括第一上下文信息和第一边信息(2) The reference information includes the first context information and the first side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息和第一边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the first side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(3)参照信息包括第一上下文信息和第二上下文信息(3) Reference information includes first context information and second context information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息和第二上下文信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the second context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(4)参照信息包括第一上下文信息、第一边信息和第二上下文信息(4) Reference information includes first context information, first side information and second context information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息、第一边信息和第二上下文信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the first side information and the second context information into the probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network .
(5)参照信息包括第一上下文信息和第二边信息(5) The reference information includes the first context information and the second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息和第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the second side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(6)参照信息包括第一上下文信息、第一边信息和第二边信息(6) The reference information includes the first context information, the first side information and the second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息、第一边信息和第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the first side information and the second side information into the probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network .
(7)参照信息包括第一上下文信息、第二上下文信息和第二边信息(7) Reference information includes first context information, second context information and second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息、第二上下文信息和第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the second context information and the second side information into the probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network .
(8)参照信息包括第一上下文信息、第一边信息、第二上下文信息和第二边信息(8) The reference information includes the first context information, the first side information, the second context information and the second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息、第一边信息、第二上下文信息和第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the first side information, the second context information and the second side information into the probability distribution estimation network to obtain the output of the probability distribution estimation network The first estimated probability distribution.
(9)参照信息包括第一边信息(9) The reference information includes the first side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(10)参照信息包括第一边信息和上下文信息(10) Reference information includes first side information and context information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一边信息和上下文信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first side information and the context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(11)参照信息包括第一边信息和第二边信息(11) The reference information includes the first side information and the second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一边信息和第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first side information and the second side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(12)参照信息包括第一边信息、上下文信息和第二边信息(12) Reference information includes first side information, context information and second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一边信息、上下文信息和第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first side information, the context information and the second side information into the probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
当参照信息包括第一边信息时,所述方法还包括:估计得到第二估计概率分布;根据所述第二估计概率分布对所述第一边信息进行熵编码以得到第二码流。When the reference information includes the first side information, the method further includes: estimating to obtain a second estimated probability distribution; performing entropy encoding on the first side information according to the second estimated probability distribution to obtain a second code stream.
可选地,可以根据预先设置信息估计得到第二估计概率分布。或者利用训练得到的可学习模型估计得到第二估计概率分布。之后根据第二估计概率分布计算第一边信息的概率值,并根据该概率值对第一边信息进行熵编码。Optionally, the second estimated probability distribution may be obtained by estimating according to preset information. Alternatively, the second estimated probability distribution may be obtained by estimating the learnable model obtained through training. Then calculate the probability value of the first side information according to the second estimated probability distribution, and perform entropy encoding on the first side information according to the probability value.
可选地,可以将第二码流单独发送至解码侧,也可以将第二码流添加在第一码流中发送至解码侧,本申请实施例对第二码流的发送方式不做限定。Optionally, the second code stream can be sent to the decoding side alone, or the second code stream can be added to the first code stream and sent to the decoding side. The embodiment of the present application does not limit the sending method of the second code stream .
在一种可能的实现方式中,所述参照信息还包括第二上下文信息,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络(Masked Convolution Network)得到的。遮掩卷积网络包括掩膜卷积层或常规卷积层。In a possible implementation manner, the reference information further includes second context information, and the second context information is inputting at least one data that meets a preset condition in the at least one coded data into a masked convolutional network ( Masked Convolution Network) obtained. Masked ConvNets consist of masked convolutional layers or regular convolutional layers.
示例地,符合预设条件的至少一个数据可以是至少一个已编码数据中与待编码数据近 邻的至少一个数据。对于一维数据,与待编码数据近邻可以是待编码数据的前m位已编码数据,m>0。对于二维数据,与待编码数据近邻可以是待编码数据的相邻数据,或者是待编码数据的外围n圈数据中的已编码数据等,n>0,本申请实施例对近邻不做限定。Exemplarily, the at least one piece of data that meets the preset condition may be at least one piece of data that is adjacent to the data to be encoded in the at least one piece of encoded data. For one-dimensional data, the neighbors of the data to be coded may be the coded data of the first m bits of the data to be coded, m>0. For two-dimensional data, the neighbors of the data to be encoded can be the adjacent data of the data to be encoded, or the encoded data in the peripheral n circle data of the data to be encoded, etc., n>0, the embodiment of the present application does not limit the neighbors .
在获取第二上下文信息的过程中利用到了已编码数据,能够提高第一估计概率分布的准确性,从而减小熵编码过程中的码率,实现减小熵编码开销。The coded data is utilized in the process of acquiring the second context information, which can improve the accuracy of the first estimated probability distribution, thereby reducing the code rate in the process of entropy coding and reducing the overhead of entropy coding.
遮掩卷积网络具备局部感受野,其包括掩膜卷积层或常规卷积层。遮掩卷积网络的输入为至少一个已编码数据中与待编码数据近邻的至少一个数据,输出为卷积输出的激活特征,即第二上下文信息。Masked convolutional networks have local receptive fields, which include masked convolutional layers or regular convolutional layers. The input of the masking convolutional network is at least one data adjacent to the data to be encoded in the at least one encoded data, and the output is the activation feature of the convolution output, that is, the second context information.
在一种可能的实现方式中,所述参照信息还包括第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络(Hyper Encoder Network)得到的;所述方法还包括:估计得到第三估计概率分布;根据所述第三估计概率分布对所述第二边信息进行熵编码以得到第三码流。In a possible implementation manner, the reference information further includes second side information, and the second side information is inputting at least one data meeting a preset condition among the plurality of data into a Hyper Encoder Network (Hyper Encoder Network) ) obtained; the method further includes: estimating and obtaining a third estimated probability distribution; performing entropy encoding on the second side information according to the third estimated probability distribution to obtain a third code stream.
示例地,符合预设条件的至少一个数据可以是多个数据中与待编码数据近邻的至少一个数据。对于一维数据,与待编码数据近邻可以是待编码数据的前m1位和/或后m2位数据,m1,m2>0。对于二维数据,与待编码数据近邻可以是待编码数据的相邻数据,或者是待编码数据的外围n圈的数据等,n>0。Exemplarily, the at least one piece of data that meets the preset condition may be at least one piece of data that is adjacent to the data to be encoded among the multiple pieces of data. For one-dimensional data, the neighbors to the data to be encoded may be the first m1 bits and/or the last m2 bits of the data to be encoded, m1, m2>0. For two-dimensional data, the adjacent data to the data to be coded may be adjacent data to the data to be coded, or the data of the outer n circles of the data to be coded, etc., n>0.
遮掩卷积网络具备局部感受野,其包括常规卷积层,遮掩卷积网络的输入为多个数据中与待编码数据近邻的至少一个数据,输出为卷积输出的激活特征,即第二边信息。The masked convolutional network has a local receptive field, which includes a conventional convolutional layer. The input of the masked convolutional network is at least one data that is adjacent to the data to be encoded among multiple data, and the output is the activation feature of the convolution output, that is, the second side information.
可选地,可以将第三码流单独发送至解码侧,也可以将第三码流添加在第一码流中发送至解码侧,本申请实施例对第三码流的发送方式不做限定。Optionally, the third code stream can be sent to the decoding side alone, or the third code stream can be added to the first code stream and sent to the decoding side. The embodiment of the present application does not limit the sending method of the third code stream .
在一种可能的实现方式中,所述方法还包括:获取所述多个数据中首位编码的数据;根据预先设置信息估计得到第四估计概率分布;根据所述第四估计概率分布对所述首位编码的数据进行熵编码以得到第四码流。In a possible implementation manner, the method further includes: acquiring the first coded data among the plurality of data; estimating and obtaining a fourth estimated probability distribution according to preset information; Entropy encoding is performed on the encoded data of the first bit to obtain a fourth code stream.
对于首位编码的数据,可以根据预先设置信息估计得到第四估计概率分布。或者利用训练得到的可学习模型估计得到第四估计概率分布,本申请实施例对得到第四估计概率分布的方式不做限定。For the first encoded data, the fourth estimated probability distribution may be obtained by estimating according to preset information. Alternatively, the learnable model obtained through training is used to estimate and obtain the fourth estimated probability distribution. The embodiment of the present application does not limit the manner of obtaining the fourth estimated probability distribution.
本申请中,自注意力编码网络例如可以采用变换编码器(Transformer Encoder),自注意力解码网络例如可以采用变换解码器(Transformer Decoder)。第一码流可以是指第一编码比特流(first encoded bitstream),第二码流可以是指第二编码比特流(second encoded bitstream),第三码流可以是指第三编码比特流(third encoded bitstream),第四码流可以是指第四编码比特流(fouth encoded bitstream)。In this application, the self-attention encoding network can use, for example, a Transformer Encoder, and the self-attention decoding network, for example, can use a Transformer Decoder. The first code stream may refer to the first coded bit stream (first encoded bitstream), the second code stream may refer to the second coded bit stream (second encoded bitstream), and the third code stream may refer to the third coded bit stream (third encoded bitstream), the fourth bitstream may refer to the fourth encoded bitstream (fouth encoded bitstream).
第二方面,本申请提供一种熵解码方法,所述方法包括:获取第一码流;获取参照信息,所述参照信息至少包括第一上下文信息和经解码第一边信息中的至少一项,所述第一上下文信息是将至少一个已解码数据输入自注意力解码网络得到的,所述经解码第一边信息是对第二码流进行熵解码得到的;根据所述参照信息估计得到第一估计概率分布;根据所述第一估计概率分布对所述第一码流进行熵解码以得到经解码数据,所述经解码数据为当前数据流包含的多个数据中非首位解码的数据。In a second aspect, the present application provides an entropy decoding method, the method comprising: obtaining a first code stream; obtaining reference information, the reference information at least including at least one of the first context information and the decoded first side information , the first context information is obtained by inputting at least one decoded data into the self-attention decoding network, and the decoded first side information is obtained by entropy decoding the second code stream; it is obtained according to the estimation of the reference information A first estimated probability distribution; performing entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, where the decoded data is non-first decoded data among multiple data included in the current data stream .
该熵解码方法中,接收到的第一码流是根据第一估计概率分布对待编码数据进行熵编码得到的,该第一估计概率分布是基于参照信息得到的,参照信息可以包括第一上下文信 息和经解码第一边信息中的至少一项,自注意力解码网络可以对输入的所有已编码数据利用相应的权重进行加权得到第一上下文信息。这样,提高了获取第一上下文信息的过程中对已编码数据的利用率。在利用第一上下文信息估计得到第一估计概率分布时,能够提高得到的第一估计概率分布的准确性,减小熵编码过程中的码率,从而减小了第一码流传输至解码侧时的带宽占用率,提高了第一码流传输至解码侧的传输效率。In the entropy decoding method, the received first code stream is obtained by performing entropy encoding on the data to be encoded according to a first estimated probability distribution, and the first estimated probability distribution is obtained based on reference information, and the reference information may include first context information and at least one item of the decoded first side information, the self-attention decoding network can weight all the input encoded data with corresponding weights to obtain the first context information. In this way, the utilization rate of encoded data in the process of acquiring the first context information is improved. When the first estimated probability distribution is estimated by using the first context information, the accuracy of the obtained first estimated probability distribution can be improved, and the code rate in the entropy encoding process can be reduced, thereby reducing the transmission of the first code stream to the decoding side. The bandwidth occupancy rate at that time improves the transmission efficiency of the first code stream to the decoding side.
在一种可能的实现方式中,所述获取参照信息,还包括:获取第二码流;估计得到第二估计概率分布;根据所述第二估计概率分布对所述第二码流进行熵解码以得到经解码第一边信息,相应的,所述参照信息还包括所述经解码第一边信息。In a possible implementation manner, the acquiring reference information further includes: acquiring a second code stream; estimating to obtain a second estimated probability distribution; performing entropy decoding on the second code stream according to the second estimated probability distribution To obtain the decoded first side information, correspondingly, the reference information further includes the decoded first side information.
需要说明的是,解码侧估计得到的第二估计概率分布需要与编码侧估计得到的第二估计概率分布一致。It should be noted that the second estimated probability distribution estimated by the decoding side needs to be consistent with the second estimated probability distribution estimated by the encoding side.
参照信息至少包括第一上下文信息和经解码第一边信息中的至少一项之外,还可以包括第二上下文信息和经解码第二边信息中的至少一种信息,因此可以包括以下几种情况:In addition to at least one of the first context information and the decoded first side information, the reference information may also include at least one of the second context information and the decoded second side information, so it may include the following Condition:
(1)参照信息包括第一上下文信息(1) The reference information includes the first context information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(2)参照信息包括第一上下文信息和经解码第一边信息(2) The reference information includes the first context information and the decoded first side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息和经解码第一边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the decoded first side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(3)参照信息包括第一上下文信息和第二上下文信息(3) Reference information includes first context information and second context information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息和第二上下文信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the second context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(4)参照信息包括第一上下文信息、经解码第一边信息和第二上下文信息(4) The reference information includes the first context information, the decoded first side information and the second context information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息、经解码第一边信息和第二上下文信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the decoded first side information and the second context information into the probability distribution estimation network, so as to obtain the first estimation output by the probability distribution estimation network Probability distributions.
(5)参照信息包括第一上下文信息和经解码第二边信息(5) The reference information includes the first context information and the decoded second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息和经解码第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information and the decoded second side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(6)参照信息包括第一上下文信息、经解码第一边信息和经解码第二边信息(6) The reference information includes the first context information, the decoded first side information and the decoded second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息、经解码第一边信息和经解码第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the decoded first side information and the decoded second side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network. An estimated probability distribution.
(7)参照信息包括第一上下文信息、第二上下文信息和经解码第二边信息(7) The reference information includes the first context information, the second context information and the decoded second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息、第二上下文信息和经解码第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the second context information and the decoded second side information into the probability distribution estimation network, so as to obtain the first estimation output by the probability distribution estimation network Probability distributions.
(8)参照信息包括第一上下文信息、经解码第一边信息、第二上下文信息和经解码 第二边信息(8) The reference information includes the first context information, the decoded first side information, the second context information and the decoded second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将第一上下文信息、经解码第一边信息、第二上下文信息和经解码第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the first context information, the decoded first side information, the second context information and the decoded second side information into the probability distribution estimation network to obtain the probability distribution Estimate a first estimated probability distribution for the output of the network.
(9)参照信息包括经解码第一边信息(9) The reference information includes the decoded first side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将经解码第一边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the decoded first side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(10)参照信息包括经解码第一边信息和上下文信息(10) The reference information includes the decoded first side information and context information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将经解码第一边信息和上下文信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the decoded first side information and context information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(11)参照信息包括经解码第一边信息和经解码第二边信息(11) The reference information includes the decoded first side information and the decoded second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将经解码第一边信息和经解码第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the decoded first side information and the decoded second side information into the probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
(12)参照信息包括经解码第一边信息、上下文信息和经解码第二边信息(12) The reference information includes decoded first side information, context information and decoded second side information
相应的,根据参照信息估计得到第一估计概率分布可以包括:将经解码第一边信息、上下文信息和经解码第二边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。Correspondingly, estimating and obtaining the first estimated probability distribution according to the reference information may include: inputting the decoded first side information, the context information and the decoded second side information into the probability distribution estimation network to obtain the first estimate output by the probability distribution estimation network Probability distributions.
在一种可能的实现方式中,所述参照信息还包括第二上下文信息,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的。In a possible implementation manner, the reference information further includes second context information, and the second context information is obtained by inputting at least one piece of data that meets preset conditions in the at least one piece of decoded data into a masked convolutional network. of.
在一种可能的实现方式中,所述获取参照信息,还包括:获取第三码流;估计得到第三估计概率分布;根据所述第三估计概率分布对所述第三码流进行熵解码以得到经解码第二边信息,相应的,所述参照信息还包括所述经解码第二边信息。In a possible implementation manner, the acquiring reference information further includes: acquiring a third code stream; estimating to obtain a third estimated probability distribution; performing entropy decoding on the third code stream according to the third estimated probability distribution To obtain the decoded second side information, correspondingly, the reference information further includes the decoded second side information.
需要说明的是,解码侧估计得到的第三估计概率分布需要与编码侧估计得到的第三估计概率分布一致。It should be noted that the third estimated probability distribution estimated by the decoding side needs to be consistent with the third estimated probability distribution estimated by the encoding side.
在一种可能的实现方式中,所述方法还包括:获取第四码流;根据预先设置信息估计得到第四估计概率分布;根据所述第四估计概率分布对所述第四码流进行熵解码以得到经解码首位数据,所述经解码首位数据是所述多个数据中首位解码的数据。In a possible implementation manner, the method further includes: acquiring a fourth code stream; estimating and obtaining a fourth estimated probability distribution according to preset information; performing entropy on the fourth code stream according to the fourth estimated probability distribution decoding to obtain decoded leading data, the decoded leading data being the first decoded data among the plurality of data.
需要说明的是,解码侧估计得到的第四估计概率分布需要与编码侧估计得到的第四估计概率分布一致。It should be noted that the fourth estimated probability distribution estimated by the decoding side needs to be consistent with the fourth estimated probability distribution estimated by the encoding side.
第三方面,本申请提供一种熵编码装置,所述装置包括:获取模块,用于获取待编码数据,所述待编码数据是当前数据流包含的多个数据中非首位编码的数据;获取参照信息,所述参照信息至少包括第一上下文信息和第一边信息中的至少一项,所述第一上下文信息是将至少一个已编码数据输入自注意力解码网络得到的,所述第一边信息是将所述多个数据输入自注意力编码网络得到的;估计模块,用于根据所述参照信息估计得到第一估计概率分布;编码模块,用于根据所述第一估计概率分布对所述待编码数据进行熵编码,以得到第一码流。In a third aspect, the present application provides an entropy coding device, which includes: an acquisition module, configured to acquire data to be encoded, where the data to be encoded is non-first encoded data among multiple data included in the current data stream; Reference information, the reference information includes at least one of first context information and first side information, the first context information is obtained by inputting at least one coded data into a self-attention decoding network, the first The side information is obtained by inputting the plurality of data into the self-attention coding network; the estimation module is used to estimate and obtain the first estimated probability distribution according to the reference information; the coding module is used to pair the first estimated probability distribution according to the first estimated probability distribution Entropy encoding is performed on the data to be encoded to obtain a first code stream.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息和所述第一边 信息;所述估计模块,具体用于将所述第一上下文信息和所述第一边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information and the first side information; the estimation module is specifically configured to combine the first context information and the first side information Information is input into a probability distribution estimation network to obtain said first estimated probability distribution output by said probability distribution estimation network.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息和第二上下文信息,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述第一上下文信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information and second context information, and the second context information is at least one of the at least one coded data that meets a preset condition. Obtained by inputting data into a concealed convolutional network; the estimation module is specifically configured to input the first context information and the second context information into a probability distribution estimation network, so as to obtain the first output of the probability distribution estimation network An estimated probability distribution.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息、所述第一边信息和第二上下文信息,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述第一上下文信息、所述第一边信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information, the first side information, and second context information, and the second context information is the At least one data that meets the preset conditions is obtained by inputting a masked convolutional network; the estimation module is specifically configured to input the first context information, the first side information, and the second context information into a probability distribution estimation network , to obtain the first estimated probability distribution output by the probability distribution estimation network.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的;所述估计模块,具体用于将所述第一上下文信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information and second side information, and the second side information is input of at least one data meeting a preset condition among the plurality of data Obtained by a supercoding network; the estimation module is specifically configured to input the first context information and the second side information into a probability distribution estimation network, so as to obtain the first estimated probability output by the probability distribution estimation network distributed.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息、所述第一边信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的;所述估计模块,具体用于将所述第一上下文信息、所述第一边信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information, the first side information, and the second side information, and the second side information is the It is obtained by inputting at least one conditional data into a supercoding network; the estimation module is specifically configured to input the first context information, the first side information and the second side information into a probability distribution estimation network to obtain The probability distribution estimation network outputs the first estimated probability distribution.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息、第二上下文信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述第一上下文信息、所述第二上下文信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information, the second context information, and the second side information, and the second side information is the data that meets the preset condition in the plurality of data At least one data input into the super-encoded network is obtained, and the second context information is obtained by inputting at least one data that meets the preset conditions in the at least one encoded data into the masked convolutional network; the estimation module is specifically used inputting the first context information, the second context information and the second side information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息、所述第一边信息、第二上下文信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述第一上下文信息、所述第一边信息、所述第二上下文信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information, the first side information, the second context information, and the second side information, and the second side information is a combination of the multiple The second context information is obtained by inputting at least one data that meets the preset conditions into the super-encoding network among the data, and the second context information is obtained by inputting at least one data that meets the preset conditions among the at least one encoded data into the masked convolutional network; The estimation module is specifically configured to input the first context information, the first side information, the second context information and the second side information into a probability distribution estimation network, so as to obtain the probability distribution estimation network Output the first estimated probability distribution.
在一种可能的实现方式中,所述参照信息具体包括所述第一边信息和第二上下文信息,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述第一边信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first side information and second context information, and the second context information is at least one of the at least one coded data that meets a preset condition. Obtained by inputting data into a masked convolutional network; the estimation module is specifically configured to input the first side information and the second context information into a probability distribution estimation network, so as to obtain the first output of the probability distribution estimation network An estimated probability distribution.
在一种可能的实现方式中,所述参照信息具体包括所述第一边信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的; 所述估计模块,具体用于将所述第一边信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first side information and the second side information, and the second side information is to input at least one data meeting a preset condition among the plurality of data into Obtained by a supercoding network; the estimation module is specifically configured to input the first side information and the second side information into a probability distribution estimation network, so as to obtain the first estimated probability output by the probability distribution estimation network distributed.
在一种可能的实现方式中,所述参照信息具体包括所述第一边信息、第二上下文信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述第一边信息、所述第二上下文信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first side information, the second context information, and the second side information, and the second side information is the data that meets the preset condition in the plurality of data At least one data input into the super-encoded network is obtained, and the second context information is obtained by inputting at least one data that meets the preset conditions in the at least one encoded data into the masked convolutional network; the estimation module is specifically used inputting the first side information, the second context information and the second side information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
在一种可能的实现方式中,所述估计模块,还用于估计得到第二估计概率分布;所述编码模块,还用于根据所述第二估计概率分布对所述第一边信息进行熵编码以得到第二码流。In a possible implementation manner, the estimation module is further configured to estimate and obtain a second estimated probability distribution; the encoding module is further configured to perform entropy on the first side information according to the second estimated probability distribution Encode to obtain the second code stream.
在一种可能的实现方式中,所述估计模块,还用于估计得到所述第三估计概率分布;所述编码模块,还用于根据所述第三估计概率分布对所述第二边信息进行熵编码以得到第三码流。In a possible implementation manner, the estimating module is further configured to estimate and obtain the third estimated probability distribution; the encoding module is further configured to process the second side information according to the third estimated probability distribution Entropy coding is performed to obtain a third code stream.
在一种可能的实现方式中,所述获取模块,还用于获取所述多个数据中首位编码的数据;所述估计模块,还用于根据预先设置信息估计得到第四估计概率分布;所述编码模块,还用于根据所述第四估计概率分布对所述首位编码的数据进行熵编码以得到第四码流。In a possible implementation manner, the acquiring module is further configured to acquire the first coded data among the plurality of data; the estimating module is further configured to estimate and obtain a fourth estimated probability distribution according to preset information; The encoding module is further configured to perform entropy encoding on the first encoded data according to the fourth estimated probability distribution to obtain a fourth code stream.
第四方面,本申请提供一种熵解码装置,所述装置包括:获取模块,用于获取第一码流;获取参照信息,所述参照信息至少包括第一上下文信息和经解码第一边信息中的至少一项,所述第一上下文信息是将至少一个已解码数据输入自注意力解码网络得到的,所述经解码第一边信息是对第二码流进行熵解码得到的;估计模块,用于根据所述参照信息估计得到第一估计概率分布;解码模块,用于根据所述第一估计概率分布对所述第一码流进行熵解码以得到经解码数据,所述经解码数据为当前数据流包含的多个数据中非首位解码的数据。In a fourth aspect, the present application provides an entropy decoding device, the device comprising: an acquisition module, configured to acquire a first code stream; and acquire reference information, where the reference information includes at least first context information and decoded first side information At least one of the above, the first context information is obtained by inputting at least one decoded data into the self-attention decoding network, and the decoded first side information is obtained by entropy decoding the second code stream; the estimation module , for estimating and obtaining a first estimated probability distribution according to the reference information; a decoding module, for performing entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, the decoded data The non-first decoded data among the multiple data contained in the current data stream.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息和所述经解码第一边信息;所述估计模块,具体用于将所述第一上下文信息和所述经解码第一边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information and the decoded first side information; the estimation module is specifically configured to combine the first context information and the decoded first side information Decoding the first side information is input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息和第二上下文信息,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述第一上下文信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information and second context information, and the second context information is at least one of the at least one decoded data that meets a preset condition. Obtained by inputting data into a concealed convolutional network; the estimation module is specifically configured to input the first context information and the second context information into a probability distribution estimation network, so as to obtain the first output of the probability distribution estimation network An estimated probability distribution.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息、所述经解码第一边信息和第二上下文信息,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述第一上下文信息、所述经解码第一边信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information, the decoded first side information, and second context information, and the second context information is the at least one decoded At least one data that meets the preset conditions is obtained by inputting a masked convolutional network; the estimation module is specifically configured to input the first context information, the decoded first side information, and the second context information a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的;所述估计模块,具体用 于将所述第一上下文信息和所述经解码第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information and decoded second side information, where the decoded second side information is obtained by performing entropy decoding on the third code stream; The estimation module is specifically configured to input the first context information and the decoded second side information into a probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息、所述经解码第一边信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的;所述估计模块,具体用于将所述第一上下文信息、所述经解码第一边信息和所述经解码第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information, the decoded first side information, and the decoded second side information, and the decoded second side information is for the third The code stream is obtained by performing entropy decoding; the estimation module is specifically configured to input the first context information, the decoded first side information and the decoded second side information into a probability distribution estimation network, so as to obtain the The probability distribution estimation network outputs the first estimated probability distribution.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息、第二上下文信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述第一上下文信息、所述第二上下文信息和所述经解码第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information, the second context information, and the decoded second side information, and the decoded second side information is an entropy analysis performed on the third code stream. The second context information is obtained by decoding, and the second context information is obtained by inputting at least one data that meets preset conditions in the at least one decoded data into a masked convolutional network; the estimation module is specifically used to use the first context information, the second context information and the decoded second side information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
在一种可能的实现方式中,所述参照信息具体包括所述第一上下文信息、所述经解码第一边信息、第二上下文信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述第一上下文信息、所述经解码第一边信息、所述第二上下文信息和所述经解码第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the first context information, the decoded first side information, the second context information, and the decoded second side information, and the decoded second side information The information is obtained by performing entropy decoding on the third code stream, and the second context information is obtained by inputting at least one piece of data that meets a preset condition in the at least one piece of decoded data into a masked convolutional network; the estimation module, Specifically for inputting the first context information, the decoded first side information, the second context information and the decoded second side information into a probability distribution estimation network, so as to obtain an output of the probability distribution estimation network The first estimated probability distribution of .
在一种可能的实现方式中,所述参照信息具体包括所述经解码第一边信息和第二上下文信息,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述经解码第一边信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the decoded first side information and second context information, and the second context information is an At least one data input is obtained by a masked convolutional network; the estimation module is specifically configured to input the decoded first side information and the second context information into a probability distribution estimation network to obtain an output of the probability distribution estimation network The first estimated probability distribution of .
在一种可能的实现方式中,所述参照信息具体包括所述经解码第一边信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的;所述估计模块,具体用于将所述经解码第一边信息和所述经解码第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the decoded first side information and the decoded second side information, and the decoded second side information is obtained by performing entropy decoding on the third code stream The estimation module is specifically configured to input the decoded first side information and the decoded second side information into a probability distribution estimation network, so as to obtain the first estimated probability distribution output by the probability distribution estimation network .
在一种可能的实现方式中,所述参照信息具体包括所述经解码第一边信息、第二上下文信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;所述估计模块,具体用于将所述经解码第一边信息、所述第二上下文信息和所述经解码第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。In a possible implementation manner, the reference information specifically includes the decoded first side information, the second context information, and the decoded second side information, and the decoded second side information is a reference to the third code stream Obtained by performing entropy decoding, the second context information is obtained by inputting at least one data that meets preset conditions in the at least one decoded data into a masked convolutional network; the estimation module is specifically configured to use the Decoding the first side information, the second context information and the decoded second side information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
在一种可能的实现方式中,当所述参照信息包括所述经解码第一边信息时,所述获取模块,还用于获取所述第二码流;所述估计模块,还用于估计得到第二估计概率分布;所述解密模块,还用于根据所述第二估计概率分布对所述第二码流进行熵解码以得到所述经解码第一边信息。In a possible implementation manner, when the reference information includes the decoded first side information, the acquiring module is further configured to acquire the second code stream; the estimating module is further configured to estimate obtain a second estimated probability distribution; the decryption module is further configured to perform entropy decoding on the second code stream according to the second estimated probability distribution to obtain the decoded first side information.
在一种可能的实现方式中,当所述参照信息包括所述经解码第二边信息时,所述获取 模块,还用于获取所述第三码流;所述估计模块,还用于估计得到第三估计概率分布;所述解码模块,还用于根据所述第三估计概率分布对所述第三码流进行熵解码以得到所述经解码第二边信息。In a possible implementation manner, when the reference information includes the decoded second side information, the acquiring module is further configured to acquire the third code stream; the estimating module is further configured to estimate obtaining a third estimated probability distribution; the decoding module is further configured to perform entropy decoding on the third code stream according to the third estimated probability distribution to obtain the decoded second side information.
在一种可能的实现方式中,所述获取模块,还用于获取第四码流;所述估计模块,还用于根据预先设置信息估计得到第四估计概率分布;所述解码模块,还用于根据所述第四估计概率分布对所述第四码流进行熵解码以得到经解码首位数据,所述经解码首位数据是所述多个数据中首位解码的数据。In a possible implementation manner, the acquiring module is further configured to acquire a fourth code stream; the estimating module is further configured to estimate and obtain a fourth estimated probability distribution according to preset information; the decoding module is further configured to use performing entropy decoding on the fourth code stream according to the fourth estimated probability distribution to obtain decoded first data, where the decoded first data is first decoded data among the plurality of data.
第五方面,本申请提供一种熵编码设备,包括:一个或多个处理器;存储器,用于存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现上述第一方面中任一项所述的方法。In a fifth aspect, the present application provides an entropy encoding device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors Executing, so that the one or more processors implement the method described in any one of the above first aspects.
第六方面,本申请提供一种熵解码设备,包括:一个或多个处理器;存储器,用于存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现上述第二方面中任一项所述的方法。In a sixth aspect, the present application provides an entropy decoding device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors Execute, so that the one or more processors implement the method described in any one of the above second aspects.
第七方面,本申请提供一种计算机可读存储介质,包括计算机程序,所述计算机程序在计算机上被执行时,使得所述计算机执行上述第一至二方面中任一项所述的方法。In a seventh aspect, the present application provides a computer-readable storage medium, including a computer program. When the computer program is executed on a computer, the computer executes the method described in any one of the first to second aspects above.
第八方面,本申请提供一种计算机程序产品,所述计算机程序产品包括计算机程序代码,当所述计算机程序代码在计算机上运行时,使得计算机执行上述第一至二方面中任一项所述的方法。In an eighth aspect, the present application provides a computer program product, the computer program product includes computer program code, and when the computer program code is run on a computer, it causes the computer to execute any one of the above-mentioned first to second aspects. Methods.
附图说明Description of drawings
图1为本申请实施例提供的译码系统10的一种示例性框图;FIG. 1 is an exemplary block diagram of a decoding system 10 provided in an embodiment of the present application;
图2为本申请实施例提供的视频编码器的一种示例性框图;FIG. 2 is an exemplary block diagram of a video encoder provided in an embodiment of the present application;
图3为本申请实施例提供的视频解码器的一种示例性框图;FIG. 3 is an exemplary block diagram of a video decoder provided in an embodiment of the present application;
图4为本申请实施例提供的候选图像块的一种示例性的示意图;FIG. 4 is an exemplary schematic diagram of a candidate image block provided by an embodiment of the present application;
图5为本申请实施例提供的一个应用场景的示意图;FIG. 5 is a schematic diagram of an application scenario provided by an embodiment of the present application;
图6本申请实施例提供的另一个应用场景的示意图;FIG. 6 is a schematic diagram of another application scenario provided by the embodiment of the present application;
图7为本申请实施例提供的一种端到端编解码架构中编码器的结构示意图;FIG. 7 is a schematic structural diagram of an encoder in an end-to-end encoding and decoding architecture provided by an embodiment of the present application;
图8为本申请实施例提供的一种端到端编解码架构中解码器的结构示意图;FIG. 8 is a schematic structural diagram of a decoder in an end-to-end codec architecture provided by an embodiment of the present application;
图9为本申请实施例提供的一种编码器的结构示意图;FIG. 9 is a schematic structural diagram of an encoder provided in an embodiment of the present application;
图10为本申请实施例提供的一种解码器的结构示意图;FIG. 10 is a schematic structural diagram of a decoder provided in an embodiment of the present application;
图11为本申请实施例提供的一种编码器的结构示意图;FIG. 11 is a schematic structural diagram of an encoder provided in an embodiment of the present application;
图12为本申请实施例提供的一种解码器的结构示意图;FIG. 12 is a schematic structural diagram of a decoder provided in an embodiment of the present application;
图13为本申请实施例提供的一种编码器的结构示意图;FIG. 13 is a schematic structural diagram of an encoder provided in an embodiment of the present application;
图14为本申请实施例提供的一种解码器的结构示意图;FIG. 14 is a schematic structural diagram of a decoder provided in an embodiment of the present application;
图15为本申请实施例提供的一种自注意力结构示意图;FIG. 15 is a schematic diagram of a self-attention structure provided by the embodiment of the present application;
图16为本申请实施例提供的一种自注意力编码网络的结构示意图;FIG. 16 is a schematic structural diagram of a self-attention encoding network provided by an embodiment of the present application;
图17为本申请实施例提供的一种自注意力解码网络的结构示意图;FIG. 17 is a schematic structural diagram of a self-attention decoding network provided by an embodiment of the present application;
图18为本申请实施例提供的熵编码方法的过程100的流程图;FIG. 18 is a flowchart of a process 100 of the entropy encoding method provided by the embodiment of the present application;
图19为本申请实施例提供的熵解码方法的过程200的流程图;FIG. 19 is a flow chart of the process 200 of the entropy decoding method provided by the embodiment of the present application;
图20为本申请实施例提供的熵编解码方法的过程300的流程图;FIG. 20 is a flowchart of a process 300 of the entropy encoding and decoding method provided by the embodiment of the present application;
图21为本申请实施例提供的得到第一估计概率分布的过程的一种示意图;Fig. 21 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application;
图22为本申请实施例提供的熵编码性能的一种示意图;Fig. 22 is a schematic diagram of entropy coding performance provided by the embodiment of the present application;
图23为本申请实施例提供的熵编解码方法的过程400的流程图;FIG. 23 is a flow chart of the process 400 of the entropy encoding and decoding method provided by the embodiment of the present application;
图24为本申请实施例提供的得到第一估计概率分布的过程的一种示意图;Fig. 24 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application;
图25为本申请实施例提供的熵编解码方法的过程500的流程图;FIG. 25 is a flowchart of a process 500 of the entropy encoding and decoding method provided by the embodiment of the present application;
图26为本申请实施例提供的熵编解码方法的过程600的流程图;FIG. 26 is a flow chart of the process 600 of the entropy encoding and decoding method provided by the embodiment of the present application;
图27为本申请实施例提供的得到第一估计概率分布的过程的一种示意图。Fig. 27 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application.
具体实施方式Detailed ways
本申请实施例提供一种基于AI的数据压缩/解压缩技术,尤其是提供一种基于神经网络的数据压缩/解压缩技术,具体提供一种熵编解码技术,以改进传统的混合数据编解码系统。The embodiment of the present application provides an AI-based data compression/decompression technology, especially a neural network-based data compression/decompression technology, and specifically provides an entropy coding and decoding technology to improve traditional mixed data coding and decoding system.
数据编解码包括数据编码和数据解码两部分。数据编码在源侧(或通常称为编码器侧)执行,通常包括处理(例如,压缩)原始数据以减少表示该原始数据所需的数据量(从而更高效存储和/或传输)。数据解码在目的地侧(或通常称为解码器侧)执行,通常包括相对于编码器侧作逆处理,以重建原始数据。实施例涉及的数据的“编解码”应理解为数据的“编码”或“解码”。编码部分和解码部分也合称为编解码(编码和解码,CODEC)。Data encoding and decoding includes two parts: data encoding and data decoding. Data encoding is performed on the source side (or commonly referred to as the encoder side), and typically involves processing (eg, compressing) raw data to reduce the amount of data needed to represent that raw data (and thus more efficient storage and/or transmission). Data decoding is performed on the destination side (or commonly referred to as the decoder side), and usually involves inverse processing relative to the encoder side to reconstruct the original data. The "codec" of data involved in the embodiments should be understood as "encoding" or "decoding" of data. The encoding part and the decoding part are also collectively referred to as codec (encoding and decoding, CODEC).
在无损数据编码情况下,可以重建原始数据,即重建的原始数据与原始数据具有相同的质量(假设存储或传输期间没有传输损耗或其它数据丢失)。在有损数据编码情况下,通过量化等执行进一步压缩,来减少表示原始数据所需的数据量,而解码器侧无法完全重建原始数据,即重建的原始数据的质量比原始数据的质量低或差。In the case of lossless data encoding, the original data can be reconstructed, i.e. the reconstructed original data is of the same quality as the original data (assuming no transmission loss or other data loss during storage or transmission). In the case of lossy data encoding, further compression is performed by quantization, etc., to reduce the amount of data required to represent the original data, and the decoder side cannot completely reconstruct the original data, that is, the quality of the reconstructed original data is lower than that of the original data or Difference.
本申请实施例可以应用于对视频数据、图像数据、音频数据、整数型数据以及其他具有压缩/解压缩需求的数据等。以下以视频数据的编码(简称视频编码)为例对本申请实施例进行说明,其他类型的数据(例如图像数据、音频数据、整数型数据以及其他具有压缩/解压缩需求的数据)可以参考以下描述,本申请实施例对此不再赘述。需要说明的是,相对于视频编码,音频数据以及整数型数据等数据的编码过程中无需将数据分割为块,而是可以直接对数据进行编码。The embodiments of the present application may be applied to video data, image data, audio data, integer data, and other data that require compression/decompression. The following takes video data encoding (referred to as video encoding) as an example to illustrate the embodiment of the present application. Other types of data (such as image data, audio data, integer data, and other data with compression/decompression requirements) can refer to the following description , which will not be described in detail in this embodiment of the present application. It should be noted that, compared with video coding, in the coding process of data such as audio data and integer data, there is no need to divide the data into blocks, but the data can be directly coded.
视频编码通常是指处理形成视频或视频序列的图像序列。在视频编码领域,术语“图像(picture)”、“帧(frame)”或“图片(image)”可以用作同义词。Video coding generally refers to the processing of sequences of images that form a video or video sequence. In the field of video coding, the terms "picture", "frame" or "image" may be used as synonyms.
几个视频编码标准属于“有损混合型视频编解码”(即,将像素域中的空间和时间预测与变换域中用于应用量化的2D变换编码结合)。视频序列中的每个图像通常分割成不重叠的块集合,通常在块级上进行编码。换句话说,编码器通常在块(视频块)级处理即编码视频,例如,通过空间(帧内)预测和时间(帧间)预测来产生预测块;从当前块(当前处理/待处理的块)中减去预测块,得到残差块;在变换域中变换残差块并量化残差块,以减少待传输(压缩)的数据量,而解码器侧将相对于编码器的逆处理部分应用于编码或压缩的块,以重建用于表示的当前块。另外,编码器需要重复解码器的处理步骤,使得编码器和解码器生成相同的预测(例如,帧内预测和帧间预测)和/或重建像素,用于处理,即编码后续块。Several video coding standards belong to "lossy hybrid video codecs" (ie, combining spatial and temporal prediction in the pixel domain with 2D transform coding in the transform domain for applying quantization). Each image in a video sequence is usually partitioned into a non-overlapping set of blocks, usually encoded at the block level. In other words, encoders usually process, i.e. encode, video at the block (video block) level, e.g., through spatial (intra) prediction and temporal (inter) prediction to produce a predicted block; from the current block (currently processed/to be processed block) to obtain the residual block; transform the residual block in the transform domain and quantize the residual block to reduce the amount of data to be transmitted (compressed), and the decoder side will be inversely processed relative to the encoder Partially applied to encoded or compressed blocks to reconstruct the current block for representation. Additionally, the encoder needs to repeat the decoder's processing steps such that the encoder and decoder generate the same predicted (eg, intra and inter) and/or reconstructed pixels for processing, ie encoding, subsequent blocks.
在以下译码系统10的实施例中,编码器20和解码器30根据图1至图3进行描述。In the following embodiment of the decoding system 10 , the encoder 20 and the decoder 30 are described with reference to FIGS. 1-3 .
图1为本申请实施例提供的译码系统10的一种示例性框图,例如可以利用本申请技术的视频译码系统10(或简称为译码系统10)。视频译码系统10中的视频编码器20(或简称为编码器20)和视频解码器30(或简称为解码器30)代表可用于根据本申请中描述的各种示例执行各技术的设备等。FIG. 1 is an exemplary block diagram of a decoding system 10 provided by an embodiment of the present application, for example, a video decoding system 10 (or simply referred to as the decoding system 10 ) that can utilize the technology of the present application. Video encoder 20 (or simply encoder 20) and video decoder 30 (or simply decoder 30) in video coding system 10 represent devices, etc. that may be used to perform techniques according to various examples described in this application. .
如图1所示,译码系统10包括源设备12,源设备12用于将编码图像等编码图像数据21提供给用于对编码图像数据21进行解码的目的设备14。As shown in FIG. 1 , the decoding system 10 includes a source device 12 for providing coded image data 21 such as coded images to a destination device 14 for decoding the coded image data 21 .
源设备12包括编码器20,另外即可选地,可包括图像源16、图像预处理器等预处理器(或预处理单元)18、通信接口(或通信单元)22。The source device 12 includes an encoder 20 , and optionally, an image source 16 , a preprocessor (or a preprocessing unit) 18 such as an image preprocessor, and a communication interface (or a communication unit) 22 .
图像源16可包括或可以为任意类型的用于捕获现实世界图像等的图像捕获设备,和/或任意类型的图像生成设备,例如用于生成计算机动画图像的计算机图形处理器或任意类型的用于获取和/或提供现实世界图像、计算机生成图像(例如,屏幕内容、虚拟现实(virtual reality,VR)图像和/或其任意组合(例如增强现实(augmented reality,AR)图像)的设备。所述图像源可以为存储上述图像中的任意图像的任意类型的内存或存储器。 Image source 16 may include or be any type of image capture device for capturing real world images, etc., and/or any type of image generation device, such as a computer graphics processor or any type of Devices for acquiring and/or providing real-world images, computer-generated images (e.g., screen content, virtual reality (VR) images, and/or any combination thereof (e.g., augmented reality (AR) images). So The image source may be any type of memory or storage that stores any of the above images.
为了区分预处理器(或预处理单元)18执行的处理,图像(或图像数据)17也可称为原始图像(或原始图像数据)17。To distinguish the processing performed by the preprocessor (or preprocessing unit) 18 , the image (or image data) 17 may also be referred to as an original image (or original image data) 17 .
预处理器18用于接收原始图像数据17,并对原始图像数据17进行预处理,得到预处理图像(或预处理图像数据)19。例如,预处理器18执行的预处理可包括修剪、颜色格式转换(例如从RGB转换为YCbCr)、调色或去噪。可以理解的是,预处理单元18可以为可选组件。The preprocessor 18 is used to receive the original image data 17 and perform preprocessing on the original image data 17 to obtain a preprocessed image (or preprocessed image data) 19 . For example, preprocessing performed by preprocessor 18 may include cropping, color format conversion (eg, from RGB to YCbCr), color grading, or denoising. It can be understood that the preprocessing unit 18 can be an optional component.
视频编码器(或编码器)20用于接收预处理图像数据19并提供编码图像数据21(下面将根据图2等进一步描述)。A video encoder (or encoder) 20 is used to receive preprocessed image data 19 and provide encoded image data 21 (to be further described below with reference to FIG. 2 etc.).
源设备12中的通信接口22可用于:接收编码图像数据21并通过通信信道13向目的设备14等另一设备或任何其它设备发送编码图像数据21(或其它任意处理后的版本),以便存储或直接重建。The communication interface 22 in the source device 12 may be used to receive the encoded image data 21 and send the encoded image data 21 (or any other processed version) via the communication channel 13 to another device such as the destination device 14 or any other device for storage Or rebuild directly.
目的设备14包括解码器30,另外即可选地,可包括通信接口(或通信单元)28、后处理器(或后处理单元)32和显示设备34。The destination device 14 includes a decoder 30 , and may also optionally include a communication interface (or communication unit) 28 , a post-processor (or post-processing unit) 32 and a display device 34 .
目的设备14中的通信接口28用于直接从源设备12或从存储设备等任意其它源设备接收编码图像数据21(或其它任意处理后的版本),例如,存储设备为编码图像数据存储设备,并将编码图像数据21提供给解码器30。The communication interface 28 in the destination device 14 is used to receive the coded image data 21 (or any other processed version) directly from the source device 12 or from any other source device such as a storage device, for example, the storage device is a coded image data storage device, And the coded image data 21 is supplied to the decoder 30 .
通信接口22和通信接口28可用于通过源设备12与目的设备14之间的直连通信链路,例如直接有线或无线连接等,或者通过任意类型的网络,例如有线网络、无线网络或其任意组合、任意类型的私网和公网或其任意类型的组合,发送或接收编码图像数据(或编码数据)21。The communication interface 22 and the communication interface 28 can be used to pass through a direct communication link between the source device 12 and the destination device 14, such as a direct wired or wireless connection, etc., or through any type of network, such as a wired network, a wireless network, or any other Combination, any type of private network and public network or any combination thereof, send or receive coded image data (or coded data) 21 .
例如,通信接口22可用于将编码图像数据21封装为报文等合适的格式,和/或使用任意类型的传输编码或处理来处理所述编码后的图像数据,以便在通信链路或通信网络上进行传输。For example, the communication interface 22 can be used to encapsulate the encoded image data 21 into a suitable format such as a message, and/or use any type of transmission encoding or processing to process the encoded image data, so that it can be transmitted over a communication link or communication network on the transmission.
通信接口28与通信接口22对应,例如,可用于接收传输数据,并使用任意类型的对应传输解码或处理和/或解封装对传输数据进行处理,得到编码图像数据21。The communication interface 28 corresponds to the communication interface 22, eg, can be used to receive the transmission data and process the transmission data using any type of corresponding transmission decoding or processing and/or decapsulation to obtain the encoded image data 21 .
通信接口22和通信接口28均可配置为如图1中从源设备12指向目的设备14的对应通信信道13的箭头所指示的单向通信接口,或双向通信接口,并且可用于发送和接收消息等,以建立连接,确认并交换与通信链路和/或例如编码后的图像数据传输等数据传输相关的任何其它信息,等等。Both the communication interface 22 and the communication interface 28 can be configured as a one-way communication interface as indicated by an arrow from the source device 12 to the corresponding communication channel 13 of the destination device 14 in FIG. 1, or a two-way communication interface, and can be used to send and receive messages etc., to establish the connection, confirm and exchange any other information related to the communication link and/or data transmission such as encoded image data transmission, etc.
视频解码器(或解码器)30用于接收编码图像数据21并提供解码图像数据(或解码图像数据)31(下面将根据图3等进一步描述)。The video decoder (or decoder) 30 is used to receive encoded image data 21 and provide decoded image data (or decoded image data) 31 (which will be further described below with reference to FIG. 3 , etc.).
后处理器32用于对解码后的图像等解码图像数据31(也称为重建后的图像数据)进行后处理,得到后处理后的图像等后处理图像数据33。后处理单元32执行的后处理可以包括例如颜色格式转换(例如从YCbCr转换为RGB)、调色、修剪或重采样,或者用于产生供显示设备34等显示的解码图像数据31等任何其它处理。The post-processor 32 is used to perform post-processing on decoded image data 31 (also referred to as reconstructed image data) such as a decoded image to obtain post-processed image data 33 such as a post-processed image. Post-processing performed by post-processing unit 32 may include, for example, color format conversion (e.g., from YCbCr to RGB), color grading, cropping, or resampling, or any other processing for producing decoded image data 31 for display by a display device 34 or the like. .
显示设备34用于接收后处理图像数据33,以向用户或观看者等显示图像。显示设备34可以为或包括任意类型的用于表示重建后图像的显示器,例如,集成或外部显示屏或显示器。例如,显示屏可包括液晶显示器(liquid crystal display,LCD)、有机发光二极管(organic light emitting diode,OLED)显示器、等离子显示器、投影仪、微型LED显示器、硅基液晶显示器(liquid crystal on silicon,LCoS)、数字光处理器(digital light processor,DLP)或任意类型的其它显示屏。The display device 34 is used to receive the post-processed image data 33 to display the image to a user or viewer or the like. Display device 34 may be or include any type of display for representing the reconstructed image, eg, an integrated or external display screen or display. For example, the display screen may include a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a plasma display, a projector, a micro LED display, a liquid crystal on silicon (LCoS) display, or a liquid crystal on silicon (LCoS) display. ), a digital light processor (DLP), or any type of other display.
译码系统10还包括训练引擎25,训练引擎25用于训练编码器20(尤其是编码器20中的熵编码单元270)或解码器30(尤其是解码器30中的熵解码单元304),以处理输入图像或图像区域或图像块以获取待编码图像块的参照信息,或处理输入的参照信息以估计得到待编码图像块的估计概率分布,以根据估计得到的估计概率分布对待编码图像块进行熵编码,训练引擎25的详细说明请参考下述方法测实施例。The decoding system 10 also includes a training engine 25, the training engine 25 is used to train the encoder 20 (especially the entropy encoding unit 270 in the encoder 20) or the decoder 30 (especially the entropy decoding unit 304 in the decoder 30), To process the input image or image area or image block to obtain the reference information of the image block to be encoded, or process the input reference information to estimate the estimated probability distribution of the image block to be encoded, and to obtain the estimated probability distribution of the image block to be encoded according to the estimated probability distribution For entropy encoding, please refer to the following method embodiment for detailed description of the training engine 25 .
尽管图1示出了源设备12和目的设备14作为独立的设备,但设备实施例也可以同时包括源设备12和目的设备14或同时包括源设备12和目的设备14的功能,即同时包括源设备12或对应功能和目的设备14或对应功能。在这些实施例中,源设备12或对应功能和目的设备14或对应功能可以使用相同硬件和/或软件或通过单独的硬件和/或软件或其任意组合来实现。Although FIG. 1 shows the source device 12 and the destination device 14 as independent devices, the device embodiment may also include the source device 12 and the destination device 14 or the functions of the source device 12 and the destination device 14 at the same time, that is, include the source device 12 and the destination device 14 at the same time. Device 12 or corresponding function and destination device 14 or corresponding function. In these embodiments, source device 12 or corresponding functionality and destination device 14 or corresponding functionality may be implemented using the same hardware and/or software or by separate hardware and/or software or any combination thereof.
根据描述,图1所示的源设备12和/或目的设备14中的不同单元或功能的存在和(准确)划分可能根据实际设备和应用而有所不同,这对技术人员来说是显而易见的。It will be apparent to a skilled person from the description that the presence and (exact) division of different units or functions in the source device 12 and/or destination device 14 shown in FIG. 1 may vary depending on the actual device and application. .
请参考图2和图3,图2为本申请实施例提供的视频编码器的一种示例性框图,图3为本申请实施例提供的视频解码器的一种示例性框图。编码器20可以通过处理电路46实现,以包含参照图2编码器20论述的各种模块和/或本文描述的任何其它编码器系统或子系统。解码器30可以通过处理电路46实现,以包含参照图3解码器30论述的各种模块和/或本文描述的任何其它解码器系统或子系统。所述处理电路46可用于执行下文论述的各种操作。如果部分技术在软件中实施,则设备可以将软件的指令存储在合适的非瞬时性计算机可读存储介质中,并且使用一个或多个处理器在硬件中执行指令,从而执行本申请技术。视频编码器20和视频解码器30中的其中一个可作为组合编解码器(encoder/decoder,CODEC)的一部分集成在单个设备中。Please refer to FIG. 2 and FIG. 3. FIG. 2 is an exemplary block diagram of a video encoder provided in an embodiment of the present application, and FIG. 3 is an exemplary block diagram of a video decoder provided in an embodiment of the present application. Encoder 20 may be implemented by processing circuitry 46 to include the various modules discussed with reference to encoder 20 of FIG. 2 and/or any other encoder system or subsystem described herein. Decoder 30 may be implemented by processing circuitry 46 to include the various modules discussed with reference to decoder 30 of FIG. 3 and/or any other decoder system or subsystem described herein. The processing circuitry 46 may be used to perform various operations discussed below. If part of the technology is implemented in software, the device can store software instructions in a suitable non-transitory computer-readable storage medium, and use one or more processors to execute the instructions in hardware, thereby implementing the technology of the present application. One of the video encoder 20 and the video decoder 30 may be integrated in a single device as part of a combined encoder/decoder (CODEC).
源设备12和目的设备14可包括各种设备中的任一种,包括任意类型的手持设备或固定设备,例如,笔记本电脑或膝上型电脑、手机、智能手机、平板或平板电脑、相机、台 式计算机、机顶盒、电视机、显示设备、数字媒体播放器、视频游戏控制台、视频流设备(例如,内容业务服务器或内容分发服务器)、广播接收设备、广播发射设备以及监控设备等等,并可以不使用或使用任意类型的操作系统。源设备12和目的设备14也可以是云计算场景中的设备,例如云计算场景中的虚拟机等。在一些情况下,源设备12和目的设备14可配备用于无线通信的组件。因此,源设备12和目的设备14可以是无线通信设备。 Source device 12 and destination device 14 may comprise any of a variety of devices, including any type of handheld or stationary device, such as a notebook or laptop computer, cell phone, smartphone, tablet or tablet computer, camera, Desktop computers, set-top boxes, televisions, display devices, digital media players, video game consoles, video streaming devices (such as content service servers or content distribution servers), broadcast receiving devices, broadcast transmitting devices, and monitoring devices, etc., and No or any type of operating system may be used. The source device 12 and the destination device 14 may also be devices in a cloud computing scenario, such as virtual machines in a cloud computing scenario. In some cases, source device 12 and destination device 14 may be equipped with components for wireless communication. Accordingly, source device 12 and destination device 14 may be wireless communication devices.
源设备12和目的设备14可以安装虚拟现实(virtual reality,VR)应用、增强现实(augmented reality,AR)应用或者混合现实(mixed reality,MR)应用等虚拟场景应用程序(application,APP),并可以基于用户的操作(例如点击、触摸、滑动、抖动、声控等)运行VR应用、AR应用或者MR应用。源设备12和目的设备14可以通过摄像头和/或传感器采集环境中任意物体的图像/视频,再根据采集的图像/视频在显示设备上显示虚拟物体,该虚拟物体可以是VR场景、AR场景或MR场景中的虚拟物体(即虚拟环境中的物体)。The source device 12 and the destination device 14 may install a virtual scene application (application, APP) such as a virtual reality (virtual reality, VR) application, an augmented reality (augmented reality, AR) application or a mixed reality (mixed reality, MR) application, and A VR application, an AR application or an MR application may be run based on user operations (such as clicking, touching, sliding, shaking, voice control, etc.). The source device 12 and the destination device 14 can collect images/videos of any objects in the environment through cameras and/or sensors, and then display virtual objects on the display device according to the collected images/videos. The virtual objects can be VR scenes, AR scenes or Virtual objects in the MR scene (that is, objects in the virtual environment).
需要说明的是,本申请实施例中,源设备12和目的设备14中的虚拟场景应用程序可以是源设备12和目的设备14自身内置的应用程序,也可以是用户自行安装的第三方服务商提供的应用程序,对此不做具体限定。It should be noted that, in the embodiment of the present application, the virtual scene applications in the source device 12 and the destination device 14 can be built-in applications in the source device 12 and the destination device 14, or can be third-party service providers installed by the user The provided application is not specifically limited.
此外,源设备12和目的设备14可以安装实时视频传输应用,例如直播应用。源设备12和目的设备14可以通过摄像头采集图像/视频,再将采集的图像/视频在显示设备上显示。In addition, source device 12 and destination device 14 may install real-time video transmission applications, such as live broadcast applications. The source device 12 and the destination device 14 can collect images/videos through cameras, and then display the collected images/videos on a display device.
在一些情况下,图1所示的视频译码系统10仅仅是示例性的,本申请提供的技术可适用于视频编码设置(例如,视频编码或视频解码),这些设置不一定包括编码设备与解码设备之间的任何数据通信。在其它示例中,数据从本地存储器中检索,通过网络发送,等等。视频编码设备可以对数据进行编码并将数据存储到存储器中,和/或视频解码设备可以从存储器中检索数据并对数据进行解码。在一些示例中,编码和解码由相互不通信而只是编码数据到存储器和/或从存储器中检索并解码数据的设备来执行。In some cases, the video coding system 10 shown in FIG. 1 is merely exemplary, and the techniques provided herein are applicable to video coding settings (e.g., video coding or video decoding) that do not necessarily include coding devices and Decode any data communication between devices. In other examples, data is retrieved from local storage, sent over a network, and so on. A video encoding device may encode and store data into memory, and/or a video decoding device may retrieve and decode data from memory. In some examples, encoding and decoding are performed by devices that do not communicate with each other but simply encode data to memory and/or retrieve and decode data from memory.
视频译码系统可以包含成像设备、视频编码器、视频解码器(和/或藉由处理电路实施的视频编/解码器)、天线、一个或多个处理器、一个或多个内存存储器和/或显示设备。A video coding system may include an imaging device, a video encoder, a video decoder (and/or a video encoder/decoder implemented by a processing circuit), an antenna, one or more processors, one or more memory stores, and/or or display device.
成像设备、天线、处理电路、视频编码器、视频解码器、处理器、内存存储器和/或显示设备能够互相通信。在不同实例中,视频译码系统可以只包含视频编码器或只包含视频解码器。Imaging devices, antennas, processing circuits, video encoders, video decoders, processors, memory storage and/or display devices can communicate with each other. In different examples, a video coding system may include only a video encoder or only a video decoder.
在一些实例中,天线可以用于传输或接收视频数据的经编码比特流。另外,在一些实例中,显示设备可以用于呈现视频数据。处理电路可以包含专用集成电路(application-specific integrated circuit,ASIC)逻辑、图形处理器、通用处理器等。视频译码系统也可以包含可选的处理器,该可选处理器类似地可以包含专用集成电路(application-specific integrated circuit,ASIC)逻辑、图形处理器、通用处理器等。另外,内存存储器可以是任何类型的存储器,例如易失性存储器(例如,静态随机存取存储器(static random access memory,SRAM)、动态随机存储器(dynamic random access memory,DRAM)等)或非易失性存储器(例如,闪存等)等。在非限制性实例中,内存存储器可以由超速缓存内存实施。在其它实例中,处理电路可以包含存储器(例如,缓存等)用于实施图像缓冲器等。In some examples, an antenna may be used to transmit or receive an encoded bitstream of video data. Additionally, in some instances, a display device may be used to present video data. The processing circuit may include application-specific integrated circuit (application-specific integrated circuit, ASIC) logic, a graphics processor, a general-purpose processor, and the like. The video decoding system may also include an optional processor, and the optional processor may similarly include application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, and the like. In addition, the memory storage can be any type of memory, such as volatile memory (for example, static random access memory (static random access memory, SRAM), dynamic random access memory (dynamic random access memory, DRAM), etc.) or nonvolatile memory permanent memory (for example, flash memory, etc.) and the like. In a non-limiting example, memory storage may be implemented by cache memory. In other examples, processing circuitry may include memory (eg, cache memory, etc.) for implementing image buffers, etc.
在一些实例中,通过逻辑电路实施的视频编码器20可以包含(例如,通过处理电路 或内存存储器实施的)图像缓冲器和(例如,通过处理电路实施的)图形处理单元。图形处理单元可以通信耦合至图像缓冲器。图形处理单元可以包含通过处理电路实施的视频编码器20,以实施参照图2和/或本文中所描述的任何其它编码器系统或子系统所论述的各种模块。逻辑电路可以用于执行本文所论述的各种操作。In some examples, video encoder 20 implemented with logic circuitry may include an image buffer (eg, implemented with processing circuitry or memory storage) and a graphics processing unit (eg, implemented with processing circuitry). A graphics processing unit may be communicatively coupled to the image buffer. Graphics processing unit may include video encoder 20 implemented with processing circuitry to implement the various modules discussed with reference to FIG. 2 and/or any other encoder system or subsystem described herein. Logic circuits may be used to perform the various operations discussed herein.
在一些实例中,视频解码器30可以以类似方式通过处理电路实施,以实施参照图3的视频解码器30和/或本文中所描述的任何其它解码器系统或子系统所论述的各种模块。在一些实例中,逻辑电路实施的视频解码器30可以包含(通过处理电路或内存存储器实施的)图像缓冲器和(例如,通过处理电路实施的)图形处理单元。图形处理单元可以通信耦合至图像缓冲器。图形处理单元可以包含通过处理电路实施的视频解码器30,以实施参照图3和/或本文中所描述的任何其它解码器系统或子系统所论述的各种模块。In some examples, video decoder 30 may be implemented by processing circuitry in a similar manner to implement the various modules discussed with reference to video decoder 30 of FIG. 3 and/or any other decoder system or subsystem described herein . In some examples, logic circuit implemented video decoder 30 may include an image buffer (implemented by processing circuitry or memory storage) and a graphics processing unit (eg, implemented by processing circuitry). A graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include video decoder 30 implemented by processing circuitry to implement the various modules discussed with reference to FIG. 3 and/or any other decoder system or subsystem described herein.
在一些实例中,天线可以用于接收视频数据的经编码比特流。如所论述,经编码比特流可以包含本文所论述的与编码视频帧相关的数据、指示符、索引值、模式选择数据等,例如与编码分割相关的数据(例如,变换系数或经量化变换系数,(如所论述的)可选指示符,和/或定义编码分割的数据)。视频译码系统还可包含耦合至天线并用于解码经编码比特流的视频解码器30。显示设备用于呈现视频帧。In some examples, an antenna may be used to receive an encoded bitstream of video data. As discussed, an encoded bitstream may contain data related to encoded video frames, indicators, index values, mode selection data, etc., as discussed herein, such as data related to encoding partitions (e.g., transform coefficients or quantized transform coefficients , (as discussed) an optional indicator, and/or data defining an encoding split). The video coding system may also include video decoder 30 coupled to the antenna and for decoding the encoded bitstream. Display devices are used to render video frames.
应理解,本申请实施例中对于参考视频编码器20所描述的实例,视频解码器30可以用于执行相反过程。关于信令语法元素,视频解码器30可以用于接收并解析这种语法元素,相应地解码相关视频数据。在一些例子中,视频编码器20可以将语法元素熵编码成经编码视频比特流。在此类实例中,视频解码器30可以解析这种语法元素,并相应地解码相关视频数据。It should be understood that, for the example described with reference to the video encoder 20 in the embodiment of the present application, the video decoder 30 may be used to perform a reverse process. With regard to signaling syntax elements, the video decoder 30 may be configured to receive and parse such syntax elements and decode the associated video data accordingly. In some examples, video encoder 20 may entropy encode the syntax elements into an encoded video bitstream. In such instances, video decoder 30 may parse such syntax elements and decode the related video data accordingly.
为便于描述,参考通用视频编码(versatile video coding,VVC)参考软件或由ITU-T视频编码专家组(video coding experts group,VCEG)和ISO/IEC运动图像专家组(motion picture experts group,MPEG)的视频编码联合工作组(joint collaboration team on video coding,JCT-VC)开发的高性能视频编码(high-efficiency video coding,HEVC)描述本申请实施例。本领域普通技术人员理解本申请实施例不限于HEVC或VVC。For ease of description, refer to the general video coding (versatile video coding, VVC) reference software or by the ITU-T video coding experts group (video coding experts group, VCEG) and ISO/IEC motion picture experts group (motion picture experts group, MPEG) The high-efficiency video coding (HEVC) developed by the video coding joint working group (joint collaboration team on video coding, JCT-VC) describes the embodiment of the present application. Those of ordinary skill in the art understand that the embodiments of the present application are not limited to HEVC or VVC.
编码器和编码方法Encoders and Encoding Methods
如图2所示,视频编码器20包括输入端(或输入接口)201、残差计算单元204、变换处理单元206、量化单元208、反量化单元210、逆变换处理单元212、重建单元214、环路滤波器220、解码图像缓冲器(decoded picture buffer,DPB)230、模式选择单元260、熵编码单元270和输出端(或输出接口)272。模式选择单元260可包括帧间预测单元244、帧内预测单元254和分割单元262。帧间预测单元244可包括运动估计单元和运动补偿单元(未示出)。图2所示的视频编码器20也可称为混合型视频编码器或基于混合型视频编解码器的视频编码器。As shown in Figure 2, the video encoder 20 includes an input terminal (or input interface) 201, a residual calculation unit 204, a transformation processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transformation processing unit 212, a reconstruction unit 214, Loop filter 220 , decoded picture buffer (decoded picture buffer, DPB) 230 , mode selection unit 260 , entropy coding unit 270 and output terminal (or output interface) 272 . Mode selection unit 260 may include inter prediction unit 244 , intra prediction unit 254 , and partition unit 262 . Inter prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown). The video encoder 20 shown in FIG. 2 may also be called a hybrid video encoder or a video encoder based on a hybrid video codec.
参见图2,帧间预测单元为经过训练的目标模型(亦称为神经网络),该神经网络用于处理输入图像或图像区域或图像块,以生成输入图像块的预测值。例如,用于帧间预测的神经网络用于接收输入的图像或图像区域或图像块,并且生成输入的图像或图像区域或图像块的预测值。Referring to FIG. 2 , the inter-frame prediction unit is a trained target model (also called a neural network), and the neural network is used to process an input image or an image region or an image block to generate a prediction value of the input image block. For example, a neural network for inter-frame prediction is used to receive an input image or image region or image block and generate a prediction value for the input image or image region or image block.
残差计算单元204、变换处理单元206、量化单元208和模式选择单元260组成编码器20的前向信号路径,而反量化单元210、逆变换处理单元212、重建单元214、缓冲器 216、环路滤波器220、解码图像缓冲器(decoded picture buffer,DPB)230、帧间预测单元244和帧内预测单元254组成编码器的后向信号路径,其中编码器20的后向信号路径对应于解码器的信号路径(参见图3中的解码器30)。反量化单元210、逆变换处理单元212、重建单元214、环路滤波器220、解码图像缓冲器230、帧间预测单元244和帧内预测单元254还组成视频编码器20的“内置解码器”。The residual calculation unit 204, the transform processing unit 206, the quantization unit 208, and the mode selection unit 260 constitute the forward signal path of the encoder 20, while the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the buffer 216, the loop A path filter 220, a decoded picture buffer (decoded picture buffer, DPB) 230, an inter prediction unit 244, and an intra prediction unit 254 form the backward signal path of the encoder, wherein the backward signal path of the encoder 20 corresponds to the decoding signal path of the decoder (see decoder 30 in FIG. 3). Inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, loop filter 220, decoded picture buffer 230, inter prediction unit 244, and intra prediction unit 254 also make up the "built-in decoder" of video encoder 20 .
图像和图像分割(图像和块)Images and Image Segmentation (Images and Blocks)
编码器20可用于通过输入端201等接收图像(或图像数据)17,例如,形成视频或视频序列的图像序列中的图像。接收的图像或图像数据也可以是预处理后的图像(或预处理后的图像数据)19。为简单起见,以下描述使用图像17。图像17也可称为当前图像或待编码的图像(尤其是在视频编码中将当前图像与其它图像区分开时,其它图像例如同一视频序列,即也包括当前图像的视频序列,中的之前编码后图像和/或解码后图像)。The encoder 20 is operable to receive, via an input 201 or the like, an image (or image data) 17, eg an image in a sequence of images forming a video or a video sequence. The received image or image data may also be a preprocessed image (or preprocessed image data) 19 . For simplicity, the following description uses image 17. Image 17 may also be referred to as a current image or an image to be encoded (especially when the current image is distinguished from other images in video encoding, other images such as the same video sequence, that is, the video sequence that also includes the current image, before encoding post image and/or decoded image).
(数字)图像为或可以视为具有强度值的像素点组成的二维阵列或矩阵。阵列中的像素点也可以称为像素(pixel或pel)(图像元素的简称)。阵列或图像在水平方向和垂直方向(或轴线)上的像素点数量决定了图像的大小和/或分辨率。为了表示颜色,通常采用三个颜色分量,即图像可以表示为或包括三个像素点阵列。在RBG格式或颜色空间中,图像包括对应的红色、绿色和蓝色像素点阵列。但是,在视频编码中,每个像素通常以亮度/色度格式或颜色空间表示,例如YCbCr,包括Y指示的亮度分量(有时也用L表示)以及Cb、Cr表示的两个色度分量。亮度(luma)分量Y表示亮度或灰度水平强度(例如,在灰度等级图像中两者相同),而两个色度(chrominance,简写为chroma)分量Cb和Cr表示色度或颜色信息分量。相应地,YCbCr格式的图像包括亮度像素点值(Y)的亮度像素点阵列和色度值(Cb和Cr)的两个色度像素点阵列。RGB格式的图像可以转换或变换为YCbCr格式,反之亦然,该过程也称为颜色变换或转换。如果图像是黑白的,则该图像可以只包括亮度像素点阵列。相应地,图像可以为例如单色格式的亮度像素点阵列或4:2:0、4:2:2和4:4:4彩色格式的亮度像素点阵列和两个相应的色度像素点阵列。A (digital) image is or can be viewed as a two-dimensional array or matrix of pixel points with intensity values. Pixels in the array may also be referred to as pixels (pixel or pel) (short for image element). The number of pixels in the array or image in the horizontal and vertical directions (or axes) determines the size and/or resolution of the image. In order to represent a color, three color components are usually used, that is, an image can be represented as or include three pixel arrays. In the RBG format or color space, an image includes corresponding red, green and blue pixel arrays. However, in video coding, each pixel is usually expressed in a luminance/chroma format or color space, such as YCbCr, including a luminance component indicated by Y (sometimes also indicated by L) and two chrominance components indicated by Cb and Cr. The luminance (luma) component Y represents brightness or grayscale level intensity (e.g., both are the same in a grayscale image), while the two chrominance (chroma) components Cb and Cr represent chrominance or color information components . Correspondingly, an image in the YCbCr format includes a luminance pixel point array of luminance pixel point values (Y) and two chrominance pixel point arrays of chrominance values (Cb and Cr). Images in RGB format can be converted or transformed to YCbCr format and vice versa, a process also known as color transformation or conversion. If the image is black and white, the image may only include an array of luminance pixels. Correspondingly, the image can be, for example, an array of luma pixels in monochrome format or an array of luma pixels and two corresponding arrays of chrominance pixels in 4:2:0, 4:2:2 and 4:4:4 color formats .
在一个实施例中,视频编码器20的实施例可包括图像分割单元(图2中未示出),用于将图像17分割成多个(通常不重叠)图像块203。这些块在H.265/HEVC和VVC标准中也可以称为根块、宏块(H.264/AVC)或编码树块(coding tree block,CTB),或编码树单元(coding tree unit,CTU)。分割单元可用于对视频序列中的所有图像使用相同的块大小和使用限定块大小的对应网格,或在图像或图像子集或图像组之间改变块大小,并将每个图像分割成对应块。In one embodiment, an embodiment of the video encoder 20 may include an image segmentation unit (not shown in FIG. 2 ) for segmenting the image 17 into a plurality of (typically non-overlapping) image blocks 203 . These blocks can also be called root blocks, macroblocks (H.264/AVC) or coding tree blocks (CTB), or coding tree units (coding tree unit, CTU) in the H.265/HEVC and VVC standards ). The segmentation unit can be used to use the same block size for all images in a video sequence and to use a corresponding grid that defines the block size, or to vary the block size between images or subsets or groups of images and segment each image into corresponding piece.
在其它实施例中,视频编码器可用于直接接收图像17的块203,例如,组成所述图像17的一个、几个或所有块。图像块203也可以称为当前图像块或待编码图像块。In other embodiments, the video encoder may be adapted to directly receive the blocks 203 of the image 17 , for example one, several or all blocks making up said image 17 . The image block 203 may also be referred to as a current image block or an image block to be encoded.
与图像17一样,图像块203同样是或可认为是具有强度值(像素点值)的像素点组成的二维阵列或矩阵,但是图像块203的比图像17的小。换句话说,块203可包括一个像素点阵列(例如,单色图像17情况下的亮度阵列或彩色图像情况下的亮度阵列或色度阵列)或三个像素点阵列(例如,彩色图像17情况下的一个亮度阵列和两个色度阵列)或根据所采用的颜色格式的任何其它数量和/或类型的阵列。块203的水平方向和垂直方向(或轴线)上的像素点数量限定了块203的大小。相应地,块可以为M×N(M列×N行)个像素点阵列,或M×N个变换系数阵列等。Like the image 17 , the image block 203 is also or can be regarded as a two-dimensional array or matrix composed of pixels with intensity values (pixel values), but the image block 203 is smaller than that of the image 17 . In other words, block 203 may comprise one pixel point array (for example, a luminance array in the case of a monochrome image 17 or a luminance array or a chrominance array in the case of a color image) or three pixel point arrays (for example, in the case of a color image 17 one luma array and two chrominance arrays) or any other number and/or type of arrays depending on the color format employed. The number of pixels in the horizontal direction and vertical direction (or axis) of the block 203 defines the size of the block 203 . Correspondingly, a block may be an array of M×N (M columns×N rows) pixel points, or an array of M×N transform coefficients, and the like.
在一个实施例中,图2所示的视频编码器20用于逐块对图像17进行编码,例如,对每个块203执行编码和预测。In one embodiment, the video encoder 20 shown in FIG. 2 is used to encode the image 17 block by block, eg, performing encoding and prediction on each block 203 .
在一个实施例中,图2所示的视频编码器20还可以用于使用片(也称为视频片)分割和/或编码图像,其中图像可以使用一个或多个片(通常为不重叠的)进行分割或编码。每个片可包括一个或多个块(例如,编码树单元CTU)或一个或多个块组(例如H.265/HEVC/VVC标准中的编码区块(tile)和VVC标准中的砖(brick)。In one embodiment, the video encoder 20 shown in FIG. 2 can also be used to segment and/or encode an image using slices (also called video slices), where an image can use one or more slices (typically non-overlapping ) for segmentation or encoding. Each slice may include one or more blocks (for example, a coding tree unit CTU) or one or more block groups (for example, a coding block (tile) in the H.265/HEVC/VVC standard and a tile in the VVC standard ( brick).
在一个实施例中,图2所示的视频编码器20还可以用于使用片/编码区块组(也称为视频编码区块组)和/或编码区块(也称为视频编码区块)对图像进行分割和/或编码,其中图像可以使用一个或多个片/编码区块组(通常为不重叠的)进行分割或编码,每个片/编码区块组可包括一个或多个块(例如CTU)或一个或多个编码区块等,其中每个编码区块可以为矩形等形状,可包括一个或多个完整或部分块(例如CTU)。In one embodiment, the video encoder 20 shown in FIG. 2 can also be configured to use slices/coded block groups (also called video coded block groups) and/or coded blocks (also called video coded block groups) ) to segment and/or encode an image, where an image may be segmented or encoded using one or more slices/coded block groups (usually non-overlapping), each slice/coded block group may consist of one or more A block (such as a CTU) or one or more coding blocks, etc., wherein each coding block may be in the shape of a rectangle or the like, and may include one or more complete or partial blocks (such as a CTU).
残差计算residual calculation
残差计算单元204用于通过如下方式根据图像块(或原始块)203和预测块265来计算残差块205(后续详细介绍了预测块265):例如,逐个像素点(逐个像素)从图像块203的像素点值中减去预测块265的像素点值,得到像素域中的残差块205。The residual calculation unit 204 is used to calculate the residual block 205 according to the image block (or original block) 203 and the prediction block 265 (the prediction block 265 will be described in detail later): for example, pixel by pixel (pixel by pixel) from the image The pixel value of the predicted block 265 is subtracted from the pixel value of the block 203 to obtain the residual block 205 in the pixel domain.
变换transform
变换处理单元206用于对残差块205的像素点值执行离散余弦变换(discrete cosine transform,DCT)或离散正弦变换(discrete sine transform,DST)等,得到变换域中的变换系数207。变换系数207也可称为变换残差系数,表示变换域中的残差块205。The transform processing unit 206 is configured to perform discrete cosine transform (discrete cosine transform, DCT) or discrete sine transform (discrete sine transform, DST) etc. on the pixel point values of the residual block 205 to obtain transform coefficients 207 in the transform domain. The transform coefficients 207 may also be referred to as transform residual coefficients, representing the residual block 205 in the transform domain.
变换处理单元206可用于应用DCT/DST的整数化近似,例如为H.265/HEVC指定的变换。与正交DCT变换相比,这种整数化近似通常由某一因子按比例缩放。为了维持经过正变换和逆变换处理的残差块的范数,使用其它比例缩放因子作为变换过程的一部分。比例缩放因子通常是根据某些约束条件来选择的,例如比例缩放因子是用于移位运算的2的幂、变换系数的位深度、准确性与实施成本之间的权衡等。例如,在编码器20侧通过逆变换处理单元212为逆变换(以及在解码器30侧通过例如逆变换处理单元312为对应逆变换)指定具体的比例缩放因子,以及相应地,可以在编码器20侧通过变换处理单元206为正变换指定对应比例缩放因子。Transform processing unit 206 may be configured to apply an integer approximation of DCT/DST, such as the transform specified for H.265/HEVC. This integer approximation is usually scaled by some factor compared to the orthogonal DCT transform. To maintain the norm of the forward and inverse transformed residual blocks, other scaling factors are used as part of the transformation process. The scaling factor is usually chosen according to certain constraints, such as the scaling factor being a power of 2 for the shift operation, the bit depth of the transform coefficients, the trade-off between accuracy and implementation cost, etc. For example, specifying a specific scaling factor for the inverse transform at the encoder 20 side by the inverse transform processing unit 212 (and for the corresponding inverse transform at the decoder 30 side by, for example, the inverse transform processing unit 312), and correspondingly, can The side 20 specifies the corresponding scaling factor for the forward transform through the transform processing unit 206 .
在一个实施例中,视频编码器20(对应地,变换处理单元206)可用于输出一种或多种变换的类型等变换参数,例如,直接输出或由熵编码单元270进行编码或压缩后输出,例如使得视频解码器30可接收并使用变换参数进行解码。In one embodiment, the video encoder 20 (correspondingly, the transform processing unit 206) can be used to output transform parameters such as one or more transform types, for example, directly output or output after encoding or compression by the entropy encoding unit 270 , for example, so that the video decoder 30 can receive and use the transformation parameters for decoding.
量化Quantify
量化单元208用于通过例如标量量化或矢量量化对变换系数207进行量化,得到量化变换系数209。量化变换系数209也可称为量化残差系数209。The quantization unit 208 is configured to quantize the transform coefficient 207 by, for example, scalar quantization or vector quantization, to obtain a quantized transform coefficient 209 . Quantized transform coefficients 209 may also be referred to as quantized residual coefficients 209 .
量化过程可减少与部分或全部变换系数207有关的位深度。例如,可在量化期间将n位变换系数向下舍入到m位变换系数,其中n大于m。可通过调整量化参数(quantization parameter,QP)修改量化程度。例如,对于标量量化,可以应用不同程度的比例来实现较细或较粗的量化。较小量化步长对应较细量化,而较大量化步长对应较粗量化。可通过量化参数(quantization parameter,QP)指示合适的量化步长。例如,量化参数可以为合适的量化步长的预定义集合的索引。例如,较小的量化参数可对应精细量化(较小量化步长), 较大的量化参数可对应粗糙量化(较大量化步长),反之亦然。量化可包括除以量化步长,而反量化单元210等执行的对应或逆解量化可包括乘以量化步长。根据例如HEVC一些标准的实施例可用于使用量化参数来确定量化步长。一般而言,可以根据量化参数使用包含除法的等式的定点近似来计算量化步长。可以引入其它比例缩放因子来进行量化和解量化,以恢复可能由于在用于量化步长和量化参数的等式的定点近似中使用的比例而修改的残差块的范数。在一种示例性实现方式中,可以合并逆变换和解量化的比例。或者,可以使用自定义量化表并在比特流中等将其从编码器向解码器指示。量化是有损操作,其中量化步长越大,损耗越大。The quantization process may reduce the bit depth associated with some or all of the transform coefficients 207 . For example, n-bit transform coefficients may be rounded down to m-bit transform coefficients during quantization, where n is greater than m. The degree of quantization can be modified by adjusting a quantization parameter (quantization parameter, QP). For example, with scalar quantization, different degrees of scaling can be applied to achieve finer or coarser quantization. A smaller quantization step size corresponds to finer quantization, and a larger quantization step size corresponds to coarser quantization. A suitable quantization step size can be indicated by a quantization parameter (quantization parameter, QP). For example, a quantization parameter may be an index to a predefined set of suitable quantization step sizes. For example, a smaller quantization parameter may correspond to fine quantization (smaller quantization step size), and a larger quantization parameter may correspond to coarse quantization (larger quantization step size), and vice versa. Quantization may include dividing by a quantization step size, while corresponding or inverse dequantization performed by the inverse quantization unit 210 or the like may include multiplying by a quantization step size. Embodiments according to some standards such as HEVC may be used to determine the quantization step size using quantization parameters. In general, the quantization step size can be calculated from the quantization parameter using a fixed-point approximation of an equation involving division. Other scaling factors may be introduced for quantization and dequantization to recover the norm of the residual block that may have been modified by the scale used in the fixed-point approximation of the equations for quantization step size and quantization parameter. In one exemplary implementation, the inverse transform and dequantization scales may be combined. Alternatively, a custom quantization table could be used and indicated from the encoder to the decoder in the bitstream etc. Quantization is a lossy operation, where the larger the quantization step size, the greater the loss.
在一个实施例中,视频编码器20(对应地,量化单元208)可用于输出量化参数(quantization parameter,QP),例如,直接输出或由熵编码单元270进行编码或压缩后输出,例如使得视频解码器30可接收并使用量化参数进行解码。In one embodiment, the video encoder 20 (correspondingly, the quantization unit 208) can be used to output a quantization parameter (quantization parameter, QP), for example, directly output or output after being encoded or compressed by the entropy encoding unit 270, for example, making the video Decoder 30 may receive and use the quantization parameters for decoding.
反量化dequantization
反量化单元210用于对量化系数执行量化单元208的反量化,得到解量化系数211,例如,根据或使用与量化单元208相同的量化步长执行与量化单元208所执行的量化方案的反量化方案。解量化系数211也可称为解量化残差系数211,对应于变换系数207,但是由于量化造成损耗,反量化系数211通常与变换系数不完全相同。The inverse quantization unit 210 is used to perform the inverse quantization of the quantization unit 208 on the quantization coefficients to obtain the dequantization coefficients 211, for example, perform the inverse quantization of the quantization scheme performed by the quantization unit 208 according to or use the same quantization step size as that of the quantization unit 208 plan. The dequantized coefficients 211 may also be referred to as dequantized residual coefficients 211 , corresponding to the transform coefficients 207 , but due to loss caused by quantization, the dequantized coefficients 211 are usually not exactly the same as the transform coefficients.
逆变换inverse transform
逆变换处理单元212用于执行变换处理单元206执行的变换的逆变换,例如,逆离散余弦变换(discrete cosine transform,DCT)或逆离散正弦变换(discrete sine transform,DST),以在像素域中得到重建残差块213(或对应的解量化系数213)。重建残差块213也可称为变换块213。The inverse transform processing unit 212 is configured to perform an inverse transform of the transform performed by the transform processing unit 206, for example, an inverse discrete cosine transform (discrete cosine transform, DCT) or an inverse discrete sine transform (discrete sine transform, DST), to transform in the pixel domain A reconstructed residual block 213 (or corresponding dequantization coefficients 213) is obtained. The reconstructed residual block 213 may also be referred to as a transform block 213 .
重建reconstruction
重建单元214(例如,求和器214)用于将变换块213(即重建残差块213)添加到预测块265,以在像素域中得到重建块215,例如,将重建残差块213的像素点值和预测块265的像素点值相加。The reconstruction unit 214 (e.g., summer 214) is used to add the transform block 213 (i.e., the reconstructed residual block 213) to the predicted block 265 to obtain the reconstructed block 215 in the pixel domain, for example, the reconstructed residual block 213 The pixel value is added to the pixel value of the prediction block 265 .
滤波filtering
环路滤波器单元220(或简称“环路滤波器”220)用于对重建块215进行滤波,得到滤波块221,或通常用于对重建像素点进行滤波以得到滤波像素点值。例如,环路滤波器单元用于顺利进行像素转变或提高视频质量。环路滤波器单元220可包括一个或多个环路滤波器,例如去块滤波器、像素点自适应偏移(sample-adaptive offset,SAO)滤波器或一个或多个其它滤波器,例如自适应环路滤波器(adaptive loop filter,ALF)、噪声抑制滤波器(noise suppression filter,NSF)或任意组合。例如,环路滤波器单元220可以包括去块滤波器、SAO滤波器和ALF滤波器。滤波过程的顺序可以是去块滤波器、SAO滤波器和ALF滤波器。再例如,增加一个称为具有色度缩放的亮度映射(luma mapping with chroma scaling,LMCS)(即自适应环内整形器)的过程。该过程在去块之前执行。再例如,去块滤波过程也可以应用于内部子块边缘,例如仿射子块边缘、ATMVP子块边缘、子块变换(sub-block transform,SBT)边缘和内子部分(intra sub-partition,ISP)边缘。尽管环路滤波器单元220在图2中示为环路滤波器,但在其它配置中,环路滤波器单元220可以实现为环后滤波器。滤波块221也可称为滤波重建块221。The loop filter unit 220 (or "loop filter" 220 for short) is used to filter the reconstructed block 215 to obtain the filtered block 221, or generally used to filter the reconstructed pixels to obtain filtered pixel values. For example, a loop filter unit is used to smooth pixel transitions or improve video quality. The loop filter unit 220 may include one or more loop filters, such as deblocking filters, pixel adaptive offset (sample-adaptive offset, SAO) filters, or one or more other filters, such as auto Adaptive loop filter (ALF), noise suppression filter (NSF), or any combination. For example, the loop filter unit 220 may include a deblocking filter, an SAO filter, and an ALF filter. The order of the filtering process may be deblocking filter, SAO filter and ALF filter. As another example, add a process called luma mapping with chroma scaling (LMCS) (ie adaptive in-loop shaper). This process is performed before deblocking. For another example, the deblocking filtering process can also be applied to internal sub-block edges, such as affine sub-block edges, ATMVP sub-block edges, sub-block transform (sub-block transform, SBT) edges and intra sub-partition (ISP )edge. Although loop filter unit 220 is shown in FIG. 2 as a loop filter, in other configurations, loop filter unit 220 may be implemented as a post-loop filter. The filtering block 221 may also be referred to as a filtering reconstruction block 221 .
在一个实施例中,视频编码器20(对应地,环路滤波器单元220)可用于输出环路滤波器参数(例如SAO滤波参数、ALF滤波参数或LMCS参数),例如,直接输出或由熵编码单元270进行熵编码后输出,例如使得解码器30可接收并使用相同或不同的环路滤波器参数进行解码。In one embodiment, video encoder 20 (correspondingly, loop filter unit 220) can be used to output loop filter parameters (such as SAO filter parameters, ALF filter parameters or LMCS parameters), for example, directly or by entropy The encoding unit 270 performs entropy encoding to output, for example, so that the decoder 30 can receive and use the same or different loop filter parameters for decoding.
解码图像缓冲器decoded image buffer
解码图像缓冲器(decoded picture buffer,DPB)230可以是存储参考图像数据以供视频编码器20在编码视频数据时使用的参考图像存储器。DPB 230可以由多种存储器设备中的任一种形成,例如动态随机存取存储器(dynamic random access memory,DRAM),包括同步DRAM(synchronous DRAM,SDRAM)、磁阻RAM(magnetoresistive RAM,MRAM)、电阻RAM(resistive RAM,RRAM)或其它类型的存储设备。解码图像缓冲器230可用于存储一个或多个滤波块221。解码图像缓冲器230还可用于存储同一当前图像或例如之前的重建图像等不同图像的其它之前的滤波块,例如之前重建和滤波的块221,并可提供完整的之前重建即解码图像(和对应参考块和像素点)和/或部分重建的当前图像(和对应参考块和像素点),例如用于帧间预测。解码图像缓冲器230还可用于存储一个或多个未经滤波的重建块215,或一般存储未经滤波的重建像素点,例如,未被环路滤波单元220滤波的重建块215,或未进行任何其它处理的重建块或重建像素点。A decoded picture buffer (DPB) 230 may be a reference picture memory that stores reference picture data for use by the video encoder 20 when encoding video data. The DPB 230 may be formed from any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous DRAM (synchronous DRAM, SDRAM), magnetoresistive RAM (magnetoresistive RAM, MRAM), Resistive RAM (resistive RAM, RRAM) or other types of storage devices. The decoded picture buffer 230 may be used to store one or more filter blocks 221 . The decoded picture buffer 230 may also be used to store other previously filtered blocks, such as the previously reconstructed and filtered block 221, of the same current picture or a different picture such as a previous reconstructed picture, and may provide the complete previously reconstructed, i.e. decoded picture (and the corresponding reference blocks and pixels) and/or a partially reconstructed current image (and corresponding reference blocks and pixels), for example for inter-frame prediction. The decoded image buffer 230 can also be used to store one or more unfiltered reconstruction blocks 215, or generally store unfiltered reconstruction pixels, for example, the reconstruction blocks 215 that have not been filtered by the loop filter unit 220, or have not been filtered. Any other processed reconstruction blocks or reconstructed pixels.
模式选择(分割和预测)Mode selection (segmentation and prediction)
模式选择单元260包括分割单元262、帧间预测单元244和帧内预测单元254,用于从解码图像缓冲器230或其它缓冲器(例如,列缓冲器,图2中未显示)接收或获得原始块203(当前图像17的当前块203)和重建图像数据等原始图像数据,例如,同一(当前)图像和/或一个或多个之前解码图像的滤波和/或未经滤波的重建像素点或重建块。重建图像数据用作帧间预测或帧内预测等预测所需的参考图像数据,以得到预测块265或预测值265。The mode selection unit 260 includes a segmentation unit 262, an inter prediction unit 244, and an intra prediction unit 254 for receiving or obtaining raw raw image data such as block 203 (current block 203 of current image 17) and reconstructed image data, e.g. filtered and/or unfiltered reconstructed pixels of the same (current) image and/or one or more previously decoded images or Rebuild blocks. The reconstructed image data is used as reference image data required for prediction such as inter-frame prediction or intra-frame prediction to obtain a prediction block 265 or a prediction value 265 .
模式选择单元260可用于为当前块(包括不分割)和预测模式(例如帧内或帧间预测模式)确定或选择一种分割,生成对应的预测块265,以对残差块205进行计算和对重建块215进行重建。The mode selection unit 260 can be used to determine or select a partition for the current block (including no partition) and a prediction mode (such as intra or inter prediction mode), and generate a corresponding prediction block 265 to calculate and calculate the residual block 205 The reconstruction block 215 is reconstructed.
在一个实施例中,模式选择单元260可用于选择分割和预测模式(例如,从模式选择单元260支持的或可用的预测模式中),所述预测模式提供最佳匹配或者说最小残差(最小残差是指传输或存储中更好的压缩),或者提供最小信令开销(最小信令开销是指传输或存储中更好的压缩),或者同时考虑或平衡以上两者。模式选择单元260可用于根据码率失真优化(rate distortion Optimization,RDO)确定分割和预测模式,即选择提供最小码率失真优化的预测模式。本文“最佳”、“最低”、“最优”等术语不一定指总体上“最佳”、“最低”、“最优”的,但也可以指满足终止或选择标准的情况,例如,超过或低于阈值的值或其他限制可能导致“次优选择”,但会降低复杂度和处理时间。In one embodiment, mode selection unit 260 is operable to select a partitioning and prediction mode (e.g., from among the prediction modes supported or available by mode selection unit 260) that provides the best match or the smallest residual (minimum Residual refers to better compression in transmission or storage), or provides minimal signaling overhead (minimum signaling overhead refers to better compression in transmission or storage), or considers or balances both of the above. The mode selection unit 260 may be configured to determine the partition and prediction mode according to rate distortion optimization (RDO), that is, to select the prediction mode that provides the minimum rate distortion optimization. The terms "best", "lowest", "best" herein do not necessarily refer to "best", "lowest", "best" in general, but may refer to situations where termination or selection criteria are met, e.g., Values above or below thresholds or other constraints may result in "sub-optimal selection", but reduce complexity and processing time.
换言之,分割单元262可用于将视频序列中的图像分割为编码树单元(coding tree unit,CTU)序列,CTU 203可进一步被分割成较小的块部分或子块(再次形成块),例如,通过迭代使用四叉树(quad-tree partitioning,QT)分割、二叉树(binary-tree partitioning,BT)分割或三叉树(triple-tree partitioning,TT)分割或其任意组合,并且用于例如对块部分或子块中的每一个执行预测,其中模式选择包括选择分割块203的树结构和选择应用于块部 分或子块中的每一个的预测模式。In other words, segmentation unit 262 may be used to segment images in a video sequence into a sequence of coding tree units (CTUs), and CTUs 203 may be further segmented into smaller block portions or sub-blocks (again forming blocks), e.g. By iteratively using quad-tree partitioning (QT) partitioning, binary-tree partitioning (BT) partitioning or triple-tree partitioning (TT) partitioning or any combination thereof, and for example or each of the sub-blocks to perform prediction, wherein the mode selection includes selecting the tree structure of the partition block 203 and selecting the prediction mode to be applied to the block portion or each of the sub-blocks.
下文将详细地描述由视频编码器20执行的分割(例如,由分割单元262执行)和预测处理(例如,由帧间预测单元244和帧内预测单元254执行)。The partitioning (eg, performed by partition unit 262 ) and prediction processing (eg, performed by inter-prediction unit 244 and intra-prediction unit 254 ) performed by video encoder 20 are described in detail below.
分割segmentation
分割单元262可将一个图像块(或CTU)203分割(或划分)为较小的部分,例如正方形或矩形形状的小块。对于具有三个像素点阵列的图像,一个CTU由N×N个亮度像素点块和两个对应的色度像素点块组成。CTU中亮度块的最大允许大小在正在开发的通用视频编码(versatile video coding,VVC)标准中被指定为128×128,但是将来可指定为不同于128×128的值,例如256×256。图像的CTU可以集中/分组为片/编码区块组、编码区块或砖。一个编码区块覆盖着一个图像的矩形区域,一个编码区块可以分成一个或多个砖。一个砖由一个编码区块内的多个CTU行组成。没有分割为多个砖的编码区块可以称为砖。但是,砖是编码区块的真正子集,因此不称为编码区块。VVC支持两种编码区块组模式,分别为光栅扫描片/编码区块组模式和矩形片模式。在光栅扫描编码区块组模式,一个片/编码区块组包含一个图像的编码区块光栅扫描中的编码区块序列。在矩形片模式中,片包含一个图像的多个砖,这些砖共同组成图像的矩形区域。矩形片内的砖按照片的砖光栅扫描顺序排列。这些较小块(也可称为子块)可进一步分割为更小的部分。这也称为树分割或分层树分割,其中在根树级别0(层次级别0、深度0)等的根块可以递归地分割为两个或两个以上下一个较低树级别的块,例如树级别1(层次级别1、深度1)的节点。这些块可以又分割为两个或两个以上下一个较低级别的块,例如树级别2(层次级别2、深度2)等,直到分割结束(因为满足结束标准,例如达到最大树深度或最小块大小)。未进一步分割的块也称为树的叶块或叶节点。分割为两个部分的树称为二叉树(binary-tree,BT),分割为三个部分的树称为三叉树(ternary-tree,TT),分割为四个部分的树称为四叉树(quad-tree,QT)。The segmentation unit 262 may divide (or divide) an image block (or CTU) 203 into smaller parts, such as square or rectangular shaped small blocks. For an image with three pixel arrays, a CTU consists of N×N luma pixel blocks and two corresponding chrominance pixel blocks. The maximum allowed size of a luma block in a CTU is specified as 128×128 in the developing Versatile Video Coding (VVC) standard, but may be specified in the future to a value other than 128×128, such as 256×256. The CTUs of an image can be pooled/grouped into slices/coded block groups, coded blocks or bricks. A coding block covers a rectangular area of an image, and a coding block can be divided into one or more bricks. A brick consists of multiple CTU rows within an encoded block. A coded block that is not partitioned into multiple bricks may be called a brick. However, bricks are a true subset of coded blocks and are therefore not called coded blocks. VVC supports two coded block group modes, namely raster scan slice/coded block group mode and rectangular slice mode. In RSCBG mode, a slice/CBG contains a sequence of CBGs in a coded block raster scan of an image. In rectangular tile mode, a tile contains multiple tiles of an image that together form a rectangular area of the image. The tiles within the rectangular slice are arranged in the photo's tile raster scan order. These smaller blocks (also called sub-blocks) can be further divided into smaller parts. This is also known as tree splitting or hierarchical tree splitting, where the root block at root tree level 0 (hierarchy level 0, depth 0) etc. can be recursively split into blocks of two or more next lower tree levels, For example a node at tree level 1 (hierarchy level 1, depth 1). These blocks can in turn be split into two or more blocks at the next lower level, e.g. tree level 2 (hierarchy level 2, depth 2), etc., until the end of the split (because the end criteria are met, e.g. maximum tree depth or minimum block size). Blocks that are not further divided are also called leaf blocks or leaf nodes of the tree. A tree divided into two parts is called a binary-tree (BT), a tree divided into three parts is called a ternary-tree (TT), and a tree divided into four parts is called a quadtree ( quad-tree, QT).
例如,编码树单元(CTU)可以为或包括亮度像素点的CTB、具有三个像素点阵列的图像的色度像素点的两个对应CTB、或单色图像的像素点的CTB或使用三个独立颜色平面和语法结构(用于编码像素点)编码的图像的像素点的CTB。相应地,编码树块(CTB)可以为N×N个像素点块,其中N可以设为某个值使得分量划分为CTB,这就是分割。编码单元(coding unit,CU)可以为或包括亮度像素点的编码块、具有三个像素点阵列的图像的色度像素点的两个对应编码块、或单色图像的像素点的编码块或使用三个独立颜色平面和语法结构(用于编码像素点)编码的图像的像素点的编码块。相应地,编码块(CB)可以为M×N个像素点块,其中M和N可以设为某个值使得CTB划分为编码块,这就是分割。For example, a coding tree unit (CTU) may be or include a CTB of luma pixels, two corresponding CTBs of chroma pixels of an image having an array of three pixels, or a CTB of pixels of a monochrome image or using three The CTB of the pixel of the image encoded by the independent color plane and the syntax structure (used to encode the pixel). Correspondingly, a coding tree block (CTB) can be an N×N pixel block, where N can be set to a certain value so that the components are divided into CTBs, which is segmentation. A coding unit (CU) may be or include a coding block of luma pixels, two corresponding coding blocks of chrominance pixels of an image having three pixel arrays, or a coding block of pixels of a monochrome image or An encoded block of pixels of an image encoded using three separate color planes and syntax structures (for encoding pixels). Correspondingly, a coding block (CB) can be M×N pixel blocks, where M and N can be set to a certain value so that the CTB is divided into coding blocks, which is division.
例如,在实施例中,根据HEVC可通过使用表示为编码树的四叉树结构将编码树单元(CTU)划分为多个CU。在叶CU级作出是否使用帧间(时间)预测或帧内(空间)预测对图像区域进行编码的决定。每个叶CU可以根据PU划分类型进一步划分为一个、两个或四个PU。一个PU内使用相同的预测过程,并以PU为单位向解码器传输相关信息。在根据PU划分类型应用预测过程得到残差块之后,可以根据类似于用于CU的编码树的其它四叉树结构将叶CU分割为变换单元(TU)。For example, in an embodiment, a coding tree unit (CTU) may be divided into a plurality of CUs according to HEVC by using a quadtree structure represented as a coding tree. The decision whether to encode an image region using inter (temporal) prediction or intra (spatial) prediction is made at the leaf-CU level. Each leaf-CU can be further divided into one, two or four PUs according to the PU division type. The same prediction process is used within a PU, and relevant information is transmitted to the decoder in units of PUs. After applying the prediction process according to the PU partition type to obtain the residual block, the leaf CU can be partitioned into transform units (TUs) according to other quadtree structures similar to the coding tree used for the CU.
例如,在实施例中,根据当前正在开发的最新视频编码标准(称为通用视频编码(VVC), 使用嵌套多类型树(例如二叉树和三叉树)的组合四叉树来划分用于分割编码树单元的分段结构。在编码树单元内的编码树结构中,CU可以为正方形或矩形。例如,编码树单元(CTU)首先由四叉树结构进行分割。四叉树叶节点进一步由多类型树结构分割。多类型树形结构有四种划分类型:垂直二叉树划分(SPLIT_BT_VER)、水平二叉树划分(SPLIT_BT_HOR)、垂直三叉树划分(SPLIT_TT_VER)和水平三叉树划分(SPLIT_TT_HOR)。多类型树叶节点称为编码单元(CU),除非CU对于最大变换长度而言太大,这样的分段用于预测和变换处理,无需其它任何分割。在大多数情况下,这表示CU、PU和TU在四叉树嵌套多类型树的编码块结构中的块大小相同。当最大支持变换长度小于CU的彩色分量的宽度或高度时,就会出现该异常。VVC制定了具有四叉树嵌套多类型树的编码结构中的分割划分信息的唯一信令机制。在信令机制中,编码树单元(CTU)作为四叉树的根首先被四叉树结构分割。然后每个四叉树叶节点(当足够大可以被)被进一步分割为一个多类型树结构。在多类型树结构中,通过第一标识(mtt_split_cu_flag)指示节点是否进一步分割,当对节点进一步分割时,先用第二标识(mtt_split_cu_vertical_flag)指示划分方向,再用第三标识(mtt_split_cu_binary_flag)指示划分是二叉树划分或三叉树划分。根据mtt_split_cu_vertical_flag和mtt_split_cu_binary_flag的值,解码器可以基于预定义规则或表格推导出CU的多类型树划分模式(MttSplitMode)。需要说明的是,对于某种设计,例如VVC硬件解码器中的64×64的亮度块和32×32的色度流水线设计,当亮度编码块的宽度或高度大于64时,不允许进行TT划分。当色度编码块的宽度或高度大于32时,也不允许TT划分。流水线设计将图像分为多个虚拟流水线数据单元(virtual pipeline data unit,VPDU),每个VPDU在图像中定义为互不重叠的单元。在硬件解码器中,连续的VPDU在多个流水线阶段同时处理。在大多数流水线阶段,VPDU大小与缓冲器大小大致成正比,因此需要保持较小的VPDU。在大多数硬件解码器中,VPDU大小可以设置为最大变换块(transform block,TB)大小。但是,在VVC中,三叉树(TT)和二叉树(BT)的分割可能会增加VPDU的大小。For example, in an embodiment, according to the latest video coding standard currently under development, called Versatile Video Coding (VVC), a combined quadtree of nested multi-type trees (such as binary and ternary trees) is used to partition The segmentation structure of the tree unit. In the coding tree structure in the coding tree unit, the CU can be square or rectangular. For example, the coding tree unit (CTU) is first divided by the quadtree structure. The quadtree leaf nodes are further composed of multi-type Tree structure segmentation. There are four types of division in multi-type tree structures: vertical binary tree division (SPLIT_BT_VER), horizontal binary tree division (SPLIT_BT_HOR), vertical ternary tree division (SPLIT_TT_VER) and horizontal ternary tree division (SPLIT_TT_HOR). Multi-type leaf nodes are called is a coding unit (CU), unless the CU is too large for the maximum transform length, such a segment is used for prediction and transform processing without any other partition.In most cases, this means that CU, PU and TU are in the quad The block size in the coding block structure of the tree-nested multi-type tree is the same. This exception occurs when the maximum supported transform length is less than the width or height of the color component of the CU. VVC has a quad-tree nested multi-type tree The only signaling mechanism for splitting and dividing information in the coding structure. In the signaling mechanism, the coding tree unit (CTU) is first divided by the quadtree structure as the root of the quadtree. Then each quadtree leaf node (when enough can be further split into a multi-type tree structure. In the multi-type tree structure, the first flag (mtt_split_cu_flag) indicates whether the node is further split. When the node is further split, the second flag (mtt_split_cu_vertical_flag) is first indicated. Divide the direction, and then use the third identification (mtt_split_cu_binary_flag) to indicate that the division is a binary tree division or a ternary tree division.According to the values of mtt_split_cu_vertical_flag and mtt_split_cu_binary_flag, the decoder can derive the multi-type tree division mode (MttSplitMode) of the CU based on predefined rules or tables. It should be noted that for a certain design, such as the 64×64 luma block and the 32×32 chroma pipeline design in the VVC hardware decoder, when the width or height of the luma coding block is greater than 64, TT division is not allowed .When the width or height of the chroma encoding block is greater than 32, TT division is also not allowed. The pipeline design divides the image into multiple virtual pipeline data units (virtual pipeline data unit, VPDU), and each VPDU is defined in the image as mutual Non-overlapping units. In the hardware decoder, consecutive VPDUs are processed simultaneously in multiple pipeline stages. In most pipeline stages, the VPDU size is roughly proportional to the buffer size, so VPD needs to be kept small U. In most hardware decoders, the VPDU size can be set to the maximum transform block (TB) size. However, in VVC, splitting of ternary tree (TT) and binary tree (BT) may increase the size of VPDU.
另外,需要说明的是,当树节点块的一部分超出底部或图像右边界时,强制对该树节点块进行划分,直到每个编码CU的所有像素点都位于图像边界内。In addition, it should be noted that when a part of the tree node block exceeds the bottom or the right boundary of the image, the tree node block is forced to be divided until all pixels of each coded CU are located within the image boundary.
例如,所述帧内子分割(intra sub-partitions,ISP)工具可以根据块大小将亮度帧内预测块垂直或水平地分为两个或四个子部分。For example, the intra sub-partitions (intra sub-partitions, ISP) tool may vertically or horizontally divide the luma intra prediction block into two or four sub-parts according to the block size.
在一个示例中,视频编码器20的模式选择单元260可以用于执行上文描述的分割技术的任意组合。In one example, mode selection unit 260 of video encoder 20 may be configured to perform any combination of the segmentation techniques described above.
如上所述,视频编码器20用于从(预定的)预测模式集合中确定或选择最好或最优的预测模式。预测模式集合可包括例如帧内预测模式和/或帧间预测模式。As mentioned above, the video encoder 20 is configured to determine or select the best or optimal prediction mode from a set of (predetermined) prediction modes. The set of prediction modes may include, for example, intra prediction modes and/or inter prediction modes.
帧内预测intra prediction
帧内预测模式集合可包括35种不同的帧内预测模式,例如,像DC(或均值)模式和平面模式的非方向性模式,或如HEVC定义的方向性模式,或者可包括67种不同的帧内预测模式,例如,像DC(或均值)模式和平面模式的非方向性模式,或如VVC中定义的方向性模式。例如,若干传统角度帧内预测模式自适应地替换为VVC中定义的非正方形块的广角帧内预测模式。又例如,为了避免DC预测的除法运算,仅使用较长边来计算非正方形块的平均值。并且,平面模式的帧内预测结果还可以使用位置决定的帧内预测组合 (position dependent intra prediction combination,PDPC)方法修改。The set of intra prediction modes can include 35 different intra prediction modes, e.g. non-directional modes like DC (or mean) mode and planar mode, or directional modes as defined by HEVC, or can include 67 different Intra prediction modes, eg non-directional modes like DC (or mean) mode and planar mode, or directional modes as defined in VVC. For example, several traditional angle intra prediction modes are adaptively replaced with wide angle intra prediction modes for non-square blocks defined in VVC. As another example, to avoid the division operation of DC prediction, only the longer side is used to calculate the average value of non-square blocks. Moreover, the intra prediction result of the planar mode can also be modified using a position dependent intra prediction combination (PDPC) method.
帧内预测单元254用于根据帧内预测模式集合中的帧内预测模式使用同一当前图像的相邻块的重建像素点来生成帧内预测块265。The intra prediction unit 254 is configured to generate an intra prediction block 265 by using reconstructed pixels of adjacent blocks of the same current image according to an intra prediction mode in the intra prediction mode set.
帧内预测单元254(或通常为模式选择单元260)还用于输出帧内预测参数(或通常为指示块的选定帧内预测模式的信息)以语法元素266的形式发送到熵编码单元270,以包含到编码图像数据21中,从而视频解码器30可执行操作,例如接收并使用用于解码的预测参数。Intra prediction unit 254 (or generally mode selection unit 260) is also configured to output intra prediction parameters (or generally information indicating the selected intra prediction mode for a block) in the form of syntax elements 266 to entropy encoding unit 270 , to be included in the encoded image data 21, so that the video decoder 30 can perform operations such as receiving and using prediction parameters for decoding.
HEVC中的帧内预测模式包括直流预测模式,平面预测模式和33种角度预测模式,共计35个候选预测模式。当前块可以使用左侧和上方已重建图像块的像素作为参考进行帧内预测。当前块的周边区域中用来对当前块进行帧内预测的图像块成为参考块,参考块中的像素称为参考像素。35个候选预测模式中,直流预测模式适用于当前块中纹理平坦的区域,该区域中所有像素均使用参考块中的参考像素的平均值作为预测;平面预测模式适用于纹理平滑变化的图像块,符合该条件的当前块使用参考块中的参考像素进行双线性插值作为当前块中的所有像素的预测;角度预测模式利用当前块的纹理与相邻已重建图像块的纹理高度相关的特性,沿某一角度复制对应的参考块中的参考像素的值作为当前块中的所有像素的预测。The intra prediction modes in HEVC include DC prediction mode, planar prediction mode and 33 angle prediction modes, a total of 35 candidate prediction modes. The current block can be intra-predicted using the pixels of the reconstructed image blocks on the left and above as references. An image block used for performing intra-frame prediction on the current block in the peripheral area of the current block becomes a reference block, and pixels in the reference block are called reference pixels. Among the 35 candidate prediction modes, the DC prediction mode is suitable for the area with flat texture in the current block, and all pixels in this area use the average value of the reference pixels in the reference block as prediction; the planar prediction mode is suitable for image blocks with smooth texture changes , the current block that meets this condition uses the reference pixels in the reference block to perform bilinear interpolation as the prediction of all pixels in the current block; the angle prediction mode uses the characteristic that the texture of the current block is highly correlated with the texture of the adjacent reconstructed image block , copy the value of the reference pixel in the corresponding reference block along a certain angle as the prediction of all the pixels in the current block.
HEVC编码器给当前块从35个候选预测模式中选择一个最优帧内预测模式,并将该最优帧内预测模式写入视频码流。为提升帧内预测的编码效率,编码器/解码器会从周边区域中、采用帧内预测的已重建图像块各自的最优帧内预测模式中推导出3个最可能模式,如果给当前块选择的最优帧内预测模式是这3个最可能模式的其中之一,则编码一个第一索引指示所选择的最优帧内预测模式是这3个最可能模式的其中之一;如果选中的最优帧内预测模式不是这3个最可能模式,则编码一个第二索引指示所选择的最优帧内预测模式是其他32个模式(35个候选预测模式中除前述3个最可能模式外的其他模式)的其中之一。HEVC标准使用5比特的定长码作为前述第二索引。The HEVC encoder selects an optimal intra prediction mode from 35 candidate prediction modes for the current block, and writes the optimal intra prediction mode into the video stream. In order to improve the coding efficiency of intra prediction, the encoder/decoder will derive the three most probable modes from the respective optimal intra prediction modes of the reconstructed image blocks in the surrounding area using intra prediction. If given to the current block The selected optimal intra prediction mode is one of the three most probable modes, then encode a first index indicating that the selected optimal intra prediction mode is one of the three most probable modes; if selected The optimal intra prediction mode is not the three most probable modes, then encode a second index indicating that the selected optimal intra prediction mode is the other 32 modes (except the above three most probable modes among the 35 candidate prediction modes one of the other modes). The HEVC standard uses a 5-bit fixed-length code as the aforementioned second index.
HEVC编码器推导出3个最可能模式的方法包括:选取当前块的左相邻图像块和上相邻图像块的最优帧内预测模式放入集合,如果这两个最优帧内预测模式相同,则集合中只保留一个即可。如果这两个最优帧内预测模式相同且均为角度预测模式,则再选取与该角度方向邻近的两个角度预测模式加入集合;否则,依次选择平面预测模式、直流模式模式和竖直预测模式加入集合,直到集合中的模式数量达到3。The method for the HEVC encoder to derive the three most probable modes includes: selecting the optimal intra prediction mode of the left adjacent image block and the upper adjacent image block of the current block into the set, if the two optimal intra prediction modes are the same, only one can be kept in the set. If the two optimal intra prediction modes are the same and both are angle prediction modes, then select two angle prediction modes adjacent to the angle direction to add to the set; otherwise, select planar prediction mode, DC mode mode and vertical prediction mode in turn Patterns are added to the set until the number of patterns in the set reaches 3.
HEVC解码器对码流做熵解码后,获得当前块的模式信息,该模式信息包括指示当前块的最优帧内预测模式是否在3个最可能模式中的指示标识,以及当前块的最优帧内预测模式在3个最可能模式中的索引或者当前块的最优帧内预测模式在其他32个模式中的索引。After the HEVC decoder performs entropy decoding on the code stream, it obtains the mode information of the current block, which includes an indicator indicating whether the optimal intra prediction mode of the current block is among the three most probable modes, and the optimal intra prediction mode of the current block. The index of the intra prediction mode in the 3 most probable modes or the index of the optimal intra prediction mode of the current block in the other 32 modes.
帧间预测Inter prediction
在可能的实现中,帧间预测模式集合取决于可用参考图像(即,例如前述存储在DBP230中的至少部分之前解码的图像)和其它帧间预测参数,例如取决于是否使用整个参考图像或只使用参考图像的一部分,例如当前块的区域附近的搜索窗口区域,来搜索最佳匹配参考块,和/或例如取决于是否执行半像素、四分之一像素和/或16分之一内插的像素内插。In a possible implementation, the set of inter prediction modes depends on available reference pictures (i.e., e.g. at least some previously decoded pictures previously stored in DBP 230) and other inter prediction parameters, e.g. on whether the entire reference picture is used or only Use part of the reference image, e.g. the search window area around the area of the current block, to search for the best matching reference block, and/or e.g. depending on whether half-pel, quarter-pel and/or 16th interpolation is performed pixel interpolation.
除上述预测模式外,还可以采用跳过模式和/或直接模式。In addition to the prediction modes described above, skip mode and/or direct mode may also be employed.
例如,扩展合并预测,这个模式的合并候选列表由以下五个候选类型按顺序组成:来自空间相邻CU的空间MVP、来自并置CU的时间MVP、来自FIFO表的基于历史的MVP、成对平均MVP和零MV。可以使用基于双边匹配的解码器侧运动矢量修正(decoder side motion vector refinement,DMVR)来增加合并模式的MV的准确度。带有MVD的合并模式(merge mode with MVD,MMVD)来自有运动矢量差异的合并模式。在发送跳过标志和合并标志之后立即发送MMVD标志,以指定CU是否使用MMVD模式。可以使用CU级自适应运动矢量分辨率(adaptive motion vector resolution,AMVR)方案。AMVR支持CU的MVD以不同的精度进行编码。根据当前CU的预测模式,自适应地选择当前CU的MVD。当CU以合并模式进行编码时,可以将合并的帧间/帧内预测(combined inter/intra prediction,CIIP)模式应用于当前CU。对帧间和帧内预测信号进行加权平均,得到CIIP预测。对于仿射运动补偿预测,通过2个控制点(4参数)或3个控制点(6参数)运动矢量的运动信息来描述块的仿射运动场。基于子块的时间运动矢量预测(subblock-based temporal motion vector prediction,SbTMVP),与HEVC中的时间运动矢量预测(temporal motion vector prediction,TMVP)类似,但预测的是当前CU内的子CU的运动矢量。双向光流(bi-directional optical flow,BDOF)以前称为BIO,是一种减少计算的简化版本,特别是在乘法次数和乘数大小方面的计算。在三角形分割模式中,CU以对角线划分和反对角线划分两种划分方式被均匀划分为两个三角形部分。此外,双向预测模式在简单平均的基础上进行了扩展,以支持两个预测信号的加权平均。For example, Extended Merge Prediction, the merge candidate list for this mode consists of the following five candidate types in order: Spatial MVP from spatially adjacent CUs, Temporal MVP from collocated CUs, History-based MVP from FIFO table, Pairwise MVP Average MVP and zero MV. Decoder side motion vector refinement (DMVR) based on bilateral matching can be used to increase the accuracy of MV in merge mode. Merge mode with MVD (merge mode with MVD, MMVD) comes from merge mode with motion vector difference. Send the MMVD flag immediately after sending the skip flag and the merge flag to specify whether the CU uses MMVD mode. A CU-level adaptive motion vector resolution (AMVR) scheme may be used. AMVR supports CU's MVD encoding at different precisions. According to the prediction mode of the current CU, the MVD of the current CU is adaptively selected. When a CU is coded in merge mode, a combined inter/intra prediction (CIIP) mode can be applied to the current CU. A weighted average is performed on the inter-frame and intra-frame prediction signals to obtain CIIP prediction. For affine motion compensated prediction, the affine motion field of a block is described by the motion information of 2 control points (4 parameters) or 3 control points (6 parameters) motion vector. Subblock-based temporal motion vector prediction (SbTMVP), similar to temporal motion vector prediction (TMVP) in HEVC, but predicts the motion of sub-CUs within the current CU vector. Bi-directional optical flow (BDOF), formerly known as BIO, is a simplified version that reduces computation, especially in terms of the number of multiplications and the size of the multiplier. In the triangular partition mode, the CU is evenly divided into two triangular parts in two ways: diagonal division and anti-diagonal division. In addition, the bidirectional prediction mode extends simple averaging to support weighted averaging of two prediction signals.
帧间预测单元244可包括运动估计(motion estimation,ME)单元和运动补偿(motion compensation,MC)单元(两者在图2中未示出)。运动估计单元可用于接收或获取图像块203(当前图像17的当前图像块203)和解码图像231,或至少一个或多个之前重建块,例如,一个或多个其它/不同之前解码图像231的重建块,来进行运动估计。例如,视频序列可包括当前图像和之前的解码图像231,或换句话说,当前图像和之前的解码图像231可以为形成视频序列的图像序列的一部分或形成该图像序列。The inter prediction unit 244 may include a motion estimation (motion estimation, ME) unit and a motion compensation (motion compensation, MC) unit (both are not shown in FIG. 2 ). The motion estimation unit is operable to receive or acquire image block 203 (current image block 203 of current image 17) and decoded image 231, or at least one or more previously reconstructed blocks, e.g., of one or more other/different previously decoded images 231 Reconstruct blocks for motion estimation. For example, a video sequence may comprise a current picture and a previous decoded picture 231, or in other words, the current picture and a previous decoded picture 231 may be part of or form a sequence of pictures forming the video sequence.
例如,编码器20可用于从多个其它图像中的同一或不同图像的多个参考块中选择参考块,并将参考图像(或参考图像索引)和/或参考块的位置(x、y坐标)与当前块的位置之间的偏移(空间偏移)作为帧间预测参数提供给运动估计单元。该偏移也称为运动矢量(motion vector,MV)。For example, encoder 20 may be configured to select a reference block from a plurality of reference blocks in the same or different images in a plurality of other images, and assign the reference image (or reference image index) and/or the position (x, y coordinates) of the reference block ) and the position of the current block (spatial offset) are provided to the motion estimation unit as inter prediction parameters. This offset is also called a motion vector (MV).
运动补偿单元用于获取,例如接收,帧间预测参数,并根据或使用该帧间预测参数执行帧间预测,得到帧间预测块246。由运动补偿单元执行的运动补偿可能包含根据通过运动估计确定的运动/块矢量来提取或生成预测块,还可能包括对子像素精度执行内插。内插滤波可从已知像素的像素点中产生其它像素的像素点,从而潜在地增加可用于对图像块进行编码的候选预测块的数量。一旦接收到当前图像块的PU对应的运动矢量时,运动补偿单元可在其中一个参考图像列表中定位运动矢量指向的预测块。The motion compensation unit is configured to obtain, for example, receive, inter-frame prediction parameters, and perform inter-frame prediction according to or using the inter-frame prediction parameters to obtain an inter-frame prediction block 246 . Motion compensation performed by the motion compensation unit may include extracting or generating a prediction block from a motion/block vector determined by motion estimation, and may include performing interpolation to sub-pixel precision. Interpolation filtering can generate pixels of other pixels from pixels of known pixels, thereby potentially increasing the number of candidate predictive blocks that can be used to encode an image block. Once the motion vector corresponding to the PU of the current image block is received, the motion compensation unit may locate the prediction block pointed to by the motion vector in one of the reference image lists.
运动补偿单元还可以生成与块和视频片相关的语法元素,以供视频解码器30在解码视频片的图像块时使用。此外,或者作为片和相应语法元素的替代,可以生成或使用编码区块组和/或编码区块以及相应语法元素。The motion compensation unit may also generate block- and video-slice-related syntax elements for use by video decoder 30 when decoding image blocks of video slices. Additionally, or instead of slices and corresponding syntax elements, coding block groups and/or coding blocks and corresponding syntax elements may be generated or used.
在获取先进的运动矢量预测(advanced motion vector prediction,AMVP)模式中的候 选运动矢量列表的过程中,作为备选可以加入候选运动矢量列表的运动矢量(motion vector,MV)包括当前块的空域相邻和时域相邻的图像块的MV,其中空域相邻的图像块的MV又可以包括位于当前块左侧的左方候选图像块的MV和位于当前块上方的上方候选图像块的MV。示例性的,请参考图4,图4为本申请实施例提供的候选图像块的一种示例性的示意图,如图4所示,左方候选图像块的集合包括{A0,A1},上方候选图像块的集合包括{B0,B1,B2},时域相邻的候选图像块的集合包括{C,T},这三个集合均可以作为备选被加入到候选运动矢量列表中,但是根据现有编码标准,AMVP的候选运动矢量列表的最大长度为2,因此需要根据规定的顺序从三个集合中确定在候选运动矢量列表中加入最多两个图像块的MV。该顺序可以是优先考虑当前块的左方候选图像块的集合{A0,A1}(先考虑A0,A0不可得再考虑A1),其次考虑当前块的上方候选图像块的集合{B0,B1,B2}(先考虑B0,B0不可得再考虑B1,B1不可得再考虑B2),最后考虑当前块的时域相邻的候选图像块的集合{C,T}(先考虑T,T不可得再考虑C)。In the process of obtaining the candidate motion vector list in the advanced motion vector prediction (advanced motion vector prediction, AMVP) mode, the motion vector (motion vector, MV) that can be added to the candidate motion vector list as an alternative includes the spatial phase of the current block The MVs of adjacent and temporally adjacent image blocks, wherein the MVs of spatially adjacent image blocks may include the MV of the left candidate image block on the left of the current block and the MV of the upper candidate image block above the current block. For example, please refer to FIG. 4, which is an exemplary schematic diagram of candidate image blocks provided by the embodiment of the present application. As shown in FIG. 4, the set of candidate image blocks on the left includes {A0, A1}, and the upper The set of candidate image blocks includes {B0, B1, B2}, and the set of temporally adjacent candidate image blocks includes {C, T}. These three sets can all be added to the list of candidate motion vectors as candidates, but According to the existing coding standard, the maximum length of the candidate motion vector list of AMVP is 2, so it is necessary to determine the MVs that add at most two image blocks to the candidate motion vector list from the three sets according to the specified order. The order can be to give priority to the set {A0, A1} of the left candidate image block of the current block (consider A0 first, A0 is not available and then consider A1), and secondly consider the set of candidate image blocks above the current block {B0, B1, B2} (consider B0 first, consider B1 if B0 is not available, and then consider B2 if B1 is not available), and finally consider the set {C, T} of candidate image blocks adjacent to the current block in time domain (consider T first, T is not available Consider C) again.
得到上述候选运动矢量列表后,通过率失真代价(rate distortion cost,RD cost)从候选运动矢量列表中确定最优的MV,将RD cost最小的候选运动矢量作为当前块的运动矢量预测值(motion vector predictor,MVP)。率失真代价由以下公式计算获得:After the above candidate motion vector list is obtained, the optimal MV is determined from the candidate motion vector list through the rate distortion cost (RD cost), and the candidate motion vector with the smallest RD cost is used as the motion vector predictor (motion vector predictor, MVP). The rate-distortion cost is calculated by the following formula:
J=SAD+λRJ=SAD+λR
其中,J表示RD cost,SAD为使用候选运动矢量进行运动估计后得到的预测块的像素值与当前块的像素值之间的绝对误差和(sum of absolute differences,SAD),R表示码率,λ表示拉格朗日乘子。Among them, J represents RD cost, SAD is the absolute error sum (sum of absolute differences, SAD) between the pixel value of the prediction block obtained after motion estimation using the candidate motion vector and the pixel value of the current block, R represents the code rate, λ represents the Lagrangian multiplier.
编码端将确定出的MVP在候选运动矢量列表中的索引传递到解码端。进一步地,可以在MVP为中心的邻域内进行运动搜索获得当前块实际的运动矢量,编码端计算MVP与实际的运动矢量之间的运动矢量差值(motion vector difference,MVD),并将MVD也传递到解码端。解码端解析索引,根据该索引在候选运动矢量列表中找到对应的MVP,解析MVD,将MVD与MVP相加得到当前块实际的运动矢量。The encoding end transmits the determined index of the MVP in the candidate motion vector list to the decoding end. Further, the motion search can be performed in the neighborhood centered on the MVP to obtain the actual motion vector of the current block, and the encoding end calculates the motion vector difference (motion vector difference, MVD) between the MVP and the actual motion vector, and calculates the MVD passed to the decoder. The decoding end parses the index, finds the corresponding MVP in the candidate motion vector list according to the index, parses the MVD, and adds the MVD and the MVP to obtain the actual motion vector of the current block.
在获取融合(Merge)模式中的候选运动信息列表的过程中,作为备选可以加入候选运动信息列表的运动信息包括当前块的空域相邻或时域相邻的图像块的运动信息,其中空域相邻的图像块和时域相邻的图像块可参照图4,候选运动信息列表中对应于空域的候选运动信息来自于空间相邻的5个块(A0、A1、B0、B1和B2),若空域相邻块不可得或者为帧内预测,则其运动信息不加入候选运动信息列表。当前块的时域的候选运动信息根据参考帧和当前帧的图序计数(picture order count,POC)对参考帧中对应位置块的MV进行缩放后获得,先判断参考帧中位置为T的块是否可得,若不可得则选择位置为C的块。得到上述候选运动信息列表后,通过RD cost从候选运动信息列表中确定最优的运动信息作为当前块的运动信息。编码端将最优的运动信息在候选运动信息列表中位置的索引值(记为merge index)传递到解码端。In the process of obtaining the candidate motion information list in Merge mode, the motion information that can be added to the candidate motion information list as an alternative includes the motion information of the image blocks adjacent to the current block in the spatial domain or in the temporal domain, where the spatial domain Adjacent image blocks and temporally adjacent image blocks can refer to Figure 4. The candidate motion information corresponding to the spatial domain in the candidate motion information list comes from five spatially adjacent blocks (A0, A1, B0, B1, and B2) , if the neighboring blocks in space are unavailable or are intra-frame predicted, their motion information will not be added to the candidate motion information list. The candidate motion information in the time domain of the current block is obtained by scaling the MV of the corresponding position block in the reference frame according to the picture order count (POC) of the reference frame and the current frame, and first judges the block whose position is T in the reference frame Whether it is available, if not available, select the block with position C. After obtaining the above candidate motion information list, determine the optimal motion information from the candidate motion information list through RD cost as the motion information of the current block. The encoding end transmits the index value (denoted as merge index) of the position of the optimal motion information in the candidate motion information list to the decoding end.
熵编码entropy coding
参见图2,熵编码单元270包括经过训练的自注意力解码网络2071和自注意力编码网络2072,自注意力解码网络2071用于处理输入图像或图像区域或图像块,以获取第一上下文信息;自注意力编码网络2072用于处理输入图像或图像区域或图像块,以获取第一边信息。Referring to Fig. 2, the entropy encoding unit 270 includes a trained self-attention decoding network 2071 and a self-attention encoding network 2072, and the self-attention decoding network 2071 is used to process an input image or image region or image block to obtain first context information ; The self-attention encoding network 2072 is used to process the input image or image region or image block to obtain the first side information.
熵编码单元270用于将熵编码算法或方案(例如,可变长度编码(variable length coding,VLC)方案、上下文自适应VLC方案(context adaptive VLC,CALVC)、算术编码方案、二值化算法、上下文自适应二进制算术编码(context adaptive binary arithmetic coding,CABAC)、基于语法的上下文自适应二进制算术编码(syntax-based context-adaptive binary arithmetic coding,SBAC)、概率区间分割熵(probability interval partitioning entropy,PIPE)编码或其它熵编码方法或技术)应用于量化残差系数209、帧间预测参数、帧内预测参数、环路滤波器参数和/或其它语法元素,得到可以通过输出端272以编码比特流21等形式输出的编码图像数据21,使得视频解码器30等可以接收并使用用于解码的参数。可将编码比特流21传输到视频解码器30,或将其保存在存储器中稍后由视频解码器30传输或检索。The entropy coding unit 270 is used to use an entropy coding algorithm or scheme (for example, a variable length coding (variable length coding, VLC) scheme, a context adaptive VLC scheme (context adaptive VLC, CALVC), an arithmetic coding scheme, a binarization algorithm, Context Adaptive Binary Arithmetic Coding (CABAC), Syntax-based context-adaptive Binary Arithmetic Coding (SBAC), Probability Interval Partitioning Entropy (PIPE) ) encoding or other entropy encoding methods or techniques) are applied to the quantized residual coefficient 209, inter prediction parameters, intra prediction parameters, loop filter parameters and/or other syntax elements, and the obtained bit stream can be encoded by the output terminal 272 21 etc., so that the video decoder 30 etc. can receive and use parameters for decoding. Encoded bitstream 21 may be transmitted to video decoder 30 or stored in memory for later transmission or retrieval by video decoder 30 .
视频编码器20的其它结构变体可用于对视频流进行编码。例如,基于非变换的编码器20可以在某些块或帧没有变换处理单元206的情况下直接量化残差信号。在另一种实现方式中,编码器20可以具有组合成单个单元的量化单元208和反量化单元210。Other structural variants of the video encoder 20 are available for encoding video streams. For example, a non-transform based encoder 20 may directly quantize the residual signal without a transform processing unit 206 for certain blocks or frames. In another implementation, encoder 20 may have quantization unit 208 and inverse quantization unit 210 combined into a single unit.
解码器和解码方法Decoder and Decoding Method
如图3所示,视频解码器30用于接收例如由编码器20编码的编码图像数据21(例如编码比特流21),得到解码图像331。编码图像数据或比特流包括用于解码所述编码图像数据的信息,例如表示编码视频片(和/或编码区块组或编码区块)的图像块的数据和相关的语法元素。As shown in FIG. 3 , the video decoder 30 is used to receive the encoded image data 21 (eg encoded bit stream 21 ) encoded by the encoder 20 to obtain a decoded image 331 . The coded image data or bitstream comprises information for decoding said coded image data, eg data representing image blocks of a coded video slice (and/or coded block group or coded block) and associated syntax elements.
在图3的示例中,解码器30包括熵解码单元304、反量化单元310、逆变换处理单元312、重建单元314(例如求和器314)、环路滤波器320、解码图像缓冲器(DBP)330、模式应用单元360、帧间预测单元344和帧内预测单元354。帧间预测单元344可以为或包括运动补偿单元。在一些示例中,视频解码器30可执行大体上与参照图2的视频编码器100描述的编码过程相反的解码过程。In the example of FIG. 3, the decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transform processing unit 312, a reconstruction unit 314 (such as a summer 314), a loop filter 320, a decoded picture buffer (DBP ) 330, mode application unit 360, inter prediction unit 344, and intra prediction unit 354. Inter prediction unit 344 may be or include a motion compensation unit. In some examples, video decoder 30 may perform a decoding process that is substantially inverse to the encoding process described with reference to video encoder 100 of FIG. 2 .
参见图3,熵解码单元304包括经过训练的自注意力解码网络3041,自注意力解码网络3041用于处理输入图像或图像区域或图像块,以获取第一上下文信息。Referring to FIG. 3 , the entropy decoding unit 304 includes a trained self-attention decoding network 3041 , and the self-attention decoding network 3041 is used to process an input image or image region or image block to obtain first context information.
如编码器20所述,反量化单元210、逆变换处理单元212、重建单元214、环路滤波器220、解码图像缓冲器DPB 230、帧间预测单元244和帧内预测单元254还组成视频编码器20的“内置解码器”。相应地,反量化单元310在功能上可与反量化单元210相同,逆变换处理单元312在功能上可与逆变换处理单元212相同,重建单元314在功能上可与重建单元214相同,环路滤波器320在功能上可与环路滤波器220相同,解码图像缓冲器330在功能上可与解码图像缓冲器230相同。因此,视频编码器20的相应单元和功能的解释相应地适用于视频解码器30的相应单元和功能。As described in encoder 20, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, loop filter 220, decoded picture buffer DPB 230, inter prediction unit 244, and intra prediction unit 254 also constitute a video coding The "built-in decoder" of the device 20. Correspondingly, the inverse quantization unit 310 can be functionally the same as the inverse quantization unit 210, the inverse transform processing unit 312 can be functionally the same as the inverse transform processing unit 212, the reconstruction unit 314 can be functionally the same as the reconstruction unit 214, and the loop The filter 320 may be functionally the same as the loop filter 220 , and the decoded picture buffer 330 may be functionally the same as the decoded picture buffer 230 . Therefore, the explanation of the corresponding elements and functions of the video encoder 20 applies to the corresponding elements and functions of the video decoder 30 accordingly.
熵解码entropy decoding
熵解码单元304用于解析比特流21(或一般为编码图像数据21)并对编码图像数据21执行熵解码,得到量化系数309和/或解码后的编码参数(图3中未示出)等,例如帧间预测参数(例如参考图像索引和运动矢量)、帧内预测参数(例如帧内预测模式或索引)、变换参数、量化参数、环路滤波器参数和/或其它语法元素等中的任一个或全部。熵解码单元304可用于应用编码器20的熵编码单元270的编码方案对应的解码算法或方案。熵解码单元304还可用于向模式应用单元360提供帧间预测参数、帧内预测参数和/或其它语 法元素,以及向解码器30的其它单元提供其它参数。视频解码器30可以接收视频片和/或视频块级的语法元素。此外,或者作为片和相应语法元素的替代,可以接收或使用编码区块组和/或编码区块以及相应语法元素。The entropy decoding unit 304 is used to analyze the bit stream 21 (or generally coded image data 21) and perform entropy decoding on the coded image data 21 to obtain quantization coefficients 309 and/or decoded coding parameters (not shown in FIG. 3 ), etc. , such as inter prediction parameters (such as reference image index and motion vector), intra prediction parameters (such as intra prediction mode or index), transformation parameters, quantization parameters, loop filter parameters and/or other syntax elements, etc. either or all. The entropy decoding unit 304 may be configured to apply a decoding algorithm or scheme corresponding to the encoding scheme of the entropy encoding unit 270 of the encoder 20 . Entropy decoding unit 304 may also be configured to provide inter-prediction parameters, intra-prediction parameters, and/or other syntax elements to mode application unit 360, as well as other parameters to other units of decoder 30. Video decoder 30 may receive video slice and/or video block level syntax elements. Additionally, or instead of slices and corresponding syntax elements, coding block groups and/or coding blocks and corresponding syntax elements may be received or used.
反量化dequantization
反量化单元310可用于从编码图像数据21(例如通过熵解码单元304解析和/或解码)接收量化参数(quantization parameter,QP)(或一般为与反量化相关的信息)和量化系数,并基于所述量化参数对所述解码的量化系数309进行反量化以获得反量化系数311,所述反量化系数311也可以称为变换系数311。反量化过程可包括使用视频编码器20为视频片中的每个视频块计算的量化参数来确定量化程度,同样也确定需要执行的反量化的程度。The inverse quantization unit 310 may be configured to receive a quantization parameter (quantization parameter, QP) (or generally information related to inverse quantization) and quantization coefficients from the encoded image data 21 (for example, parsed and/or decoded by the entropy decoding unit 304), and based on The quantization parameter performs inverse quantization on the decoded quantization coefficient 309 to obtain an inverse quantization coefficient 311 , and the inverse quantization coefficient 311 may also be called a transform coefficient 311 . The inverse quantization process may include using quantization parameters calculated by video encoder 20 for each video block in the video slice to determine the degree of quantization, as well as the degree of inverse quantization that needs to be performed.
逆变换inverse transform
逆变换处理单元312可用于接收反量化系数311,也称为变换系数311,并对反量化系数311应用变换以得到像素域中的重建残差块213。重建残差块213也可称为变换块313。变换可以为逆变换,例如逆DCT、逆DST、逆整数变换或概念上类似的逆变换过程。逆变换处理单元312还可以用于从编码图像数据21(例如通过熵解码单元304解析和/或解码)接收变换参数或相应信息,以确定应用于解量化系数311的变换。The inverse transform processing unit 312 is operable to receive inverse quantization coefficients 311 , also referred to as transform coefficients 311 , and apply a transform to the inverse quantization coefficients 311 to obtain a reconstructed residual block 213 in the pixel domain. The reconstructed residual block 213 may also be referred to as a transform block 313 . The transform may be an inverse transform, such as an inverse DCT, an inverse DST, an inverse integer transform, or a conceptually similar inverse transform process. The inverse transform processing unit 312 may also be configured to receive transform parameters or corresponding information from the encoded image data 21 (eg, parsed and/or decoded by the entropy decoding unit 304 ) to determine the transform to apply to the dequantized coefficients 311 .
重建reconstruction
重建单元314(例如,求和器314)用于将重建残差块313添加到预测块365,以在像素域中得到重建块315,例如,将重建残差块313的像素点值和预测块365的像素点值相加。The reconstruction unit 314 (for example, the summer 314) is used to add the reconstruction residual block 313 to the prediction block 365 to obtain the reconstruction block 315 in the pixel domain, for example, the pixel value of the reconstruction residual block 313 and the prediction block 365 pixel values are added.
滤波filtering
环路滤波器单元320(在编码环路中或之后)用于对重建块315进行滤波,得到滤波块321,从而顺利进行像素转变或提高视频质量等。环路滤波器单元320可包括一个或多个环路滤波器,例如去块滤波器、像素点自适应偏移(sample-adaptive offset,SAO)滤波器或一个或多个其它滤波器,例如自适应环路滤波器(adaptive loop filter,ALF)、噪声抑制滤波器(noise suppression filter,NSF)或任意组合。例如,环路滤波器单元220可以包括去块滤波器、SAO滤波器和ALF滤波器。滤波过程的顺序可以是去块滤波器、SAO滤波器和ALF滤波器。再例如,增加一个称为具有色度缩放的亮度映射(luma mapping with chroma scaling,LMCS)(即自适应环内整形器)的过程。该过程在去块之前执行。再例如,去块滤波过程也可以应用于内部子块边缘,例如仿射子块边缘、ATMVP子块边缘、子块变换(sub-block transform,SBT)边缘和内子部分(intra sub-partition,ISP)边缘。尽管环路滤波器单元320在图3中示为环路滤波器,但在其它配置中,环路滤波器单元320可以实现为环后滤波器。The loop filter unit 320 is used (in the encoding loop or after) to filter the reconstructed block 315 to obtain the filtered block 321 to smooth pixel transformation or improve video quality, etc. The loop filter unit 320 may include one or more loop filters, such as deblocking filters, pixel adaptive offset (sample-adaptive offset, SAO) filters, or one or more other filters, such as auto Adaptive loop filter (ALF), noise suppression filter (NSF), or any combination. For example, the loop filter unit 220 may include a deblocking filter, an SAO filter, and an ALF filter. The order of the filtering process may be deblocking filter, SAO filter and ALF filter. As another example, add a process called luma mapping with chroma scaling (LMCS) (ie adaptive in-loop shaper). This process is performed before deblocking. For another example, the deblocking filtering process can also be applied to internal sub-block edges, such as affine sub-block edges, ATMVP sub-block edges, sub-block transform (sub-block transform, SBT) edges and intra sub-partition (ISP )edge. Although loop filter unit 320 is shown in FIG. 3 as a loop filter, in other configurations, loop filter unit 320 may be implemented as a post-loop filter.
解码图像缓冲器decoded image buffer
随后将一个图像中的解码视频块321存储在解码图像缓冲器330中,解码图像缓冲器330存储作为参考图像的解码图像331,参考图像用于其它图像和/或分别输出显示的后续运动补偿。The decoded video block 321 in one picture is then stored in a decoded picture buffer 330 which stores the decoded picture 331 as a reference picture for subsequent motion compensation in other pictures and/or for respective output display.
解码器30用于通过输出端312等输出解码图像311,向用户显示或供用户查看。The decoder 30 is used to output the decoded image 311 through the output terminal 312 and so on, for displaying or viewing by the user.
预测predict
帧间预测单元344在功能上可与帧间预测单元244(特别是运动补偿单元)相同,帧内预测单元354在功能上可与帧间预测单元254相同,并基于从编码图像数据21(例如通过熵解码单元304解析和/或解码)接收的分割和/或预测参数或相应信息决定划分或分割和执行预测。模式应用单元360可用于根据重建图像、块或相应的像素点(已滤波或未滤波)执行每个块的预测(帧内或帧间预测),得到预测块365。The inter prediction unit 344 may be functionally the same as the inter prediction unit 244 (especially the motion compensation unit), and the intra prediction unit 354 may be functionally the same as the inter prediction unit 254, and is based on the coded image data 21 (eg Partitioning and/or prediction parameters or corresponding information received by the entropy decoding unit 304 (parsed and/or decoded) determines partitioning or partitioning and performs prediction. The mode application unit 360 can be used to perform prediction (intra-frame or inter-frame prediction) for each block according to the reconstructed image, block or corresponding pixels (filtered or unfiltered), to obtain the predicted block 365 .
当将视频片编码为帧内编码(intra coded,I)片时,模式应用单元360中的帧内预测单元354用于根据指示的帧内预测模式和来自当前图像的之前解码块的数据生成用于当前视频片的图像块的预测块365。当视频图像编码为帧间编码(即,B或P)片时,模式应用单元360中的帧间预测单元344(例如运动补偿单元)用于根据运动矢量和从熵解码单元304接收的其它语法元素生成用于当前视频片的视频块的预测块365。对于帧间预测,可从其中一个参考图像列表中的其中一个参考图像产生这些预测块。视频解码器30可以根据存储在DPB 330中的参考图像,使用默认构建技术来构建参考帧列表0和列表1。除了片(例如视频片)或作为片的替代,相同或类似的过程可应用于编码区块组(例如视频编码区块组)和/或编码区块(例如视频编码区块)的实施例,例如视频可以使用I、P或B编码区块组和/或编码区块进行编码。When a video slice is encoded as an intra coded (I) slice, the intra prediction unit 354 in the mode application unit 360 is used to generate an input frame based on the indicated intra prediction mode and data from a previously decoded block of the current picture. A prediction block 365 based on an image block of the current video slice. When video images are encoded as inter-coded (i.e., B or P) slices, inter prediction unit 344 (e.g., motion compensation unit) in mode application unit 360 is used to The element generates a prediction block 365 for a video block of the current video slice. For inter prediction, the predicted blocks may be generated from one of the reference pictures in one of the reference picture lists. Video decoder 30 may construct reference frame list 0 and list 1 from the reference pictures stored in DPB 330 using a default construction technique. In addition to or instead of slices (e.g., video slices), the same or similar process can be applied to embodiments of encoding block groups (e.g., video encoding block groups) and/or encoding blocks (e.g., video encoding blocks), For example video may be encoded using I, P or B coding block groups and/or coding blocks.
模式应用单元360用于通过解析运动矢量和其它语法元素,确定用于当前视频片的视频块的预测信息,并使用预测信息产生用于正在解码的当前视频块的预测块。例如,模式应用单元360使用接收到的一些语法元素确定用于编码视频片的视频块的预测模式(例如帧内预测或帧间预测)、帧间预测片类型(例如B片、P片或GPB片)、用于片的一个或多个参考图像列表的构建信息、用于片的每个帧间编码视频块的运动矢量、用于片的每个帧间编码视频块的帧间预测状态、其它信息,以解码当前视频片内的视频块。除了片(例如视频片)或作为片的替代,相同或类似的过程可应用于编码区块组(例如视频编码区块组)和/或编码区块(例如视频编码区块)的实施例,例如视频可以使用I、P或B编码区块组和/或编码区块进行编码。The mode application unit 360 is configured to determine prediction information for a video block of the current video slice by parsing motion vectors and other syntax elements, and use the prediction information to generate a prediction block for the current video block being decoded. For example, the mode application unit 360 uses some of the received syntax elements to determine the prediction mode (such as intra prediction or inter prediction), the inter prediction slice type (such as B slice, P slice or GPB slice) for encoding the video block of the video slice. slice), construction information for one or more reference picture lists for the slice, motion vectors for each inter-coded video block of the slice, inter prediction state for each inter-coded video block of the slice, Other information to decode video blocks within the current video slice. In addition to or instead of slices (e.g., video slices), the same or similar process can be applied to embodiments of encoding block groups (e.g., video encoding block groups) and/or encoding blocks (e.g., video encoding blocks), For example video may be encoded using I, P or B coding block groups and/or coding blocks.
在一个实施例中,图3的视频编码器30还可以用于使用片(也称为视频片)分割和/或解码图像,其中图像可以使用一个或多个片(通常为不重叠的)进行分割或解码。每个片可包括一个或多个块(例如CTU)或一个或多个块组(例如H.265/HEVC/VVC标准中的编码区块和VVC标准中的砖。In one embodiment, the video encoder 30 of FIG. 3 can also be used to segment and/or decode an image using slices (also called video slices), where an image can be segmented using one or more slices (typically non-overlapping). split or decode. Each slice may include one or more blocks (eg, CTUs) or one or more block groups (eg, coded blocks in the H.265/HEVC/VVC standard and tiles in the VVC standard.
在一个实施例中,图3所示的视频解码器30还可以用于使用片/编码区块组(也称为视频编码区块组)和/或编码区块(也称为视频编码区块)对图像进行分割和/或解码,其中图像可以使用一个或多个片/编码区块组(通常为不重叠的)进行分割或解码,每个片/编码区块组可包括一个或多个块(例如CTU)或一个或多个编码区块等,其中每个编码区块可以为矩形等形状,可包括一个或多个完整或部分块(例如CTU)。In one embodiment, the video decoder 30 shown in FIG. 3 can also be configured to use slices/coded block groups (also called video coded block groups) and/or coded blocks (also called video coded block groups) ) to segment and/or decode an image, where an image may be segmented or decoded using one or more slices/coded block groups (usually non-overlapping), each slice/coded block group may consist of one or more A block (such as a CTU) or one or more coding blocks, etc., wherein each coding block may be in the shape of a rectangle or the like, and may include one or more complete or partial blocks (such as a CTU).
视频解码器30的其它变型可用于对编码图像数据21进行解码。例如,解码器30可以在没有环路滤波器单元320的情况下产生输出视频流。例如,基于非变换的解码器30可以在某些块或帧没有逆变换处理单元312的情况下直接反量化残差信号。在另一种实现方式中,视频解码器30可以具有组合成单个单元的反量化单元310和逆变换处理单元312。Other variants of video decoder 30 may be used to decode encoded image data 21 . For example, decoder 30 may generate an output video stream without loop filter unit 320 . For example, the non-transform based decoder 30 can directly inverse quantize the residual signal if some blocks or frames do not have the inverse transform processing unit 312 . In another implementation, video decoder 30 may have inverse quantization unit 310 and inverse transform processing unit 312 combined into a single unit.
应理解,在编码器20和解码器30中,可以对当前步骤的处理结果进一步处理,然后输出到下一步骤。例如,在插值滤波、运动矢量推导或环路滤波之后,可以对插值滤波、 运动矢量推导或环路滤波的处理结果进行进一步的运算,例如裁剪(clip)或移位(shift)运算。It should be understood that in the encoder 20 and the decoder 30, the processing result of the current step can be further processed, and then output to the next step. For example, after interpolation filtering, motion vector derivation or loop filtering, further operations, such as clipping or shifting operations, may be performed on the processing results of interpolation filtering, motion vector derivation or loop filtering.
应该注意的是,可以对当前块的推导运动矢量(包括但不限于仿射模式的控制点运动矢量、仿射、平面、ATMVP模式的子块运动矢量、时间运动矢量等)进行进一步运算。例如,根据运动矢量的表示位将运动矢量的值限制在预定义范围。如果运动矢量的表示位为bitDepth,则范围为-2^(bitDepth-1)至2^(bitDepth-1)-1,其中“^”表示幂次方。例如,如果bitDepth设置为16,则范围为-32768~32767;如果bitDepth设置为18,则范围为-131072~131071。例如,推导运动矢量的值(例如一个8×8块中的4个4×4子块的MV)被限制,使得所述4个4×4子块MV的整数部分之间的最大差值不超过N个像素,例如不超过1个像素。这里提供了两种根据bitDepth限制运动矢量的方法。It should be noted that further operations can be performed on the derived motion vector of the current block (including but not limited to control point motion vector in affine mode, affine, plane, sub-block motion vector in ATMVP mode, temporal motion vector, etc.). For example, the value of the motion vector is limited to a predefined range according to the representation bits of the motion vector. If the representation bit of the motion vector is bitDepth, the range is -2^(bitDepth-1) to 2^(bitDepth-1)-1, where "^" represents a power. For example, if the bitDepth is set to 16, the range is -32768 to 32767; if the bitDepth is set to 18, the range is -131072 to 131071. For example, the value of deriving a motion vector (e.g. the MVs of 4 4x4 sub-blocks in an 8x8 block) is constrained such that the maximum difference between the integer parts of the 4 4x4 sub-blocks MVs is not More than N pixels, for example, no more than 1 pixel. Here are two ways to limit motion vectors based on bitDepth.
尽管上述实施例主要描述了视频编解码,但应注意的是,译码系统10、编码器20和解码器30的实施例以及本文描述的其它实施例也可以用于静止图像处理或编解码,即视频编解码中独立于任何先前或连续图像的单个图像的处理或编解码。一般情况下,如果图像处理仅限于单个图像17,帧间预测单元244(编码器)和帧间预测单元344(解码器)可能不可用。视频编码器20和视频解码器30的所有其它功能(也称为工具或技术)同样可用于静态图像处理,例如残差计算204/304、变换206、量化208、反量化210/310、(逆)变换212/312、分割262/362、帧内预测254/354和/或环路滤波220/320、熵编码270和熵解码304。Although the above embodiments primarily describe video codecs, it should be noted that embodiments of the decoding system 10, encoder 20, and decoder 30, as well as other embodiments described herein, may also be used for still image processing or codecs, That is, the processing or coding of a single image in a video codec independently of any previous or successive images. In general, if image processing is limited to a single image 17, inter prediction unit 244 (encoder) and inter prediction unit 344 (decoder) may not be available. All other functions (also referred to as tools or techniques) of video encoder 20 and video decoder 30 are equally applicable to still image processing, such as residual calculation 204/304, transform 206, quantization 208, inverse quantization 210/310, (inverse ) transformation 212/312, segmentation 262/362, intra prediction 254/354 and/or loop filtering 220/320, entropy encoding 270 and entropy decoding 304.
本申请实施例提供了一种视频译码设备,在一个实施例中,视频译码设备可以是解码器,例如图1中的视频解码器30,也可以是编码器,例如图1中的视频编码器20。An embodiment of the present application provides a video decoding device. In one embodiment, the video decoding device can be a decoder, such as the video decoder 30 in FIG. 1, or an encoder, such as the video decoder 30 in FIG. 1. Encoder 20.
视频译码设备包括:用于接收数据的入端口(或输入端口)和接收单元(receiver unit,Rx);用于处理数据的处理器、逻辑单元或中央处理器(central processing unit,CPU);例如,这里的处理器可以是神经网络处理器;用于传输数据的发送单元(transmitter unit,Tx)和出端口(或输出端口);用于存储数据的存储器。视频译码设备还可包括耦合到入端口、接收单元、发送单元和出端口的光电(optical-to-electrical,OE)组件和电光(electrical-to-optical,EO)组件,用于光信号或电信号的出口或入口。The video decoding device includes: an input port (or input port) and a receiving unit (receiver unit, Rx) for receiving data; a processor, a logic unit or a central processing unit (central processing unit, CPU) for processing data; For example, the processor here may be a neural network processor; a transmitter unit (transmitter unit, Tx) and an output port (or output port) for transmitting data; and a memory for storing data. The video decoding device may also include an optical-to-electrical (OE) component and an electrical-to-optical (EO) component coupled to the input port, the receiving unit, the transmitting unit and the output port, for optical signals or The exit or entrance of an electrical signal.
处理器通过硬件和软件实现。处理器可实现为一个或多个处理器芯片、核(例如,多核处理器)、FPGA、ASIC和DSP。处理器与入端口、接收单元、发送单元、出端口和存储器通信。处理器包括译码模块(例如,基于神经网络的译码模块)。译码模块实施上文所公开的实施例。例如,译码模块执行、处理、准备或提供各种编码操作。因此,通过译码模块为视频译码设备的功能提供了实质性的改进,并且影响了视频译码设备到不同状态的切换。或者,以存储在存储器中并由处理器执行的指令来实现译码模块。Processors are implemented in hardware and software. A processor may be implemented as one or more processor chips, cores (eg, multi-core processors), FPGAs, ASICs, and DSPs. The processor communicates with the ingress port, the receiving unit, the transmitting unit, the egress port and the memory. The processor includes a decoding module (eg, a neural network based decoding module). The coding module implements the embodiments disclosed above. For example, the decoding module performs, processes, prepares, or provides various encoding operations. Thus, a substantial improvement in the functionality of the video decoding device is provided by the decoding module and the switching of the video decoding device to different states is effected. Alternatively, the decode module is implemented as instructions stored in memory and executed by a processor.
存储器包括一个或多个磁盘、磁带机和固态硬盘,可以用作溢出数据存储设备,用于在选择执行程序时存储此类程序,并且存储在程序执行过程中读取的指令和数据。存储器可以是易失性和/或非易失性的,可以是只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、三态内容寻址存储器(ternary content-addressable memory,TCAM)和/或静态随机存取存储器(static random-access memory,SRAM)。Memory, including one or more magnetic disks, tape drives, and solid-state drives, may be used as an overflow data storage device for storing programs when such programs are selected for execution, and for storing instructions and data that are read during program execution. Memory can be volatile and/or nonvolatile, and can be read-only memory (ROM), random access memory (RAM), ternary content -addressable memory, TCAM) and/or static random-access memory (static random-access memory, SRAM).
本申请实施例提供了一种装置,可以包括处理器、存储器和总线。该装置可用作图1中的源设备12和目的设备14中的任一个或两个。An embodiment of the present application provides an apparatus, which may include a processor, a memory, and a bus. The apparatus may be used as either or both of source device 12 and destination device 14 in FIG. 1 .
装置中的处理器可以是中央处理器。或者,处理器可以是现有的或今后将研发出的能够操控或处理信息的任何其它类型设备或多个设备。虽然可以使用如图所示的处理器等单个处理器来实施已公开的实现方式,但使用一个以上的处理器速度更快和效率更高。The processor in the device may be a central processing unit. Alternatively, a processor may be any other type or devices, existing or later developed, capable of manipulating or processing information. While the disclosed implementations can be implemented using a single processor, such as the one shown, it is faster and more efficient to use more than one processor.
在一种实现方式中,装置中的存储器可以是只读存储器(ROM)设备或随机存取存储器(RAM)设备。任何其它合适类型的存储设备都可以用作存储器。存储器可以包括处理器通过总线访问的代码和数据。存储器还可包括操作系和应用程序,应用程序包括允许处理器执行本文所述方法的至少一个程序。例如,应用程序可以包括应用1至N,还包括执行本文所述方法的视频译码应用。In one implementation, the memory in the apparatus may be a read only memory (ROM) device or a random access memory (RAM) device. Any other suitable type of storage device may be used as memory. The memory can include code and data accessed by the processor through the bus. The memory may also include an operating system and application programs, including at least one program that allows the processor to perform the methods described herein. For example, the application programs may include applications 1 through N, and also include a video coding application that performs the methods described herein.
装置还可以包括一个或多个输出设备,例如显示器。在一个示例中,显示器可以是将显示器与可用于感测触摸输入的触敏元件组合的触敏显示器。显示器可以通过总线耦合到处理器。An apparatus may also include one or more output devices, such as displays. In one example, the display can be a touch sensitive display that combines the display with touch sensitive elements that can be used to sense touch input. A display can be coupled to the processor via a bus.
虽然装置中的总线在本文中描述为单个总线,但是总线可以包括多个总线。此外,辅助储存器可以直接耦合到装置的其它组件或通过网络访问,并且可以包括存储卡等单个集成单元或多个存储卡等多个单元。因此,装置可以具有各种各样的配置。Although the bus in the device is described herein as a single bus, the bus may include multiple buses. Additionally, secondary storage may be directly coupled to other components of the device or accessed over a network, and may comprise a single integrated unit such as a memory card or multiple units such as multiple memory cards. Accordingly, the device may have a wide variety of configurations.
由于本申请实施例涉及神经网络的应用,为了便于理解,下面先对本申请实施例所使用到的一些名词或术语进行解释说明,该名词或术语也作为发明内容的一部分。Since the embodiment of the present application involves the application of a neural network, for ease of understanding, some nouns or terms used in the embodiment of the present application are firstly explained below, and the nouns or terms are also part of the summary of the invention.
(1)神经网络(1) neural network
神经网络(neural network,NN)是机器学习模型,神经网络可以是由神经单元组成的,神经单元可以是指以xs和截距1为输入的运算单元,该运算单元的输出可以为:Neural network (neural network, NN) is a machine learning model. A neural network can be composed of neural units. A neural unit can refer to a computing unit that takes xs and intercept 1 as input. The output of the computing unit can be:
Figure PCTCN2022110827-appb-000001
Figure PCTCN2022110827-appb-000001
其中,s=1、2、……n,n为大于1的自然数,Ws为xs的权重,b为神经单元的偏置。f为神经单元的激活函数(activation functions),用于将非线性特性引入神经网络中,来将神经单元中的输入信号转换为输出信号。该激活函数的输出信号可以作为下一层卷积层的输入。激活函数可以是sigmoid函数。神经网络是将许多个上述单一的神经单元联结在一起形成的网络,即一个神经单元的输出可以是另一个神经单元的输入。每个神经单元的输入可以与前一层的局部接受域相连,来提取局部接受域的特征,局部接受域可以是由若干个神经单元组成的区域。Wherein, s=1, 2, ... n, n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer. The activation function may be a sigmoid function. A neural network is a network formed by connecting many of the above-mentioned single neural units, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected with the local receptive field of the previous layer to extract the features of the local receptive field. The local receptive field can be an area composed of several neural units.
(2)深度神经网络(2) Deep Neural Network
深度神经网络(deep neural network,DNN),也称多层神经网络,可以理解为具有很多层隐含层的神经网络,这里的“很多”并没有特别的度量标准。从DNN按不同层的位置划分,DNN内部的神经网络可以分为三类:输入层,隐含层,输出层。一般来说第一层是输入层,最后一层是输出层,中间的层数都是隐含层。层与层之间是全连接的,也就是说,第i层的任意一个神经元一定与第i+1层的任意一个神经元相连。虽然DNN看起来很复杂,但是就每一层的工作来说,其实并不复杂,简单来说就是如下线性关系表达式:
Figure PCTCN2022110827-appb-000002
Figure PCTCN2022110827-appb-000003
其中,
Figure PCTCN2022110827-appb-000004
是输入向量,
Figure PCTCN2022110827-appb-000005
是输出向量,
Figure PCTCN2022110827-appb-000006
是偏移向量,W是权重矩阵(也称系数),α()是激活函数。每一层仅仅是对输入向量
Figure PCTCN2022110827-appb-000007
经过如此简单的操作得到输出向量
Figure PCTCN2022110827-appb-000008
由于DNN层数多,则系数W和偏移向量
Figure PCTCN2022110827-appb-000009
的数量也就很多了。这些参数在DNN中的定义如下所述:以系数W为例:假设在一个三层的DNN中,第二层的第4个神经元到第三层的第2个神经元的线性系数定义为
Figure PCTCN2022110827-appb-000010
上标3代表系数W所在的层数,而下标对应的是输出的第三 层索引2和输入的第二层索引4。总结就是:第L-1层的第k个神经元到第L层的第j个神经元的系数定义为
Figure PCTCN2022110827-appb-000011
需要注意的是,输入层是没有W参数的。在深度神经网络中,更多的隐含层让网络更能够刻画现实世界中的复杂情形。理论上而言,参数越多的模型复杂度越高,“容量”也就越大,也就意味着它能完成更复杂的学习任务。训练深度神经网络的也就是学习权重矩阵的过程,其最终目的是得到训练好的深度神经网络的所有层的权重矩阵(由很多层的向量W形成的权重矩阵)。
A deep neural network (DNN), also known as a multilayer neural network, can be understood as a neural network with many hidden layers, and there is no special metric for the "many" here. According to the position of different layers of DNN, the neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in the middle are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer. Although DNN looks complicated, it is actually not complicated in terms of the work of each layer. In simple terms, it is the following linear relationship expression:
Figure PCTCN2022110827-appb-000002
Figure PCTCN2022110827-appb-000003
in,
Figure PCTCN2022110827-appb-000004
is the input vector,
Figure PCTCN2022110827-appb-000005
is the output vector,
Figure PCTCN2022110827-appb-000006
Is the offset vector, W is the weight matrix (also called coefficient), and α() is the activation function. Each layer is just an input vector
Figure PCTCN2022110827-appb-000007
After such a simple operation to get the output vector
Figure PCTCN2022110827-appb-000008
Due to the large number of DNN layers, the coefficient W and the offset vector
Figure PCTCN2022110827-appb-000009
The number is also a lot. The definition of these parameters in DNN is as follows: Take the coefficient W as an example: Assume that in a three-layer DNN, the linear coefficient from the fourth neuron of the second layer to the second neuron of the third layer is defined as
Figure PCTCN2022110827-appb-000010
The superscript 3 represents the layer number of the coefficient W, and the subscript corresponds to the output third layer index 2 and the input second layer index 4. The summary is: the coefficient of the kth neuron of the L-1 layer to the jth neuron of the L layer is defined as
Figure PCTCN2022110827-appb-000011
It should be noted that the input layer has no W parameter. In deep neural networks, more hidden layers make the network more capable of describing complex situations in the real world. Theoretically speaking, a model with more parameters has a higher complexity and a greater "capacity", which means that it can complete more complex learning tasks. Training the deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (the weight matrix formed by the vector W of many layers).
(3)卷积神经网络(3) Convolutional neural network
卷积神经网络(convolutional neuron network,CNN)是一种带有卷积结构的深度神经网络,是一种深度学习(deep learning)架构,深度学习架构是指通过机器学习的算法,在不同的抽象层级上进行多个层次的学习。作为一种深度学习架构,CNN是一种前馈(feed-forward)人工神经网络,该前馈人工神经网络中的各个神经元可以对输入其中的图像作出响应。卷积神经网络包含了一个由卷积层和池化层构成的特征抽取器。该特征抽取器可以看作是滤波器,卷积过程可以看作是使用一个可训练的滤波器与一个输入的图像或者卷积特征平面(feature map)做卷积。Convolutional neural network (CNN) is a deep neural network with a convolutional structure. It is a deep learning (deep learning) architecture. Multiple levels of learning are carried out at the level. As a deep learning architecture, CNN is a feed-forward artificial neural network in which individual neurons can respond to images input into it. A convolutional neural network consists of a feature extractor consisting of convolutional and pooling layers. The feature extractor can be seen as a filter, and the convolution process can be seen as using a trainable filter to convolve with an input image or convolutional feature map.
卷积层是指卷积神经网络中对输入信号进行卷积处理的神经元层。卷积层可以包括很多个卷积算子,卷积算子也称为核,其在图像处理中的作用相当于一个从输入图像矩阵中提取特定信息的过滤器,卷积算子本质上可以是一个权重矩阵,这个权重矩阵通常被预先定义,在对图像进行卷积操作的过程中,权重矩阵通常在输入图像上沿着水平方向一个像素接着一个像素(或两个像素接着两个像素……这取决于步长stride的取值)的进行处理,从而完成从图像中提取特定特征的工作。该权重矩阵的大小应该与图像的大小相关,需要注意的是,权重矩阵的纵深维度(depth dimension)和输入图像的纵深维度是相同的,在进行卷积运算的过程中,权重矩阵会延伸到输入图像的整个深度。因此,和一个单一的权重矩阵进行卷积会产生一个单一纵深维度的卷积化输出,但是大多数情况下不使用单一权重矩阵,而是应用多个尺寸(行×列)相同的权重矩阵,即多个同型矩阵。每个权重矩阵的输出被堆叠起来形成卷积图像的纵深维度,这里的维度可以理解为由上面所述的“多个”来决定。不同的权重矩阵可以用来提取图像中不同的特征,例如一个权重矩阵用来提取图像边缘信息,另一个权重矩阵用来提取图像的特定颜色,又一个权重矩阵用来对图像中不需要的噪点进行模糊化等。该多个权重矩阵尺寸(行×列)相同,经过该多个尺寸相同的权重矩阵提取后的特征图的尺寸也相同,再将提取到的多个尺寸相同的特征图合并形成卷积运算的输出。这些权重矩阵中的权重值在实际应用中需要经过大量的训练得到,通过训练得到的权重值形成的各个权重矩阵可以用来从输入图像中提取信息,从而使得卷积神经网络进行正确的预测。当卷积神经网络有多个卷积层的时候,初始的卷积层往往提取较多的一般特征,该一般特征也可以称之为低级别的特征;随着卷积神经网络深度的加深,越往后的卷积层提取到的特征越来越复杂,比如高级别的语义之类的特征,语义越高的特征越适用于待解决的问题。The convolutional layer refers to the neuron layer that performs convolution processing on the input signal in the convolutional neural network. The convolution layer can include many convolution operators, which are also called kernels, and their role in image processing is equivalent to a filter that extracts specific information from the input image matrix. The convolution operator can essentially Is a weight matrix, this weight matrix is usually pre-defined, in the process of convolution operation on the image, the weight matrix is usually along the horizontal direction of the input image pixel by pixel (or two pixels by two pixels... ...This depends on the value of the stride) to complete the work of extracting specific features from the image. The size of the weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix is the same as the depth dimension of the input image. During the convolution operation, the weight matrix will be extended to The entire depth of the input image. Therefore, convolution with a single weight matrix will produce a convolutional output with a single depth dimension, but in most cases instead of using a single weight matrix, multiple weight matrices of the same size (row×column) are applied, That is, multiple matrices of the same shape. The output of each weight matrix is stacked to form the depth dimension of the convolution image, where the dimension can be understood as determined by the "multiple" mentioned above. Different weight matrices can be used to extract different features in the image. For example, one weight matrix is used to extract image edge information, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to filter unwanted noise in the image. Do blurring etc. The multiple weight matrices have the same size (row×column), and the feature maps extracted by the multiple weight matrices of the same size are also of the same size, and then the extracted multiple feature maps of the same size are combined to form the convolution operation. output. The weight values in these weight matrices need to be obtained through a lot of training in practical applications, and each weight matrix formed by the weight values obtained through training can be used to extract information from the input image, so that the convolutional neural network can make correct predictions. When the convolutional neural network has multiple convolutional layers, the initial convolutional layer often extracts more general features, which can also be called low-level features; as the depth of the convolutional neural network deepens, The features extracted by the later convolutional layers become more and more complex, such as high-level semantic features, and the higher semantic features are more suitable for the problem to be solved.
由于常常需要减少训练参数的数量,因此卷积层之后常常需要周期性的引入池化层,可以是一层卷积层后面跟一层池化层,也可以是多层卷积层后面接一层或多层池化层。在图像处理过程中,池化层的唯一目的就是减少图像的空间大小。池化层可以包括平均池化算子和/或最大池化算子,以用于对输入图像进行采样得到较小尺寸的图像。平均池化算子 可以在特定范围内对图像中的像素值进行计算产生平均值作为平均池化的结果。最大池化算子可以在特定范围内取该范围内值最大的像素作为最大池化的结果。另外,就像卷积层中用权重矩阵的大小应该与图像尺寸相关一样,池化层中的运算符也应该与图像的大小相关。通过池化层处理后输出的图像尺寸可以小于输入池化层的图像的尺寸,池化层输出的图像中每个像素点表示输入池化层的图像的对应子区域的平均值或最大值。Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after a convolutional layer. It can be a convolutional layer followed by a pooling layer, or a multi-layer convolutional layer followed by a pooling layer. layer or multiple pooling layers. In image processing, the sole purpose of pooling layers is to reduce the spatial size of the image. The pooling layer may include an average pooling operator and/or a maximum pooling operator for sampling an input image to obtain an image of a smaller size. The average pooling operator can calculate the pixel value in the image within a specific range to generate an average value as the result of average pooling. The maximum pooling operator can take the pixel with the largest value within a specific range as the result of maximum pooling. Also, just like the size of the weight matrix used in the convolutional layer should be related to the size of the image, the operators in the pooling layer should also be related to the size of the image. The size of the image output after being processed by the pooling layer may be smaller than the size of the image input to the pooling layer, and each pixel in the image output by the pooling layer represents the average or maximum value of the corresponding sub-region of the image input to the pooling layer.
在经过卷积层/池化层的处理后,卷积神经网络还不足以输出所需要的输出信息。因为如前所述,卷积层/池化层只会提取特征,并减少输入图像带来的参数。然而为了生成最终的输出信息(所需要的类信息或其他相关信息),卷积神经网络需要利用神经网络层来生成一个或者一组所需要的类的数量的输出。因此,在神经网络层中可以包括多层隐含层,该多层隐含层中所包含的参数可以根据具体的任务类型的相关训练数据进行预先训练得到,例如该任务类型可以包括图像识别,图像分类,图像超分辨率重建等等。After being processed by the convolutional layer/pooling layer, the convolutional neural network is not enough to output the required output information. Because as mentioned earlier, the convolutional layer/pooling layer only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (required class information or other relevant information), the convolutional neural network needs to use the neural network layer to generate an output of one or a set of required classes. Therefore, the neural network layer can include multiple hidden layers, and the parameters contained in the multi-layer hidden layers can be pre-trained according to the relevant training data of the specific task type. For example, the task type can include image recognition, Image classification, image super-resolution reconstruction and more.
可选的,在神经网络层中的多层隐含层之后,还包括整个卷积神经网络的输出层,该输出层具有类似分类交叉熵的损失函数,具体用于计算预测误差,一旦整个卷积神经网络的前向传播完成,反向传播就会开始更新前面提到的各层的权重值以及偏差,以减少卷积神经网络的损失,及卷积神经网络通过输出层输出的结果和理想结果之间的误差。Optionally, after the multi-layer hidden layers in the neural network layer, the output layer of the entire convolutional neural network is also included. This output layer has a loss function similar to the classification cross entropy, which is specifically used to calculate the prediction error. Once the entire volume After the forward propagation of the convolutional neural network is completed, the backpropagation will start to update the weight values and deviations of the aforementioned layers to reduce the loss of the convolutional neural network, and the results and ideal output of the convolutional neural network through the output layer The error between the results.
(4)循环神经网络(4) Recurrent neural network
循环神经网络(recurrent neural networks,RNN)是用来处理序列数据的。在传统的神经网络模型中,是从输入层到隐含层再到输出层,层与层之间是全连接的,而对于每一层层内之间的各个节点是无连接的。这种普通的神经网络虽然解决了很多难题,但是却仍然对很多问题却无能无力。例如,你要预测句子的下一个单词是什么,一般需要用到前面的单词,因为一个句子中前后单词并不是独立的。RNN之所以称为循环神经网路,即一个序列当前的输出与前面的输出也有关。具体的表现形式为网络会对前面的信息进行记忆并应用于当前输出的计算中,即隐含层本层之间的节点不再无连接而是有连接的,并且隐含层的输入不仅包括输入层的输出还包括上一时刻隐含层的输出。理论上,RNN能够对任何长度的序列数据进行处理。对于RNN的训练和对传统的CNN或DNN的训练一样。同样使用误差反向传播算法,不过有一点区别:即,如果将RNN进行网络展开,那么其中的参数,如W,是共享的;而如上举例上述的传统神经网络却不是这样。并且在使用梯度下降算法中,每一步的输出不仅依赖当前步的网络,还依赖前面若干步网络的状态。该学习算法称为基于时间的反向传播算法(Back propagation Through Time,BPTT)。Recurrent neural networks (RNN) are used to process sequence data. In the traditional neural network model, from the input layer to the hidden layer to the output layer, the layers are fully connected, and each node in each layer is unconnected. Although this ordinary neural network solves many problems, it is still powerless to many problems. For example, if you want to predict what the next word in a sentence is, you generally need to use the previous words, because the preceding and following words in a sentence are not independent. The reason why RNN is called a recurrent neural network is that the current output of a sequence is also related to the previous output. The specific manifestation is that the network will remember the previous information and apply it to the calculation of the current output, that is, the nodes between the hidden layer and the current layer are no longer connected but connected, and the input of the hidden layer not only includes The output of the input layer also includes the output of the hidden layer at the previous moment. In theory, RNN can process sequence data of any length. The training of RNN is the same as that of traditional CNN or DNN. The error backpropagation algorithm is also used, but there is a difference: that is, if the RNN is expanded to the network, then the parameters, such as W, are shared; while the above-mentioned traditional neural network is not the case. And in the gradient descent algorithm, the output of each step depends not only on the network of the current step, but also depends on the state of the previous several steps of the network. This learning algorithm is called Back propagation Through Time (BPTT) based on time.
既然已经有了卷积神经网络,为什么还要循环神经网络?原因很简单,在卷积神经网络中,有一个前提假设是:元素之间是相互独立的,输入与输出也是独立的,比如猫和狗。但现实世界中,很多元素都是相互连接的,比如股票随时间的变化,再比如一个人说了:我喜欢旅游,其中最喜欢的地方是云南,以后有机会一定要去。这里填空,人类应该都知道是填“云南”。因为人类会根据上下文的内容进行推断,但如何让机器做到这一步?RNN就应运而生了。RNN旨在让机器像人一样拥有记忆的能力。因此,RNN的输出就需要依赖当前的输入信息和历史的记忆信息。Since there are already convolutional neural networks, why do we need recurrent neural networks? The reason is simple. In the convolutional neural network, there is a premise that the elements are independent of each other, and the input and output are also independent, such as cats and dogs. But in the real world, many elements are interconnected, such as the change of stocks over time, or a person said: I like to travel, and my favorite place is Yunnan, and I must go there in the future. Fill in the blank here, humans should know that it is to fill in "Yunnan". Because humans will infer based on the content of the context, but how to make the machine do this? RNN came into being. RNN is designed to allow machines to have the ability to remember like humans. Therefore, the output of RNN needs to depend on the current input information and historical memory information.
(5)损失函数(5) Loss function
在训练深度神经网络的过程中,因为希望深度神经网络的输出尽可能的接近真正想要预测的值,所以可以通过比较当前网络的预测值和真正想要的目标值,再根据两者之间的 差异情况来更新每一层神经网络的权重向量(当然,在第一次更新之前通常会有初始化的过程,即为深度神经网络中的各层预先配置参数),比如,如果网络的预测值高了,就调整权重向量让它预测低一些,不断的调整,直到深度神经网络能够预测出真正想要的目标值或与真正想要的目标值非常接近的值。因此,就需要预先定义“如何比较预测值和目标值之间的差异”,这便是损失函数(loss function)或目标函数(objective function),它们是用于衡量预测值和目标值的差异的重要方程。其中,以损失函数举例,损失函数的输出值(loss)越高表示差异越大,那么深度神经网络的训练就变成了尽可能缩小这个loss的过程。In the process of training the deep neural network, because it is hoped that the output of the deep neural network is as close as possible to the value you really want to predict, you can compare the predicted value of the current network with the target value you really want, and then according to the difference between the two to update the weight vector of each layer of the neural network (of course, there is usually an initialization process before the first update, that is, to pre-configure parameters for each layer in the deep neural network), for example, if the predicted value of the network If it is high, adjust the weight vector to make it predict lower, and keep adjusting until the deep neural network can predict the real desired target value or a value very close to the real desired target value. Therefore, it is necessary to pre-define "how to compare the difference between the predicted value and the target value", which is the loss function (loss function) or objective function (objective function), which is used to measure the difference between the predicted value and the target value important equation. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference. Then the training of the deep neural network becomes a process of reducing the loss as much as possible.
(6)反向传播算法(6) Back propagation algorithm
卷积神经网络可以采用误差反向传播(back propagation,BP)算法在训练过程中修正初始的超分辨率模型中参数的大小,使得超分辨率模型的重建误差损失越来越小。具体地,前向传递输入信号直至输出会产生误差损失,通过反向传播误差损失信息来更新初始的超分辨率模型中参数,从而使误差损失收敛。反向传播算法是以误差损失为主导的反向传播运动,旨在得到最优的超分辨率模型的参数,例如权重矩阵。The convolutional neural network can use the error back propagation (back propagation, BP) algorithm to correct the size of the parameters in the initial super-resolution model during the training process, so that the reconstruction error loss of the super-resolution model becomes smaller and smaller. Specifically, passing the input signal forward until the output will generate an error loss, and updating the parameters in the initial super-resolution model by backpropagating the error loss information, so that the error loss converges. The backpropagation algorithm is a backpropagation movement dominated by error loss, aiming to obtain the parameters of the optimal super-resolution model, such as the weight matrix.
(7)生成式对抗网络(7) Generative confrontation network
生成式对抗网络(generative adversarial networks,GAN)是一种深度学习模型。该模型中至少包括两个模块:一个模块是生成模型(Generative Model),另一个模块是判别模型(Discriminative Model),通过这两个模块互相博弈学习,从而产生更好的输出。生成模型和判别模型都可以是神经网络,具体可以是深度神经网络,或者卷积神经网络。GAN的基本原理如下:以生成图片的GAN为例,假设有两个网络,G(Generator)和D(Discriminator),其中G是一个生成图片的网络,它接收一个随机的噪声z,通过这个噪声生成图片,记做G(z);D是一个判别网络,用于判别一张图片是不是“真实的”。它的输入参数是x,x代表一张图片,输出D(x)代表x为真实图片的概率,如果为1,就代表100%是真实的图片,如果为0,就代表不可能是真实的图片。在对该生成式对抗网络进行训练的过程中,生成网络G的目标就是尽可能生成真实的图片去欺骗判别网络D,而判别网络D的目标就是尽量把G生成的图片和真实的图片区分开来。这样,G和D就构成了一个动态的“博弈”过程,也即“生成式对抗网络”中的“对抗”。最后博弈的结果,在理想的状态下,G可以生成足以“以假乱真”的图片G(z),而D难以判定G生成的图片究竟是不是真实的,即D(G(z))=0.5。这样就得到了一个优异的生成模型G,它可以用来生成图片。Generative adversarial networks (GAN) is a deep learning model. The model includes at least two modules: one module is a Generative Model, and the other is a Discriminative Model. These two modules learn from each other through games to produce better output. Both the generative model and the discriminative model can be neural networks, specifically deep neural networks or convolutional neural networks. The basic principle of GAN is as follows: Taking the GAN that generates pictures as an example, suppose there are two networks, G (Generator) and D (Discriminator), where G is a network that generates pictures, which receives a random noise z, and passes this noise Generate a picture, denoted as G(z); D is a discriminant network, used to determine whether a picture is "real". Its input parameter is x, x represents a picture, and the output D(x) represents the probability that x is a real picture. If it is 1, it means that 100% is a real picture. If it is 0, it means that it cannot be real. picture. In the process of training the generative confrontation network, the goal of the generation network G is to generate real pictures as much as possible to deceive the discriminant network D, and the goal of the discriminant network D is to distinguish the pictures generated by G from the real pictures as much as possible. Come. In this way, G and D constitute a dynamic "game" process, which is the "confrontation" in the "generative confrontation network". As a result of the final game, in an ideal state, G can generate a picture G(z) that is enough to "disguise the real one", but it is difficult for D to determine whether the picture generated by G is real, that is, D(G(z)) = 0.5. In this way, an excellent generative model G is obtained, which can be used to generate pictures.
图5为本申请实施例提供的一个应用场景的示意图,图5以数据包括图像/视频为例进行说明。该应用场景是设备获取图像/视频,对获取到的图像/视频进行熵编码得到码流并存储码流。后续需要输出图像/视频时,对码流进行熵解码得到图像/视频。该设备可以集成有前述源设备和目的设备的功能。Fig. 5 is a schematic diagram of an application scenario provided by an embodiment of the present application, and Fig. 5 is illustrated by taking data including images/videos as an example. The application scenario is that the device acquires images/videos, performs entropy encoding on the acquired images/videos to obtain code streams, and stores the code streams. When the image/video needs to be output subsequently, the code stream is entropy decoded to obtain the image/video. The device may integrate the functions of the aforementioned source device and destination device.
如图5所示,该设备包括编码网络、超编码网络、熵编码网络、保存模块、加载模块、超解码网络、熵解码网络和解码网络。编码网络用于对输入的图像/视频进行特征提取,得到冗余度较低的特征图像/视频。超编码网络用于估计得到特征图像/视频中每个特征元素的估计概率值。之后熵编码模块用于根据每个特征元素的估计概率值对相应的特征元素进行熵编码,得到码流并通过保存模块存储码流。后续加载模块可以加载该码流,超解码网 络用于估计得到码流中对应每个特征元素的码流的估计概率值。熵解码模块用于根据对应每个特征元素的码流的估计概率值对相应码流进行熵解码,得到特征图像/视频。解码网络用于对特征图像/视频进行反特征提取,得到图像/视频。As shown in Figure 5, the device includes an encoding network, a super-encoding network, an entropy encoding network, a saving module, a loading module, a super-decoding network, an entropy decoding network and a decoding network. The encoding network is used to extract features from the input images/videos to obtain feature images/videos with low redundancy. The super-encoding network is used to estimate the estimated probability value of each feature element in the feature image/video. Then the entropy encoding module is used to perform entropy encoding on the corresponding feature element according to the estimated probability value of each feature element to obtain the code stream and store the code stream through the saving module. The subsequent loading module can load the code stream, and the super decoding network is used to estimate the estimated probability value of the code stream corresponding to each feature element in the code stream. The entropy decoding module is used to perform entropy decoding on the corresponding code stream according to the estimated probability value of the code stream corresponding to each feature element to obtain the feature image/video. The decoding network is used to perform inverse feature extraction on feature images/videos to obtain images/videos.
应当理解的,设备对图像/视频进行压缩处理是为了节省存储空间。可选地,设备可以将压缩图像/视频存储在相册或云相册。It should be understood that the device compresses the image/video to save storage space. Optionally, the device can store compressed images/videos in an album or a cloud album.
图6本申请实施例提供的另一个应用场景的示意图,图6以数据包括图像/视频为例进行说明。该应用场景是本地获取图像/视频,对获取到的数据进行图像(JPEG)编码得到压缩图像/视频,之后向云端发送压缩图像/视频。云端对压缩图像/视频进行JPEG解码得到图像/视频,之后对图像/视频进行熵编码得到码流并存储码流。后续本地需要从云端获取图像/视频时,云端对码流进行熵解码得到图像/视频,之后对图像/视频进行JPEG编码,得到压缩图像/视频,向本地发送压缩图像/视频。本地对压缩图像/视频进行JPEG解码得到图像/视频。该云端可以集成有前述源设备和目的设备的功能。云端的结构以及各个模块的用途可以参考图5的结构以及各个模块的用途,本申请实施例在此不做赘述。FIG. 6 is a schematic diagram of another application scenario provided by the embodiment of the present application. FIG. 6 is illustrated by taking data including images/videos as an example. The application scenario is to acquire images/videos locally, perform image (JPEG) encoding on the acquired data to obtain compressed images/videos, and then send compressed images/videos to the cloud. The cloud performs JPEG decoding on the compressed image/video to obtain the image/video, and then performs entropy encoding on the image/video to obtain the code stream and store the code stream. When the local needs to obtain images/videos from the cloud, the cloud performs entropy decoding on the code stream to obtain images/videos, and then JPEG encodes the images/videos to obtain compressed images/videos, and sends compressed images/videos to the local. Locally perform JPEG decoding on compressed images/videos to obtain images/videos. The cloud may be integrated with the functions of the aforementioned source device and destination device. For the structure of the cloud and the usage of each module, reference may be made to the structure of FIG. 5 and the usage of each module, and the embodiment of the present application will not repeat them here.
应当理解的,本地或云端对获取到的数据进行JPEG编码是为了减少传输带宽,云端对图像/视频进行压缩处理是为了节省存储空间。It should be understood that JPEG encoding is performed locally or on the cloud to reduce transmission bandwidth, and image/video compression is performed on the cloud to save storage space.
本申请实施例的方法可以应用于端到端(end-to-end,etoe)编解码架构。请参考图7,图7为本申请实施例提供的一种端到端编解码架构中编码器的结构示意图。如图7所示,该编码器包括编码网络、量化模块、超编码网络、超解码网络和熵编码模块。编码网络用于对输入的当前数据流进行特征提取,得到特征数据。量化模块用于对特征数据进行量化,量化后的特征数据经过超编码网络后得到边信息的码流2。码流2经过超解码网络得到边信息。熵编码模块用于利用边信息对输入的特征数据进行熵编码得到码流1。The method in the embodiment of the present application may be applied to an end-to-end (end-to-end, etoe) codec architecture. Please refer to FIG. 7 , which is a schematic structural diagram of an encoder in an end-to-end encoding and decoding architecture provided by an embodiment of the present application. As shown in Figure 7, the encoder includes an encoding network, a quantization module, a super-encoding network, a super-decoding network and an entropy encoding module. The encoding network is used to perform feature extraction on the input current data stream to obtain feature data. The quantization module is used to quantize the feature data, and the quantized feature data passes through the super-encoding network to obtain the code stream 2 of side information. Code stream 2 gets side information through the super decoding network. The entropy encoding module is used to perform entropy encoding on the input feature data by using side information to obtain code stream 1 .
请参考图8,图8为本申请实施例提供的一种端到端编解码架构中解码器的结构示意图。如图8所示,该解码器包括解码网络、熵解码模块和超解码网络。码流2经过超解码网络解码得到边信息,熵解码模块用于根据边信息对码流1进行熵解码,得到特征数据。解码网络用于对特征数据进行反特征提取,得到当前数据流。Please refer to FIG. 8 , which is a schematic structural diagram of a decoder in an end-to-end codec architecture provided by an embodiment of the present application. As shown in Figure 8, the decoder includes a decoding network, an entropy decoding module and a super decoding network. The code stream 2 is decoded by the super-decoding network to obtain side information, and the entropy decoding module is used to perform entropy decoding on the code stream 1 according to the side information to obtain feature data. The decoding network is used to perform anti-feature extraction on the feature data to obtain the current data stream.
本申请实施例提供的熵编解码方法中,编码器可以获取参照信息,之后根据参照信息估计得到待编码数据的估计概率分布,利用待编码数据的估计概率分布对待编码数据进行熵编码得到码流。解码器可以获取参照信息,之后根据参照信息估计得到码流的估计概率分布,利用码流的估计概率分布对码流进行熵解码。参照信息可以包括第一上下文信息和/或第一边信息,进一步地,参照信息还可以包括第二上下文信息和第二边信息。In the entropy encoding and decoding method provided in the embodiment of the present application, the encoder can obtain reference information, and then estimate the estimated probability distribution of the data to be encoded according to the reference information, and use the estimated probability distribution of the data to be encoded to perform entropy encoding on the data to be encoded to obtain a code stream . The decoder can obtain the reference information, and then estimate the estimated probability distribution of the code stream according to the reference information, and perform entropy decoding on the code stream by using the estimated probability distribution of the code stream. The reference information may include first context information and/or first side information, and further, the reference information may further include second context information and second side information.
在对当前数据流包括的待编码数据进行熵编码时,当前数据流包括多个数据,第一上下文信息是将多个数据中的至少一个已编码数据输入自注意力解码网络得到的,第一边信息是将当前数据流中的多个数据输入自注意力编码网络得到的。第二上下文信息是将至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的。第二边信息是将多个数据中符合预设条件的至少一个数据输入超编码网络得到的。When performing entropy encoding on the data to be encoded included in the current data stream, the current data stream includes multiple data, the first context information is obtained by inputting at least one encoded data in the multiple data into the self-attention decoding network, the first Side information is obtained by feeding multiple data in the current data stream into the self-attention encoding network. The second context information is obtained by inputting at least one of the at least one coded data meeting the preset condition into the masked convolutional network. The second side information is obtained by inputting at least one data meeting the preset condition among the multiple data into the supercoding network.
至少一个已编码数据中符合预设条件的至少一个数据可以包括已编码数据中与待编码数据近邻的至少一个数据。对于一维数据,与待编码数据近邻可以是待编码数据的前m位已编码数据,m>0。对于二维数据,与待编码数据近邻可以是待编码数据的相邻数据,或者是待编码数据的外围n圈数据中的已编码数据等,n>0,本申请实施例对近邻不做限 定。由此可知,第一上下文信息是基于多个数据中的至少一个已编码数据得到的,第二上下文信息是基于该至少一个已编码数据中与待编码数据近邻的至少一个数据得到的。相较于第二上下文信息,第一上下文信息对已编码数据的利用率较高,内容较全面。The at least one piece of data meeting the preset condition in the at least one piece of coded data may include at least one piece of data in the coded data that is adjacent to the data to be coded. For one-dimensional data, the neighbors of the data to be coded may be the coded data of the first m bits of the data to be coded, m>0. For two-dimensional data, the neighbors of the data to be encoded can be the adjacent data of the data to be encoded, or the encoded data in the peripheral n circle data of the data to be encoded, etc., n>0, the embodiment of the present application does not limit the neighbors . It can be known that the first context information is obtained based on at least one encoded data among the plurality of data, and the second context information is obtained based on at least one data adjacent to the data to be encoded among the at least one encoded data. Compared with the second context information, the first context information has a higher utilization rate of encoded data and more comprehensive content.
多个数据中符合预设条件的至少一个数据可以包括多个数据中与待编码数据近邻的至少一个数据。对于一维数据,与待编码数据近邻可以是待编码数据的前m 1位和/或后m 2位数据,m 1,m 2>0。对于二维数据,与待编码数据近邻可以是待编码数据的相邻数据,或者是待编码数据的外围n圈的数据等,n>0,本申请实施例对近邻不做限定。由此可知,第一边信息是基于多个数据得到的,第二边信息是基于该多个数据中与待编码数据近邻的至少一个数据得到的。相较于第二边信息,第一边信息对数据的利用率较高,内容较全面。 The at least one piece of data that meets the preset condition among the pieces of data may include at least one piece of data that is adjacent to the data to be encoded among the pieces of data. For one-dimensional data, the neighbors to the data to be encoded may be the first m 1 bits and/or the last m 2 bits of the data to be encoded, m 1 , m 2 >0. For two-dimensional data, the neighbors of the data to be encoded may be the adjacent data of the data to be encoded, or the data of the outer n circles of the data to be encoded, etc., n>0, and the embodiment of the present application does not limit the neighbors. It can be seen from this that the first side information is obtained based on a plurality of data, and the second side information is obtained based on at least one data adjacent to the data to be encoded among the plurality of data. Compared with the second side information, the first side information has a higher utilization rate of data and more comprehensive content.
在对码流进行熵解码时,第一上下文信息是将至少一个已解码数据输入自注意力解码网络得到的,第一边信息是对第一边信息的码流进行熵解码得到的。第二上下文信息是将至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的。第二边信息是对第二边信息的码流进行熵解码得到的。When entropy decoding the code stream, the first context information is obtained by inputting at least one decoded data into the self-attention decoding network, and the first side information is obtained by entropy decoding the code stream of the first side information. The second context information is obtained by inputting at least one piece of data meeting the preset condition in the at least one piece of decoded data into the masked convolutional network. The second side information is obtained by performing entropy decoding on the code stream of the second side information.
以下以参照信息的几种方式为例对编码器和解码器的结构进行说明。在一种实现方式中,参照信息仅包括第一上下文信息,相应地,请参考图9和图10,图9为本申请实施例提供的一种编码器的结构示意图,图10为本申请实施例提供的一种解码器的结构示意图。如图9所示,该编码器包括编码网络、量化模块、自注意力解码网络和熵编码模块。对于与前述图8相同的网络或模块,其作用也相同,本申请实施例在此不做赘述。自注意力解码网络用于从量化后的特征数据中提取得到第一上下文信息,熵编码模块用于根据第一上下文信息对量化后的特征数据进行熵编码得到码流。如图10所示,解码器包括自注意力解码网络、熵解码模块以及解码网络。自注意力解码网络用于从已解码数据中提取得到第一上下文信息,熵解码模块用于根据第一上下文信息对码流进行熵解码。The structures of the encoder and the decoder are described below by taking several ways of referring to information as examples. In one implementation, the reference information only includes the first context information. Correspondingly, please refer to FIG. 9 and FIG. 10. FIG. The structure diagram of a decoder provided as an example. As shown in Figure 9, the encoder includes an encoding network, a quantization module, a self-attention decoding network and an entropy encoding module. The functions of the same network or module as in FIG. 8 are also the same, and the embodiment of the present application will not repeat them here. The self-attention decoding network is used to extract the first context information from the quantized feature data, and the entropy coding module is used to perform entropy coding on the quantized feature data according to the first context information to obtain a code stream. As shown in Figure 10, the decoder includes a self-attention decoding network, an entropy decoding module, and a decoding network. The self-attention decoding network is used to extract the first context information from the decoded data, and the entropy decoding module is used to perform entropy decoding on the code stream according to the first context information.
在另一种实现方式中,参照信息仅包括第一边信息,相应地,请参考图11和图12,图11为本申请实施例提供的一种编码器的结构示意图,图12为本申请实施例提供的一种解码器的结构示意图。如图11所示,该编码器包括编码网络、自注意力编码网络、量化模块、分解熵模型、熵编码模块、熵解码模块和自注意力解码网络。自注意力编码网络用于从特征提取后的特征数据中提取得到第一边信息,分解熵模型用于估计得到第一边信息的估计概率分布,熵编码模块用于根据第一边信息的估计概率分布对第一边信息进行熵编码得到码流2。熵解码模块用于根据第一边信息的估计概率分布对码流2进行熵解码得到第一边信息。自注意力解码网络用于根据第一边信息估计得到当前数据流的估计概率分布。熵编码模块用于根据当前数据流的估计概率分布对量化后的特征数据进行熵编码得到码流1。In another implementation, the reference information only includes the first side information. Correspondingly, please refer to FIG. 11 and FIG. 12. FIG. 11 is a schematic structural diagram of an encoder provided in an embodiment of the present application, and FIG. A schematic structural diagram of a decoder provided in the embodiment. As shown in Figure 11, the encoder includes an encoding network, a self-attention encoding network, a quantization module, a decomposition entropy model, an entropy encoding module, an entropy decoding module, and a self-attention decoding network. The self-attention coding network is used to extract the first side information from the feature data after feature extraction, the decomposition entropy model is used to estimate the estimated probability distribution of the first side information, and the entropy coding module is used to estimate the first side information The probability distribution performs entropy coding on the first side information to obtain code stream 2. The entropy decoding module is configured to perform entropy decoding on the code stream 2 according to the estimated probability distribution of the first side information to obtain the first side information. The self-attention decoding network is used to estimate the estimated probability distribution of the current data stream according to the first side information. The entropy encoding module is used to perform entropy encoding on the quantized feature data according to the estimated probability distribution of the current data stream to obtain the code stream 1 .
如图12所示,解码器包括熵解码模块、自注意力解码网络以及解码网络。熵解码模块用于对码流2进行熵解码得到第一边信息,自注意力解码网络用于根据第一边信息估计得到码流1的估计概率分布,熵解码模块用于根据码流1的估计概率分布对码流1进行熵解码。As shown in Figure 12, the decoder includes an entropy decoding module, a self-attention decoding network, and a decoding network. The entropy decoding module is used to perform entropy decoding on the code stream 2 to obtain the first side information, the self-attention decoding network is used to estimate the estimated probability distribution of the code stream 1 according to the first side information, and the entropy decoding module is used to obtain the estimated probability distribution of the code stream 1 according to the Estimate the probability distribution to perform entropy decoding on code stream 1.
在另一种实现方式中,参照信息包括第一上下文信息和第一边信息,相应地,请参考图13和图14,图13为本申请实施例提供的一种编码器的结构示意图,图14为本申请实施例提供的一种解码器的结构示意图。如图13所示,该编码器包括编码网络、自注意力 编码网络、量化模块、分解熵模型、熵编码模块、熵解码模块和自注意力解码网络。各个模块的作用可以参考图9和图11中相应模块的作用,本申请实施例在此不做赘述。自注意力解码网络用于从量化后的特征数据中提取第一上下信息,并根据第一上下文信息和第一边信息估计得到当前数据流的估计概率分布。In another implementation manner, the reference information includes the first context information and the first side information. Correspondingly, please refer to FIG. 13 and FIG. 14. FIG. 13 is a schematic structural diagram of an encoder provided by an embodiment of the present application. 14 is a schematic structural diagram of a decoder provided in the embodiment of the present application. As shown in Figure 13, the encoder includes an encoding network, a self-attention encoding network, a quantization module, a decomposition entropy model, an entropy encoding module, an entropy decoding module and a self-attention decoding network. For the functions of each module, reference may be made to the functions of the corresponding modules in FIG. 9 and FIG. 11 , and details are not described here in this embodiment of the present application. The self-attention decoding network is used to extract the first context information from the quantized feature data, and estimate the estimated probability distribution of the current data stream according to the first context information and the first side information.
如图14所示,解码器包括熵解码模块、自注意力解码网络以及解码网络。自注意力解码网络用于从已解码数据中提取第一上下信息,并根据第一上下文信息和第一边信息估计得到码流1的估计概率分布。As shown in Figure 14, the decoder includes an entropy decoding module, a self-attention decoding network, and a decoding network. The self-attention decoding network is used to extract the first context information from the decoded data, and estimate the estimated probability distribution of code stream 1 according to the first context information and the first side information.
自注意力解码网络和自注意力编码网络均为具备自注意力机制(即包括自注意力结构)的神经网络。自注意力机制是注意力机制的变体,其减少了对外部信息的依赖,能够较好地获取数据或特征的内部相关性。Both the self-attention decoding network and the self-attention encoding network are neural networks with a self-attention mechanism (ie, including a self-attention structure). The self-attention mechanism is a variant of the attention mechanism, which reduces the dependence on external information and can better obtain the internal correlation of data or features.
请参考图15,图15为本申请实施例提供的一种自注意力结构示意图,该自注意力结构的输入包括三个张量查询(Query,Q)、键(Key,K)和值(Value,V)。自注意力结构包括矩阵相乘(MatMul)操作、缩放(Scale)操作、掩膜(Mask)操作以及指数归一化(Softmax)操作。Please refer to FIG. 15. FIG. 15 is a schematic diagram of a self-attention structure provided by the embodiment of the present application. The input of the self-attention structure includes three tensor queries (Query, Q), keys (Key, K) and values ( Value, V). The self-attention structure includes matrix multiplication (MatMul) operations, scaling (Scale) operations, mask (Mask) operations, and exponential normalization (Softmax) operations.
请参考图16,图16为本申请实施例提供的一种自注意力编码网络的结构示意图,该自注意力编码网络包括向输入嵌入位置编码的操作以及N1部分,N1部分包括多头注意力机制操作、求和与归一化操作和前馈操作。Please refer to Figure 16. Figure 16 is a schematic structural diagram of a self-attention encoding network provided by the embodiment of the present application. The self-attention encoding network includes the operation of embedding position encoding into the input and the N1 part. The N1 part includes a multi-head attention mechanism. operations, summation and normalization operations, and feedforward operations.
请参考图17,图17为本申请实施例提供的一种自注意力解码网络的结构示意图,该自注意力解码网络包括向输入嵌入位置编码的操作以及N2部分,N2部分包括掩码多头注意力机制操作、求和与归一化操作和前馈操作。Please refer to FIG. 17. FIG. 17 is a schematic structural diagram of a self-attention decoding network provided by an embodiment of the present application. The self-attention decoding network includes the operation of embedding position codes into the input and the N2 part. The N2 part includes masked multi-head attention Force mechanism operations, summation and normalization operations, and feedforward operations.
请参考图18,图18为本申请实施例提供的熵编码方法的过程100的流程图。过程100可由编码器执行,具体的,可以由编码器的熵编码单元来执行。过程100描述为一系列的步骤或操作,应当理解的是,过程100可以以各种顺序执行和/或同时发生,不限于图18所示的执行顺序。假设具有多个数据的当前数据流正在使用编码器,执行包括如下步骤的过程100来对数据进行熵编码。过程800可以包括:Please refer to FIG. 18 , which is a flowchart of a process 100 of the entropy encoding method provided by the embodiment of the present application. The process 100 can be executed by an encoder, specifically, it can be executed by an entropy coding unit of the encoder. The process 100 is described as a series of steps or operations. It should be understood that the process 100 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 18 . Assuming that a current data stream with multiple data is using an encoder, a process 100 including the following steps is performed to entropy encode data. Process 800 may include:
步骤101、获取待编码数据,待编码数据是当前数据流包含的多个数据中非首位编码的数据。 Step 101. Obtain the data to be encoded, where the data to be encoded is the non-first encoded data among the multiple data included in the current data stream.
步骤102、获取参照信息,参照信息至少包括第一上下文信息和第一边信息中的至少一项,第一上下文信息是将至少一个已编码数据输入自注意力解码网络得到的,第一边信息是将多个数据输入自注意力编码网络得到的。 Step 102, obtain reference information, the reference information includes at least one of the first context information and the first side information, the first context information is obtained by inputting at least one coded data into the self-attention decoding network, the first side information It is obtained by feeding multiple data into the self-attention encoding network.
步骤103、根据参照信息估计得到第一估计概率分布。 Step 103, estimating and obtaining a first estimated probability distribution according to the reference information.
步骤104、根据第一估计概率分布对待编码数据进行熵编码,以得到第一码流。Step 104: Perform entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain a first code stream.
请参考图19,图19为本申请实施例提供的熵解码方法的过程200的流程图。过程200可由解码器执行,具体的,可以由解码器的熵解码单元来执行。过程200描述为一系列的步骤或操作,应当理解的是,过程200可以以各种顺序执行和/或同时发生,不限于图19所示的执行顺序。假设具有多个数据的当前数据流正在使用解码器,执行包括如下步骤的过程200来对数据进行熵编码和熵解码。过程200可以包括:Please refer to FIG. 19 , which is a flowchart of a process 200 of an entropy decoding method provided by an embodiment of the present application. The process 200 can be executed by a decoder, specifically, it can be executed by an entropy decoding unit of the decoder. The process 200 is described as a series of steps or operations. It should be understood that the process 200 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 19 . Assuming that a current data stream with multiple data is using a decoder, a process 200 including the following steps is performed to entropy encode and decode data. Process 200 may include:
步骤201、获取第一码流。 Step 201. Acquire a first code stream.
步骤202、获取参照信息,参照信息至少包括第一上下文信息和经解码第一边信息中 的至少一项,第一上下文信息是将至少一个已解码数据输入自注意力解码网络得到的,经解码第一边信息是对第二码流进行熵解码得到的。Step 202. Obtain reference information. The reference information includes at least one of the first context information and the decoded first side information. The first context information is obtained by inputting at least one decoded data into the self-attention decoding network. After decoding The first side information is obtained by performing entropy decoding on the second code stream.
步骤203、根据参照信息估计得到第一估计概率分布。 Step 203, estimating and obtaining a first estimated probability distribution according to the reference information.
步骤204、根据第一估计概率分布对第一码流进行熵解码以得到经解码数据,经解码数据为当前数据流包含的多个数据中非首位解码的数据。Step 204: Perform entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, where the decoded data is non-first decoded data among multiple data included in the current data stream.
请参考图20,图20为本申请实施例提供的熵编解码方法的过程300的流程图。过程300可由编码器和解码器执行,具体的,可以由编码器的熵编码单元和解码器的熵解码单元来执行。过程300描述为一系列的步骤或操作,应当理解的是,过程300可以以各种顺序执行和/或同时发生,不限于图20所示的执行顺序。假设具有多个数据的当前数据流正在使用编码器和解码器,执行包括如下步骤的过程300来对数据进行熵编码和熵解码。过程300可以包括:Please refer to FIG. 20 , which is a flowchart of a process 300 of the entropy encoding and decoding method provided by the embodiment of the present application. The process 300 can be performed by an encoder and a decoder, specifically, it can be performed by an entropy encoding unit of the encoder and an entropy decoding unit of the decoder. The process 300 is described as a series of steps or operations. It should be understood that the process 300 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 20 . Assuming that a current data stream with multiple data is using an encoder and a decoder, a process 300 including the following steps is performed to entropy encode and decode data. Process 300 may include:
步骤301、编码器获取待编码数据,待编码数据是当前数据流包含的多个数据中非首位编码的数据。In step 301, the encoder acquires data to be encoded, and the data to be encoded is the non-first encoded data among multiple data included in the current data stream.
多个数据也可以称为多个数据单元,多个数据可以包括视频数据、图像数据、音频数据、整数型数据以及其他具有压缩/解压缩需求的数据等,本申请实施例对数据类型不做限定。其中,每个数据对应一个位置信息,待编码数据在多个数据中位于非首位。Multiple data can also be referred to as multiple data units. Multiple data can include video data, image data, audio data, integer data, and other data with compression/decompression requirements. limited. Wherein, each data corresponds to a piece of position information, and the data to be encoded is not at the first place among the multiple data.
当前数据流可以为一维格式或二维格式等,本申请实施例对当前数据流的格式不做限定。可选地,当初始数据流为非一维格式(例如二维格式)时,编码器可以直接将初始数据流作为当前数据流,或者可以将非一维格式的初始数据流展平成一维格式,得到当前数据流,此时每个数据可以视为文本中的一个“词”。The current data stream may be in a one-dimensional format or a two-dimensional format, and the embodiment of the present application does not limit the format of the current data stream. Optionally, when the initial data stream is in a non-one-dimensional format (such as a two-dimensional format), the encoder can directly use the initial data stream as the current data stream, or can flatten the initial data stream in a non-one-dimensional format into a one-dimensional format , to get the current data flow, at this time each data can be regarded as a "word" in the text.
示例地,在将非一维格式的初始数据流展平成一维格式时,可以按照预设顺序展平。例如当初始数据流为二维格式时,可以将二维的初始数据流按照从上至下以及从左至右的顺序展平,或者按照从下至上以及从左至右的顺序展平或者按照预设顺序展平等,本申请实施例对展平的顺序不做限定。For example, when flattening an initial data stream in a non-one-dimensional format into a one-dimensional format, it may be flattened in a preset order. For example, when the initial data stream is in a two-dimensional format, the two-dimensional initial data stream can be flattened in the order of top to bottom and left to right, or in the order of bottom to top and left to right, or in the order of The preset sequence is equal to flattening, and the embodiment of the present application does not limit the sequence of flattening.
本申请实施例中,在获取待编码数据后还可以对待编码数据进行量化处理,这样能够减少表示待编码数据所需的数据量,使得后续熵编码过程中的码率降低,从而有效减小熵编码开销。如前所述,可以通过例如标量量化或矢量量化等方式进行量化处理,本申请实施例对量化处理的方式不做限定。In the embodiment of the present application, after obtaining the data to be coded, the data to be coded can also be quantized, which can reduce the amount of data required to represent the data to be coded, so that the code rate in the subsequent entropy coding process is reduced, thereby effectively reducing the entropy Encoding overhead. As mentioned above, the quantization process may be performed in a manner such as scalar quantization or vector quantization, and the embodiment of the present application does not limit the quantization process manner.
需要说明的是,在对当前数据流包含的多个数据进行熵编码时,通常先对首位数据进行熵编码之后再对待编码数据进行熵编码。对于首位编码的数据,可以根据预先设置信息估计得到第四估计概率分布。或者利用训练得到的可学习模型估计得到第四估计概率分布,再根据第四估计概率分布对首位编码的数据进行熵编码以得到第四码流。本申请实施例对得到第四估计概率分布的方式不做限定。It should be noted that, when entropy encoding is performed on multiple pieces of data included in the current data stream, entropy encoding is generally performed on the first data first, and then entropy encoding is performed on the data to be encoded. For the first encoded data, the fourth estimated probability distribution may be obtained by estimating according to preset information. Alternatively, a fourth estimated probability distribution is estimated by using a learnable model obtained through training, and then entropy encoding is performed on the first encoded data according to the fourth estimated probability distribution to obtain a fourth code stream. The embodiment of the present application does not limit the manner of obtaining the fourth estimated probability distribution.
步骤302、编码器获取第一上下文信息。In step 302, the encoder acquires first context information.
第一上下文信息是将当前数据流包括的多个数据中的至少一个已编码数据输入自注意力解码网络得到的,该已编码数据指的是多个数据中编码器已经进行熵编码的数据。由于当对当前数据流的首位数据进行熵编码时,还未存在已编码数据,因此待编码数据需要为当前数据流的非首位数据,这样才能提取得到第一上下文信息。基于多个数据中的至少一个已编码数据得到的第一上下文信息存在的数据冗余较少,对已编码数据的利用率较高, 在后续利用第一上下文信息估计得到第一估计概率分布时,能够提高得到的第一估计概率分布的准确性。由于第一估计概率分布的准确性越高,熵编码过程中的码率越小,因此将多个数据中的至少一个已编码数据输入自注意力解码网络获取第一上下文信息,能够减小熵编码过程中的码率,从而减小熵编码开销。其中,码率为熵编码单位数据所需的平均编码长度。The first context information is obtained by inputting at least one encoded data among the plurality of data included in the current data stream into the self-attention decoding network, and the encoded data refers to data that has been entropy-encoded by the encoder among the plurality of data. Since there is no encoded data when performing entropy encoding on the first data of the current data stream, the data to be encoded needs to be the non-first data of the current data stream, so that the first context information can be extracted. The first context information obtained based on at least one of the encoded data among the plurality of data has less data redundancy, and the utilization rate of the encoded data is higher. When the first estimated probability distribution is subsequently estimated by using the first context information , which can improve the accuracy of the obtained first estimated probability distribution. Since the accuracy of the first estimated probability distribution is higher, the code rate in the entropy encoding process is smaller, so inputting at least one encoded data in the plurality of data into the self-attention decoding network to obtain the first context information can reduce the entropy The code rate in the encoding process, thereby reducing the overhead of entropy encoding. Wherein, the code rate is an average code length required for entropy coding unit data.
自注意力解码网络为具备自注意力机制(即包括自注意力结构)的神经网络,其具备全局感受野,可以得到输入的所有已编码数据与待编码数据的相关性,该相关性可以为输入的所有已编码数据相对于待编码数据的权重。自注意力解码网络在得到输入的所有已编码数据相对于待编码数据的权重后,根据权重对相应的已编码数据进行加权得到第一上下文信息。The self-attention decoding network is a neural network with a self-attention mechanism (that is, including a self-attention structure), which has a global receptive field, and can obtain the correlation between all the input encoded data and the data to be encoded. The correlation can be expressed as The weight of all encoded data entered relative to the data to be encoded. After the self-attention decoding network obtains the weights of all the input encoded data relative to the data to be encoded, it weights the corresponding encoded data according to the weights to obtain the first context information.
可选地,自注意力解码网络可以对输入的所有已编码数据利用相应的权重进行加权得到第一上下文信息。这样,提高了获取第一上下文信息的过程中对已编码数据的利用率。在后续利用第一上下文信息估计得到第一估计概率分布时,能够进一步提高得到的第一估计概率分布的准确性,进一步减小熵编码过程中的码率,从而进一步减小熵编码开销。Optionally, the self-attention decoding network may weight all input encoded data with corresponding weights to obtain the first context information. In this way, the utilization rate of encoded data in the process of acquiring the first context information is improved. When the first estimated probability distribution is subsequently estimated by using the first context information, the accuracy of the obtained first estimated probability distribution can be further improved, and the code rate in the entropy encoding process can be further reduced, thereby further reducing the entropy encoding overhead.
或者自注意力解码网络可以根据得到的权重选择输入的部分已编码数据,并对部分已编码数据利用相应的权重进行加权得到第一上下文信息。示例地,可以将得到的权重按照从大到小的顺序排序,选择排在前i 1位的权重对应的已编码数据进行加权。或者将得到的权重按照从小到大的顺序排序,选择排在后i 2位的权重对应的已编码数据进行加权。或者选择权重大于i 2的已编码数据进行加权。其中i 1和i 2均小于得到的所有权重的数量。这样,能够提高获取第一上下文信息的过程中的灵活性。且当选择权重较高的已编码数据进行加权时,能够保证获取第一上下文信息过程中对权重较高的已编码数据的利用率,在后续利用第一上下文信息估计得到第一估计概率分布时,能够进一步提高得到的第一估计概率分布的准确性,进一步减小熵编码过程中的码率,从而进一步减小熵编码开销。 Alternatively, the self-attention decoding network may select the input part of the encoded data according to the obtained weight, and weight the part of the encoded data with the corresponding weight to obtain the first context information. For example, the obtained weights may be sorted in descending order, and the coded data corresponding to the top i 1 weights are selected for weighting. Alternatively, the obtained weights are sorted in ascending order, and the encoded data corresponding to the last i 2 weights are selected for weighting. Or select encoded data with a weight greater than i2 for weighting. where both i 1 and i 2 are less than the number of all weights obtained. In this way, the flexibility in the process of acquiring the first context information can be improved. And when the coded data with higher weight is selected for weighting, the utilization rate of the coded data with higher weight in the process of obtaining the first context information can be guaranteed, and when the first estimated probability distribution is estimated by using the first context information subsequently , can further improve the accuracy of the obtained first estimated probability distribution, and further reduce the code rate in the process of entropy coding, thereby further reducing the overhead of entropy coding.
在将当前数据流输入自注意力解码网络后,自注意力解码网络可以对当前数据流中的每个数据进行嵌入操作,嵌入操作指的是将每个数据从原始数据空间转换到另一个空间。之后再对每个数据进行位置编码(positional encoding),得到每个数据的位置信息,并将每个数据的位置信息和数据结合。每个数据具有坐标信息,位置编码指的是根据各个数据的坐标信息提取各个数据的位置信息。可以通过按位相加或级联等方式将每个数据的位置信息和数据结合,本申请实施例对位置编码的方式不做限定。After the current data stream is input into the self-attention decoding network, the self-attention decoding network can perform an embedding operation on each data in the current data stream. The embedding operation refers to converting each data from the original data space to another space . Then perform positional encoding on each data to obtain the positional information of each data, and combine the positional information of each data with the data. Each data has coordinate information, and location coding refers to extracting the location information of each data according to the coordinate information of each data. The location information of each data can be combined with the data by bitwise addition or concatenation, and the embodiment of the present application does not limit the location encoding method.
该自注意力解码网络的结构可以参考前述图17,本申请实施例在此不做赘述。如前述图17所示,自注意力解码网络的输入包括三个张量Q、K和V。Q、K和V依次经过掩码多头自注意力机制、求和与归一化操作、多头注意力机制、求和与归一化操作、前馈操作、求和与归一化操作和线性化操作,输出第一上下文信息。Q、K和V指的是已编码数据的张量,例如可以是前述过程中对非首位编码的数据进行嵌入操作和位置编码后得到的张量。The structure of the self-attention decoding network can refer to the aforementioned FIG. 17 , and the embodiment of the present application will not repeat it here. As shown in Figure 17 above, the input of the self-attention decoding network includes three tensors Q, K and V. Q, K, and V go through masked multi-head self-attention mechanism, summation and normalization operation, multi-head attention mechanism, summation and normalization operation, feedforward operation, summation and normalization operation, and linearization Operation, output the first context information. Q, K, and V refer to tensors of coded data, for example, tensors obtained by performing embedding operations and position coding on non-prime coded data in the foregoing process.
步骤303、编码器根据第一上下文信息估计得到第一估计概率分布。 Step 303, the encoder estimates and obtains a first estimated probability distribution according to the first context information.
该第一估计概率分布可以包括至少一个估计概率参数。示例地,该至少一个估计概率参数可以包括均值(mean)和方差(scale),mean和scale组成高斯分布。The first estimated probability distribution may comprise at least one estimated probability parameter. Exemplarily, the at least one estimated probability parameter may include a mean (mean) and a variance (scale), and the mean and the scale form a Gaussian distribution.
可选地,可以将第一上下文信息输入概率分布估计网络,以得到概率分布估计网络输 出的第一估计概率分布。该概率分布估计网络可以为单独的一个神经网络,也可以是自注意力解码网络中的一个结构,本申请实施例对此不做限定。Optionally, the first context information may be input into the probability distribution estimation network to obtain a first estimated probability distribution output by the probability distribution estimation network. The probability distribution estimation network may be a single neural network, or a structure in the self-attention decoding network, which is not limited in this embodiment of the present application.
请参考图21,图21为本申请实施例提供的得到第一估计概率分布的过程的一种示意图,图21以初始数据流为二维格式,需要将初始数据流展平为例,初始数据流a包括4×4排列的16个位置a1至a16,每个位置对应一个数据。其中位置a10对应的数据为待编码数据,位置a1至a9对应的数据均为已编码数据,其余位置对应的数据为未编码数据,每个已编码数据对应有一个第一估计概率分布。将初始数据流a按照从上至下以及从左至右的顺序展平为一维格式,得到包括顺序排列的16个位置a1至a16的当前数据流b。将当前数据流b输入自注意力解码网络,自注意力解码网络确定当前数据流b中每个数据的位置信息,并将每个数据的位置信息与数据结合。自注意力解码网络基于结合有位置信息的数据流b中的已编码数据(即位置a1至a9对应的数据)输出第一上下文信息,该第一上下文信息输入至概率分布估计网络,概率分布估计网络输出第一估计概率分布,即位置a10对应的数据的估计概率分布。图21所示的过程仅为示例性说明,并不对得到第一估计概率分布的过程进行限定。Please refer to Figure 21. Figure 21 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application. Figure 21 takes the initial data stream as a two-dimensional format and needs to flatten the initial data stream as an example. The initial data Stream a includes 16 positions a1 to a16 arranged in 4×4, each position corresponding to one piece of data. The data corresponding to position a10 is data to be encoded, the data corresponding to positions a1 to a9 are all encoded data, and the data corresponding to other positions are unencoded data, and each encoded data corresponds to a first estimated probability distribution. The initial data stream a is flattened into a one-dimensional format from top to bottom and from left to right to obtain a current data stream b including 16 positions a1 to a16 arranged in sequence. The current data stream b is input into the self-attention decoding network, and the self-attention decoding network determines the position information of each data in the current data stream b, and combines the position information of each data with the data. The self-attention decoding network outputs the first context information based on the encoded data in the data stream b combined with position information (ie, the data corresponding to positions a1 to a9), and the first context information is input to the probability distribution estimation network, and the probability distribution estimation The network outputs the first estimated probability distribution, that is, the estimated probability distribution of the data corresponding to position a10. The process shown in FIG. 21 is only an exemplary description, and does not limit the process of obtaining the first estimated probability distribution.
步骤304、编码器根据第一估计概率分布对待编码数据进行熵编码以得到第一码流。 Step 304, the encoder performs entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain a first code stream.
编码器可以根据第一估计概率分布计算待编码数据的概率值,之后根据该概率值对待编码数据进行熵编码。该第一码流可以是二进制格式。The encoder may calculate the probability value of the data to be encoded according to the first estimated probability distribution, and then perform entropy encoding on the data to be encoded according to the probability value. The first code stream may be in binary format.
前述步骤301至步骤304是以估计得到第一估计概率分布,根据第一估计概率分布对待编码数据进行熵编码得到第一码流为例进行说明的。可以将当前数据流包含的每个非首位数据分别作为待编码数据,按照前述步骤301至步骤304所示的过程得到第一估计概率分布,并根据第一估计概率分布进行熵编码,从而得到每个非首位数据的码流。需要说明的是,在每编码一个数据后,即将该数据添加进已编码数据。The aforementioned steps 301 to 304 are described by taking the estimation to obtain the first estimated probability distribution, and performing entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain the first code stream as an example. Each non-first data included in the current data stream can be used as the data to be encoded respectively, and the first estimated probability distribution is obtained according to the process shown in the aforementioned steps 301 to 304, and entropy encoding is performed according to the first estimated probability distribution, so as to obtain each A code stream of non-first data. It should be noted that, after each piece of data is encoded, the data is added to the encoded data.
步骤305、编码器向解码器发送第一码流。 Step 305, the encoder sends the first code stream to the decoder.
如前述实施例所述,编码器和解码器具有建立有通信连接的通信接口,编码器可以通过通信接口向解码器的通信接口发送第一码流。As described in the foregoing embodiments, the encoder and the decoder have a communication interface with established communication connections, and the encoder can send the first code stream to the communication interface of the decoder through the communication interface.
需要说明的是,编码器对当前数据流包括的每个非首位编码的数据进行熵编码后得到每个非首位数据的码流。进而根据每个非首位数据的码流得到当前码流,当前码流包括按照编码器对多个非首位数据的编码顺序排列的多个非首位编码的数据的码流。当然,当前码流包括第一码流。之后编码器可以向解码器发送包括第一码流的当前码流。对于首位编码的数据,编码器根据第四估计概率分布对首位编码的数据进行熵编码以得到第四码流后,第四码流可以包含在当前码流中以传输至解码器。或者编码器将第四码流单独发送至解码器,本申请实施例对第四码流的发送方式不做限定。It should be noted that, the encoder performs entropy encoding on each non-first encoded data included in the current data stream to obtain a code stream of each non-first data. Furthermore, the current code stream is obtained according to the code stream of each non-prime data, and the current code stream includes code streams of multiple non-prime coded data arranged according to the encoding order of the multiple non-prime data by the encoder. Of course, the current code stream includes the first code stream. Then the encoder can send the current code stream including the first code stream to the decoder. For the first coded data, after the encoder entropy codes the first coded data according to the fourth estimated probability distribution to obtain a fourth code stream, the fourth code stream may be included in the current code stream to be transmitted to the decoder. Alternatively, the encoder sends the fourth code stream to the decoder independently, and this embodiment of the present application does not limit the way of sending the fourth code stream.
步骤306、解码器获取第一上下文信息。 Step 306, the decoder acquires the first context information.
如前述步骤305所述,该第一码流属于解码器接收到的当前码流中的一个码流,第一码流解码后得到的经解码数据为当前数据流包含的多个数据中非首位解码的数据。第一上下文信息可以是将至少一个已解码数据输入自注意力解码网络得到的,已解码数据指的是在对第一码流进行解码之前已进行熵解码得到的数据。由于当对第四码流进行熵解码时,还未存在已解码数据,因此第一码流解码后得到的经解码数据为当前数据流包含的多个数据中非首位解码的数据,这样才能提取得到第一上下文信息。该第一上下文信息的获取过 程可以参考前述步骤302,本申请实施例在此不做赘述。As described in the aforementioned step 305, the first code stream belongs to a code stream in the current code stream received by the decoder, and the decoded data obtained after decoding the first code stream is the non-first bit among the multiple data contained in the current data stream decoded data. The first context information may be obtained by inputting at least one piece of decoded data into the self-attention decoding network, and the decoded data refers to data obtained by performing entropy decoding before decoding the first code stream. Since there is no decoded data when performing entropy decoding on the fourth code stream, the decoded data obtained after decoding the first code stream is the non-first decoded data among the multiple data contained in the current data stream, so as to extract Get the first context information. For the acquisition process of the first context information, reference may be made to the aforementioned step 302, and details are not described here in this embodiment of the present application.
需要说明的是,解码器在对接收到的当前码流中的各个码流进行熵解码时,通常先对第四码流进行熵解码。解码器可以根据预先设置信息估计得到第四估计概率分布。或者利用训练得到的可学习模型估计得到第四估计概率分布,再根据第四估计概率分布对第四码流进行熵解码以得到经解码首位数据,经解码首位数据是多个数据中首位解码的数据。本申请实施例对得到第四估计概率分布的方式不做限定。It should be noted that, when the decoder performs entropy decoding on each code stream in the received current code stream, it usually performs entropy decoding on the fourth code stream first. The decoder can estimate and obtain the fourth estimated probability distribution according to preset information. Or use the learnable model obtained through training to estimate the fourth estimated probability distribution, and then perform entropy decoding on the fourth code stream according to the fourth estimated probability distribution to obtain the decoded first bit data, the decoded first bit data is the first bit decoded among the plurality of data data. The embodiment of the present application does not limit the manner of obtaining the fourth estimated probability distribution.
解码器估计得到的第四估计概率分布需要与编码器估计得到的第四估计概率分布一致。示例地,当编码器根据预先设置信息估计得到第四估计概率分布时,则解码器根据相同的固定信息估计得到第四估计概率分布。当编码器利用训练得到的可学习模型估计得到第四估计概率分布时,则解码器根据相同的可学习模型估计得到第四估计概率分布,且估计得到的第四估计概率分布相同。The fourth estimated probability distribution estimated by the decoder needs to be consistent with the fourth estimated probability distribution estimated by the encoder. For example, when the encoder estimates and obtains the fourth estimated probability distribution according to preset information, the decoder obtains the fourth estimated probability distribution according to the same fixed information. When the encoder estimates the fourth estimated probability distribution by using the learnable model obtained through training, the decoder estimates the fourth estimated probability distribution according to the same learnable model, and the estimated fourth estimated probability distribution is the same.
步骤307、解码器根据第一上下文信息估计得到第一估计概率分布。 Step 307, the decoder estimates and obtains a first estimated probability distribution according to the first context information.
可选地,可以将第一上下文信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。该过程可以参考前述步骤303,本申请实施例在此不做赘述。Optionally, the first context information may be input into the probability distribution estimation network to obtain a first estimated probability distribution output by the probability distribution estimation network. For this process, reference may be made to the foregoing step 303 , and details are not described here in this embodiment of the present application.
步骤308、解码器根据第一估计概率分布对第一码流进行熵解码以得到经解码数据,经解码数据为当前数据流包含的多个数据中非首位解码的数据。 Step 308 , the decoder performs entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, where the decoded data is non-first decoded data among multiple data included in the current data stream.
解码器可以根据第一估计概率分布计算第一码流的概率值,之后根据该概率值对第一码流进行熵解码。需要说明的是,在每解码得到一个经解码数据后,即将该经解码数据添加进已解码数据。The decoder may calculate the probability value of the first code stream according to the first estimated probability distribution, and then perform entropy decoding on the first code stream according to the probability value. It should be noted that after each piece of decoded data is obtained through decoding, the decoded data is added to the decoded data.
前述步骤306至步骤308是以估计得到第一估计概率分布,根据第一估计概率分布对第一码流进行熵解码为例进行说明的。可以将当前码流包括的每个码流分别作为第一码流,按照前述步骤306至步骤308所示的过程得到第一估计概率分布,并根据第一估计概率分布进行熵解码。The aforementioned steps 306 to 308 are described by taking the first estimated probability distribution obtained through estimation, and performing entropy decoding on the first code stream according to the first estimated probability distribution as an example. Each code stream included in the current code stream can be used as the first code stream respectively, and the first estimated probability distribution is obtained according to the process shown in the foregoing step 306 to step 308, and entropy decoding is performed according to the first estimated probability distribution.
在对当前码流均进行熵解码后,得到的经解码数据为一维格式。解码器可以根据经解码数据的二维分布信息将经解码数据的格式变换为一维,以得到与编码器获取的当前数据流的排列相同的二维经解码数据。该二维分布信息可以包括二维平面长方向和宽方向分别排列的经解码数据的个数以及排列方式等。二维分布信息可以预先存储在解码器中,也可以由编码器发送得到,本申请实施例对二维分布信息的内容和获取方式均不做限定,只要能够保证二维经解码数据与编码器获取的当前数据流的排列相同即可。After performing entropy decoding on all the current code streams, the obtained decoded data is in a one-dimensional format. The decoder may transform the format of the decoded data into one-dimensional according to the two-dimensional distribution information of the decoded data, so as to obtain the two-dimensional decoded data having the same arrangement as the current data stream acquired by the encoder. The two-dimensional distribution information may include the number and arrangement of decoded data arranged in the length direction and width direction of the two-dimensional plane, respectively. The two-dimensional distribution information can be pre-stored in the decoder, or can be sent by the encoder. The embodiment of the present application does not limit the content and acquisition method of the two-dimensional distribution information, as long as the two-dimensional decoded data can be guaranteed to be compatible with the encoder. The arrangement of the obtained current data streams may be the same.
相关技术中,编码时根据各个数据的位置信息确定待编码数据的相邻已编码数据,利用遮掩卷积神经网络从相邻已编码数据中提取上下文信息,进而基于上下文信息对待编码数据进行熵编码。解码时根据各个码流对应的数据的位置信息确定待解码码流对应的数据的相邻已解码数据,利用遮掩卷积神经网络从相邻已解码数据中提取上下文信息,进而基于上下文信息对待解码码流进行熵解码。In related technologies, during encoding, the adjacent encoded data of the data to be encoded is determined according to the position information of each data, and the context information is extracted from the adjacent encoded data by using the masked convolutional neural network, and then entropy encoding is performed on the data to be encoded based on the context information . When decoding, according to the position information of the data corresponding to each code stream, the adjacent decoded data of the data corresponding to the code stream to be decoded is determined, and the context information is extracted from the adjacent decoded data by using the masked convolutional neural network, and then based on the context information, the data to be decoded is The code stream is entropy decoded.
由于相关技术中需要从相邻已编码数据或相邻已解码数据中提取上下文信息,该过程需要按照各个数据的位置信息执行,因此对多个数据的熵编码或熵解码过程均需要按照各个数据的排序串行执行,串行执行耗时较长,导致熵编码和熵解码的效率较低。而本申请实施例中,从至少一个已编码数据或已解码数据中提取第一上下文信息,无需考虑各个数据的位置编码,因此对多个数据的熵编码或熵解码过程可以并行执行,并行执行耗时较短, 相较于相关技术提高了熵编码和熵解码的效率。Since context information needs to be extracted from adjacent encoded data or adjacent decoded data in related technologies, this process needs to be performed according to the location information of each data, so the entropy encoding or entropy decoding process of multiple data needs to be performed according to the location information of each data The sorting is performed serially, and the serial execution takes a long time, resulting in low efficiency of entropy encoding and entropy decoding. However, in the embodiment of the present application, the first context information is extracted from at least one encoded data or decoded data, without considering the position encoding of each data, so the entropy encoding or entropy decoding process of multiple data can be executed in parallel, parallel execution The time consumption is shorter, and the efficiency of entropy encoding and entropy decoding is improved compared with related technologies.
此外相关技术中利用遮掩卷积神经网络提取上下文信息,在提取上下文信息时仅使用了局部的感受野,对已编码数据或已解码数据的利用率较低,导致根据上下文信息得到的估计概率分布的准确性较低,从而导致熵编码和熵解码开销较大。而本申请实施例中,可以利用具备自注意力机制的自注意力解码网络得到输入的所有已编码数据或已解码数据的权重,之后对输入的部分/全部已编码数据或部分/全部已解码数据利用对应的权重进行加权得到第一上下文信息。提高了对已编码数据或已解码数据的利用率,提取得到的第一上下文信息的数据冗余较少,进一步提高了得到的估计概率分布的准确性。相较于相关技术减小了熵编码过程中的码率,从而减小了熵编码和熵解码的开销。In addition, in related technologies, the masked convolutional neural network is used to extract context information. When extracting context information, only a local receptive field is used, and the utilization rate of encoded data or decoded data is low, resulting in an estimated probability distribution based on context information. is less accurate, resulting in high overhead for entropy encoding and entropy decoding. However, in the embodiment of the present application, the self-attention decoding network with self-attention mechanism can be used to obtain the weights of all the input encoded data or decoded data, and then part/all of the input encoded data or part/all of the decoded data The data is weighted with corresponding weights to obtain the first context information. The utilization rate of the encoded data or the decoded data is improved, the data redundancy of the extracted first context information is less, and the accuracy of the obtained estimated probability distribution is further improved. Compared with related technologies, the code rate in the process of entropy encoding is reduced, thereby reducing the overhead of entropy encoding and entropy decoding.
请参考图22,图22为本申请实施例提供的熵编码性能的一种示意图,图22中的坐标系(22a)示出了在多尺度结构相似性(Multi-Scale Structural Similarity Index Measure,MS-SSIM)指标下采用本申请实施例以及相关技术分别对测试集进行熵编码的性能,坐标系(22b)示出了在峰值信噪比(Peak Signal to Noise Ratio,PSNR)指标下采用本申请实施例以及相关技术分别对测试集进行熵编码的性能。测试集为柯达(Kodak)测试集,Kodak测试集包括24张便携式网络图形(Portable Network Graphics,PNG)格式的图像。该24张图像的分辨率可以为768×512或512×768。图22的两个坐标系中,横坐标表示像素深度(Bits per pixel,BPP),纵坐标表示码率。BPP表示一个像素所用的平均比特数,值越小表示压缩码率越小。MS-SSIM和PSNR均是一种评价图像的客观标准,其值越高表示图像质量越好。坐标系(22a)和坐标系(22b)中的折线e1表示本申请实施例,折线e2表示相关技术。由图22可知,在各个码率点本申请实施例的MSSSIM指标和PSNR指标均高于相关技术,相同的压缩质量下本申请实施例的码率小于相关技术,通常在低码率点比相关技术小17%,在高码率点比相关技术小15%。即本申请实施例的压缩性能比相关技术高,本申请实施例能够提高获取的待编码数据或待解码数据的估计概率分布的准确性。Please refer to Fig. 22, Fig. 22 is a schematic diagram of the entropy coding performance provided by the embodiment of the present application, the coordinate system (22a) in Fig. -SSIM) using the embodiment of the present application and related technologies to perform entropy encoding on the test set respectively, the coordinate system (22b) shows the use of the present application under the peak signal-to-noise ratio (Peak Signal to Noise Ratio, PSNR) index The embodiments and related technologies respectively perform entropy coding performance on a test set. The test set is the Kodak test set, and the Kodak test set includes 24 images in Portable Network Graphics (PNG) format. The resolution of the 24 images can be 768×512 or 512×768. In the two coordinate systems in Fig. 22, the abscissa represents the pixel depth (Bits per pixel, BPP), and the ordinate represents the code rate. BPP represents the average number of bits used by a pixel, and the smaller the value, the smaller the compression rate. Both MS-SSIM and PSNR are objective standards for evaluating images, and the higher the value, the better the image quality. The broken line e1 in the coordinate system (22a) and the coordinate system (22b) represents the embodiment of the present application, and the broken line e2 represents the related technology. It can be seen from Figure 22 that the MSSSIM index and PSNR index of the embodiment of the present application are higher than those of the related art at each code rate point, and the code rate of the embodiment of the present application is lower than that of the related art under the same compression quality. The technology is 17% smaller and 15% smaller than related technologies at high bit rate points. That is, the compression performance of the embodiment of the present application is higher than that of the related art, and the embodiment of the present application can improve the accuracy of the estimated probability distribution of acquired data to be encoded or data to be decoded.
综上所述,本申请实施例提供的熵编解码方法,编码器获取当前数据流以及第一上下文信息,之后根据第一上下文信息估计得到第一估计概率分布,并根据第一估计概率分布对待编码数据进行熵编码以得到第一码流,之后向解码器发送第一码流,解码器获取第一码流以及第一上下文信息,根据该第一上下文信息估计得到第一估计概率分布,再根据第一估计概率分布对第一码流进行熵解码,第一上下文信息是将至少一个已编码数据或已解码数据输入自注意力解码网络得到的,自注意力解码网络可以对输入的所有已编码数据利用相应的权重进行加权得到第一上下文信息。这样,提高了获取第一上下文信息的过程中对已编码数据的利用率。在利用第一上下文信息估计得到第一估计概率分布时,能够提高得到的第一估计概率分布的准确性,进一步减小熵编码过程中的码率,进一步减小熵编码开销。从而减小了第一码流传输至解码器的带宽占用率,提高了第一码流传输至解码侧的传输效率。且在获取第一上下文信息的过程中无需考虑各个数据的位置信息,因此对多个数据的熵编码或熵解码过程可以并行执行,并行执行耗时较短,提高了熵编码和熵解码的效率。To sum up, in the entropy encoding and decoding method provided by the embodiment of the present application, the encoder obtains the current data stream and the first context information, and then estimates the first estimated probability distribution according to the first context information, and treats it according to the first estimated probability distribution Entropy encoding is performed on the encoded data to obtain a first code stream, and then the first code stream is sent to the decoder, and the decoder obtains the first code stream and first context information, estimates and obtains a first estimated probability distribution according to the first context information, and then The first code stream is entropy decoded according to the first estimated probability distribution, the first context information is obtained by inputting at least one encoded data or decoded data into the self-attention decoding network, and the self-attention decoding network can analyze all the input The encoded data is weighted with corresponding weights to obtain the first context information. In this way, the utilization rate of encoded data in the process of acquiring the first context information is improved. When the first estimated probability distribution is estimated by using the first context information, the accuracy of the obtained first estimated probability distribution can be improved, the code rate in the entropy encoding process can be further reduced, and the entropy encoding overhead can be further reduced. Therefore, the bandwidth occupancy rate of the first code stream transmitted to the decoder is reduced, and the transmission efficiency of the first code stream transmitted to the decoding side is improved. And in the process of obtaining the first context information, there is no need to consider the location information of each data, so the entropy encoding or entropy decoding process of multiple data can be executed in parallel, and the parallel execution takes less time, which improves the efficiency of entropy encoding and entropy decoding .
本申请实施例提供的方法的先后顺序可以进行适当调整,步骤也可以根据情况进行相应增减。任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本申请的保护范围之内,本申请实施例对此不做限定。The order of the methods provided in the embodiments of the present application can be adjusted appropriately, and the steps can also be increased or decreased according to the situation. Any person skilled in the art within the technical scope disclosed in this application can easily think of changing methods, which should be covered within the scope of protection of this application, which is not limited in the embodiments of this application.
请参考图23,图23为本申请实施例提供的熵编解码方法的过程400的流程图。过程400可由编码器和解码器执行,具体的,可以由编码器的熵编码单元和解码器的熵解码单元来执行。过程400描述为一系列的步骤或操作,应当理解的是,过程400可以以各种顺序执行和/或同时发生,不限于图23所示的执行顺序。假设具有多个数据的当前数据流正在使用编码器和解码器,执行包括如下步骤的过程400来对数据进行熵编码和熵解码。过程400可以包括:Please refer to FIG. 23 , which is a flowchart of a process 400 of the entropy encoding and decoding method provided by the embodiment of the present application. The process 400 can be performed by an encoder and a decoder, specifically, it can be performed by an entropy encoding unit of the encoder and an entropy decoding unit of the decoder. The process 400 is described as a series of steps or operations. It should be understood that the process 400 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 23 . Assuming that a current data stream with multiple data is using an encoder and decoder, a process 400 including the following steps is performed to entropy encode and decode data. Process 400 may include:
步骤401、编码器获取当前数据流包含的待编码数据。In step 401, the encoder acquires data to be encoded included in the current data stream.
待编码数据可以是当前数据流包含的多个数据中首位编码的数据或者非首位编码的数据,本申请实施例对待编码数据在当前数据流的位置不做限定。该过程可以参考前述步骤301,本申请实施例在此不做赘述。The data to be encoded may be the first encoded data or the non-first encoded data among multiple data contained in the current data stream, and the embodiment of the present application does not limit the position of the to-be-encoded data in the current data stream. For this process, reference may be made to the aforementioned step 301, and details are not described here in this embodiment of the present application.
步骤402、编码器获取第一边信息。 Step 402, the encoder obtains the first side information.
第一边信息是将多个数据输入自注意力编码网络得到的。以前述图21所示的初始数据流a为例,可以将位置a1至a16对应的数据输入自注意力编码网络得到第一边信息。基于多个数据得到的第一边信息的内容较为全面。在后续利用第一边信息估计第二估计概率分布时,能够提高得到的第二估计概率分布的准确性,从而减小熵编码过程中的码率,实现减小熵编码开销。The first side information is obtained by feeding multiple data into the self-attention encoding network. Taking the initial data stream a shown in FIG. 21 as an example, the data corresponding to positions a1 to a16 can be input into the self-attention encoding network to obtain the first side information. The content of the first side information obtained based on multiple data is relatively comprehensive. When the second estimated probability distribution is subsequently estimated by using the first side information, the accuracy of the obtained second estimated probability distribution can be improved, thereby reducing the code rate in the entropy encoding process, and reducing the entropy encoding overhead.
自注意力编码网络为具备自注意力机制(即包括自注意力结构)的神经网络。其具有较好的特征变换能力,提取到的第一边信息的质量较好,在后续利用第一边信息估计得到第一估计概率分布时,能够提高得到的第一估计概率分布的准确性,从而减小熵编码过程中的码率,实现减小熵编码开销。The self-attention encoding network is a neural network with a self-attention mechanism (ie, including a self-attention structure). It has better feature transformation ability, and the quality of the extracted first side information is better. When the first estimated probability distribution is estimated by using the first side information, the accuracy of the first estimated probability distribution can be improved. Therefore, the code rate in the process of entropy encoding is reduced, and the overhead of entropy encoding is reduced.
自注意力编码网络具备全局感受野,可以得到输入的所有数据与待编码数据的相关性,该相关性可以为输入的所有数据相对于待编码数据的权重。自注意力编码网络在得到输入的所有数据相对于待编码数据的权重后,根据权重对相应的数据进行加权得到第一边信息。The self-attention encoding network has a global receptive field, and can obtain the correlation between all the input data and the data to be encoded. The correlation can be the weight of all the input data relative to the data to be encoded. After the self-attention encoding network obtains the weights of all the input data relative to the data to be encoded, it weights the corresponding data according to the weights to obtain the first side information.
可选地,自注意力编码网络可以对输入的所有数据利用相应的权重进行加权得到第一边信息。这样,提高了获取第一边信息的过程中对数据的利用率。在后续利用第一边信息估计得到第一估计概率分布时,能够进一步提高得到的第一估计概率分布的准确性,进一步减小熵编码过程中的码率,从而进一步减小熵编码开销。Optionally, the self-attention encoding network can weight all input data with corresponding weights to obtain the first side information. In this way, the utilization rate of data in the process of obtaining the first side information is improved. When the first estimated probability distribution is subsequently estimated by using the first side information, the accuracy of the obtained first estimated probability distribution can be further improved, and the code rate in the entropy encoding process can be further reduced, thereby further reducing the entropy encoding overhead.
或者自注意力编码网络可以根据得到的权重选择输入的部分数据,并对部分数据利用相应的权重进行加权得到第一边信息。该过程可以参考前述步骤302,本申请实施例在此不做赘述。这样,能够提高获取第一边信息的过程中的灵活性。且当选择权重较高的数据进行加权时,能够保证获取第一边信息过程中对权重较高的数据的利用率,在后续利用第一边信息估计得到第一估计概率分布时,能够进一步提高得到的第一估计概率分布的准确性,进一步减小熵编码过程中的码率,从而进一步减小熵编码开销。Or the self-attention encoding network can select part of the input data according to the obtained weight, and weight the part of the data with the corresponding weight to obtain the first side information. For this process, reference may be made to the aforementioned step 302, which will not be described in detail here in this embodiment of the present application. In this way, the flexibility in the process of obtaining the first side information can be improved. And when the data with higher weight is selected for weighting, the utilization rate of data with higher weight in the process of obtaining the first side information can be guaranteed, and the first estimated probability distribution can be further improved when the first side information is used to estimate the first estimated probability distribution. The accuracy of the obtained first estimated probability distribution further reduces the code rate in the process of entropy coding, thereby further reducing the overhead of entropy coding.
在该步骤402中,该自注意力编码网络的结构可以参考前述图16,本申请实施例在此不做赘述。如前述图16所示,自注意力编码网络的输入包括三个张量Q、K和V,Q、K和V依次经过多头注意力机制、求和与归一化操作、前馈操作和求和与归一化操作,输出第一边信息。Q、K和V指的是数据的张量,例如可以是前述过程中对当前数据流中的数据进行嵌入操作和位置编码后得到的张量。In this step 402, the structure of the self-attention encoding network can refer to the aforementioned FIG. 16 , which will not be described in detail here in the embodiment of the present application. As shown in Figure 16 above, the input of the self-attention encoding network includes three tensors Q, K, and V, and Q, K, and V sequentially undergo a multi-head attention mechanism, summation and normalization operations, feedforward operations, and summation The sum and normalization operations output the first side information. Q, K, and V refer to tensors of data, for example, tensors obtained by embedding and position encoding the data in the current data stream in the foregoing process.
步骤403、编码器根据第一边信息估计得到第一估计概率分布。 Step 403, the encoder obtains a first estimated probability distribution according to the first side information estimation.
可选地,可以将第一边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。该概率分布估计网络可以为单独的一个神经网络,也可以是自注意力解码网络中的一个结构,本申请实施例对此不做限定。Optionally, the first side information may be input into the probability distribution estimation network to obtain a first estimated probability distribution output by the probability distribution estimation network. The probability distribution estimation network may be a single neural network, or a structure in the self-attention decoding network, which is not limited in this embodiment of the present application.
请参考图24,图24为本申请实施例提供的得到第一估计概率分布的过程的一种示意图,图24以初始数据流为二维格式,需要将初始数据流展平,且自注意力解码网络进行概率分布估计为例进行说明为例进行说明。初始数据流a包括4×4排列的16个位置a1至a16,每个位置对应一个数据。将初始数据流a按照从上至下以及从左至右的顺序展平为一维格式,得到包括顺序排列的16个位置a1至a16的当前数据流b。Please refer to Figure 24. Figure 24 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application. Figure 24 uses the initial data stream as a two-dimensional format, which needs to be flattened and self-attention The decoding network performs probability distribution estimation as an example. The initial data stream a includes 16 positions a1 to a16 arranged in 4×4, and each position corresponds to one piece of data. The initial data stream a is flattened into a one-dimensional format from top to bottom and from left to right to obtain a current data stream b including 16 positions a1 to a16 arranged in sequence.
将当前数据流b输入自注意力编码网络,自注意力编码网络确定当前数据流b中每个数据的位置信息,并将每个数据的位置信息与数据结合后,基于结合有位置信息的数据流b中的所有数据(即位置a1至a16对应的数据)输出第一边信息。分解熵模型估计得到第二估计概率分布,熵编码模块利用第二估计概率分布对第一边信息进行熵编码得到第一边信息的码流,熵解码模块利用第二估计概率分布对第一边信息的码流进行熵解码得到第一边信息。将第一边信息输入至自注意力解码网络,自注意力解码网络输出第一估计概率分布(即位置a10对应的数据的估计概率分布)。该过程可以参考前述步骤303,本申请实施例在此不做赘述。图24所示的过程仅为示例性说明,并不对得到第一估计概率分布的过程进行限定。Input the current data stream b into the self-attention coding network, and the self-attention coding network determines the position information of each data in the current data stream b, and combines the position information of each data with the data, based on the data combined with the position information All the data in the stream b (that is, the data corresponding to the positions a1 to a16) output the first side information. Decompose the entropy model to estimate the second estimated probability distribution, the entropy encoding module uses the second estimated probability distribution to entropy encode the first side information to obtain the code stream of the first side information, and the entropy decoding module uses the second estimated probability distribution to encode the first side information Entropy decoding is performed on the code stream of the information to obtain the first side information. The first side information is input to the self-attention decoding network, and the self-attention decoding network outputs the first estimated probability distribution (ie, the estimated probability distribution of the data corresponding to position a10). For this process, reference may be made to the foregoing step 303 , and details are not described here in this embodiment of the present application. The process shown in FIG. 24 is only an exemplary description, and does not limit the process of obtaining the first estimated probability distribution.
步骤404、编码器根据第一估计概率分布对待编码数据进行熵编码以得到第一码流。In step 404, the encoder performs entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain a first code stream.
编码器可以根据第一估计概率分布计算待编码数据的概率值,之后根据该概率值对待编码数据进行熵编码。该第一码流可以是二进制格式。该过程可以参考前述步骤304,本申请实施例在此不做赘述。The encoder may calculate the probability value of the data to be encoded according to the first estimated probability distribution, and then perform entropy encoding on the data to be encoded according to the probability value. The first code stream may be in binary format. For this process, reference may be made to the foregoing step 304 , and details are not described here in this embodiment of the present application.
步骤405、编码器向解码器发送第一码流。 Step 405, the encoder sends the first code stream to the decoder.
该过程可以参考前述步骤305,本申请实施例在此不做赘述。For this process, reference may be made to the foregoing step 305 , and details are not described here in this embodiment of the present application.
步骤406、编码器估计得到第二估计概率分布。 Step 406, the encoder estimates and obtains a second estimated probability distribution.
可选地,可以根据预先设置信息估计得到第二估计概率分布。或者利用训练得到的可学习模型估计得到第二估计概率分布。本申请实施例对得到第二估计概率分布的方式不做限定。Optionally, the second estimated probability distribution may be obtained by estimating according to preset information. Alternatively, the second estimated probability distribution is obtained by estimating the learnable model obtained through training. The embodiment of the present application does not limit the manner of obtaining the second estimated probability distribution.
步骤407、编码器根据第二估计概率分布对第一边信息进行熵编码以得到第二码流。 Step 407, the encoder performs entropy encoding on the first side information according to the second estimated probability distribution to obtain a second code stream.
编码器可以根据第二估计概率分布计算第一边信息的概率值,之后根据该概率值对第一边信息进行熵编码。该第二码流可以是二进制格式。The encoder may calculate the probability value of the first side information according to the second estimated probability distribution, and then perform entropy encoding on the first side information according to the probability value. The second code stream may be in binary format.
步骤408、编码器向解码器发送第二码流。 Step 408, the encoder sends the second code stream to the decoder.
该过程可以参考前述步骤305,本申请实施例在此不做赘述。For this process, reference may be made to the foregoing step 305 , and details are not described here in this embodiment of the present application.
步骤409、解码器估计得到第二估计概率分布。 Step 409, the decoder estimates and obtains a second estimated probability distribution.
可选地,可以根据预先设置信息估计得到第二估计概率分布。或者利用训练得到的可学习模型估计得到第二估计概率分布。本申请实施例对得到第二估计概率分布的方式不做限定。需要说明的是,解码器估计得到的第二估计概率分布需要与编码器估计得到的第二估计概率分布一致。示例地,当编码器根据预先设置信息估计得到第二估计概率分布时,则解码器根据相同的固定信息估计得到第二估计概率分布。当编码器利用训练得到的可学 习模型估计得到第二估计概率分布时,则解码器根据相同的可学习模型估计得到第二估计概率分布,且估计得到的第二估计概率分布相同。Optionally, the second estimated probability distribution may be obtained by estimating according to preset information. Alternatively, the second estimated probability distribution may be obtained by estimating the learnable model obtained through training. The embodiment of the present application does not limit the manner of obtaining the second estimated probability distribution. It should be noted that the second estimated probability distribution estimated by the decoder needs to be consistent with the second estimated probability distribution estimated by the encoder. For example, when the encoder estimates and obtains the second estimated probability distribution according to preset information, the decoder obtains the second estimated probability distribution according to the same fixed information. When the encoder estimates the second estimated probability distribution using the learnable model obtained through training, the decoder estimates the second estimated probability distribution according to the same learnable model, and the estimated second estimated probability distributions are the same.
步骤410、解码器根据第二估计概率分布对第二码流进行熵解码以得到经解码第一边信息。 Step 410, the decoder performs entropy decoding on the second code stream according to the second estimated probability distribution to obtain the decoded first side information.
解码器可以根据第二估计概率分布计算第二码流的概率值,之后根据该概率值对第二码流进行熵解码。The decoder may calculate the probability value of the second code stream according to the second estimated probability distribution, and then perform entropy decoding on the second code stream according to the probability value.
步骤411、解码器根据经解码第一边信息估计得到第一估计概率分布。 Step 411, the decoder estimates and obtains a first estimated probability distribution according to the decoded first side information.
可选地,可以将经解码第一边信息输入概率分布估计网络,以得到概率分布估计网络输出的第一估计概率分布。该过程可以参考前述步骤307,本申请实施例在此不做赘述。Optionally, the decoded first side information may be input into the probability distribution estimation network to obtain a first estimated probability distribution output by the probability distribution estimation network. For this process, reference may be made to the foregoing step 307, and details are not described here in this embodiment of the present application.
步骤412、解码器根据第一估计概率分布对第一码流进行熵解码以得到经解码数据。 Step 412, the decoder performs entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data.
解码器可以根据第一估计概率分布计算第一码流的概率值,之后根据该概率值对第一码流进行熵解码。该过程可以参考前述步骤308,本申请实施例在此不做赘述。The decoder may calculate the probability value of the first code stream according to the first estimated probability distribution, and then perform entropy decoding on the first code stream according to the probability value. For this process, reference may be made to the foregoing step 308 , and details are not described here in this embodiment of the present application.
综上所述,本申请实施例提供的熵编解码方法,编码器获取当前数据流包含的待编码数据以及第一边信息,之后根据第一边信息估计得到第一估计概率分布,并根据第一估计概率分布对待编码数据进行熵编码以得到第一码流,之后向解码器发送第一码流,编码器估计得到第二估计概率分布,根据第二估计概率分布对第一边信息进行熵编码以得到第二码流,并向解码器发送第二码流,解码器估计得到第二估计概率分布,根据第二估计概率分布对第二码流进行熵解码以得到第一边信息,并根据该第一边信息估计得到第一估计概率分布,再根据第一估计概率分布对第一码流进行熵解码,第一边信息是将多个数据输入自注意力编码网络得到的,自注意力编码网络可以对输入的所有数据利用相应的权重进行加权得到第一边信息。这样得到的第一边信息的内容较为全面。在后续利用第一边信息估计第一估计概率分布时,能够提高得到的第一估计概率分布的准确性,减小了熵编码过程中的码率,从而减小了熵编码开销以及第一码流传输至解码器时的带宽占用率,提高了第一码流传输至解码器的传输效率。To sum up, in the entropy encoding and decoding method provided by the embodiment of the present application, the encoder obtains the data to be encoded and the first side information contained in the current data stream, and then estimates the first estimated probability distribution according to the first side information, and then obtains the first estimated probability distribution according to the first side information. Entropy encoding the data to be encoded to obtain the first code stream through an estimated probability distribution, and then sending the first code stream to the decoder, the encoder estimates the second estimated probability distribution, and entropy-encodes the first side information according to the second estimated probability distribution Encoding to obtain a second code stream, and sending the second code stream to a decoder, the decoder estimates to obtain a second estimated probability distribution, performs entropy decoding on the second code stream according to the second estimated probability distribution to obtain the first side information, and The first estimated probability distribution is estimated according to the first side information, and then the first code stream is entropy decoded according to the first estimated probability distribution. The first side information is obtained by inputting a plurality of data into the self-attention coding network, and the self-attention The force encoding network can weight all the input data with corresponding weights to obtain the first side information. The content of the first side information obtained in this way is relatively comprehensive. When the first estimated probability distribution is subsequently estimated using the first side information, the accuracy of the obtained first estimated probability distribution can be improved, and the code rate in the entropy coding process can be reduced, thereby reducing the entropy coding overhead and the first code The bandwidth occupancy rate when the stream is transmitted to the decoder improves the transmission efficiency of the first code stream transmitted to the decoder.
本申请实施例提供的方法的先后顺序可以进行适当调整,步骤也可以根据情况进行相应增减,例如步骤403至405和步骤406至408这两个流程可以同时执行。任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本申请的保护范围之内,本申请实施例对此不做限定。The sequence of the method provided in the embodiment of the present application can be appropriately adjusted, and the steps can also be increased or decreased according to the situation. For example, the two processes of steps 403 to 405 and steps 406 to 408 can be executed simultaneously. Any person skilled in the art within the technical scope disclosed in this application can easily think of changing methods, which should be covered within the scope of protection of this application, which is not limited in the embodiments of this application.
请参考图25,图25为本申请实施例提供的熵编解码方法的过程500的流程图。过程500可由编码器和解码器执行,具体的,可以由编码器的熵编码单元和解码器的熵解码单元来执行。过程500描述为一系列的步骤或操作,应当理解的是,过程500可以以各种顺序执行和/或同时发生,不限于图25所示的执行顺序。假设具有多个数据的当前数据流正在使用编码器和解码器,执行包括如下步骤的过程500来对数据进行熵编码和熵解码。过程500可以包括:Please refer to FIG. 25 , which is a flowchart of a process 500 of the entropy encoding and decoding method provided by the embodiment of the present application. The process 500 can be performed by an encoder and a decoder, specifically, it can be performed by an entropy encoding unit of the encoder and an entropy decoding unit of the decoder. The process 500 is described as a series of steps or operations. It should be understood that the process 500 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 25 . Assuming that a current data stream with multiple data is using an encoder and decoder, a process 500 including the following steps is performed to entropy encode and decode data. Process 500 may include:
步骤501、编码器获取待编码数据,待编码数据是当前数据流包含的多个数据中非首位编码的数据。In step 501, the encoder obtains data to be encoded, and the data to be encoded is the non-first encoded data among multiple data included in the current data stream.
该过程可以参考前述步骤301,本申请实施例在此不做赘述。For this process, reference may be made to the aforementioned step 301, and details are not described here in this embodiment of the present application.
步骤502、编码器获取第一上下文信息和第一边信息。 Step 502, the encoder acquires first context information and first side information.
该过程可以参考前述步骤302和402,本申请实施例在此不做赘述。For this process, reference may be made to the foregoing steps 302 and 402, and details are not described here in this embodiment of the present application.
步骤503、编码器根据第一上下文信息和第一边信息估计得到第一估计概率分布。 Step 503, the encoder estimates and obtains a first estimated probability distribution according to the first context information and the first side information.
编码器可以将第一上下文信息和第一边信息进行聚合,根据聚合后的信息估计得到第一估计概率分布。可选地,编码器可以将第一上下文信息和第一边信息通过聚合网络聚合。聚合网络可以包括自注意力解码网络,自注意力解码网络具备自注意力机制,其能够充分得到第一上下文信息和第一边信息的互补性,后续能够利用这两个信息高效地估计得到第一估计概率分布,从而提高估计得到的第一估计概率分布的准确性。根据聚合后的信息估计得到第一估计概率分布的过程可以参考前述步骤303,本申请实施例在此不做赘述。The encoder may aggregate the first context information and the first side information, and estimate and obtain a first estimated probability distribution according to the aggregated information. Optionally, the encoder may aggregate the first context information and the first side information through an aggregation network. The aggregation network can include a self-attention decoding network. The self-attention decoding network has a self-attention mechanism, which can fully obtain the complementarity of the first context information and the first side information, and then use these two information to efficiently estimate the second An estimated probability distribution, thereby improving the accuracy of the estimated first estimated probability distribution. For the process of estimating and obtaining the first estimated probability distribution according to the aggregated information, reference may be made to the foregoing step 303 , which will not be described in detail here in the embodiment of the present application.
步骤504、编码器根据第一估计概率分布对待编码数据进行熵编码以得到第一码流。 Step 504, the encoder performs entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain a first code stream.
该过程可以参考前述步骤304,本申请实施例在此不做赘述。For this process, reference may be made to the foregoing step 304 , and details are not described here in this embodiment of the present application.
步骤505、编码器向解码器发送第一码流。 Step 505, the encoder sends the first code stream to the decoder.
需要说明的是,编码器对当前数据流包括的每个非首位编码的数据进行熵编码后得到每个非首位数据的码流。进而根据每个非首位数据的码流得到当前码流。对于首位编码的数据,其码流可以包含在当前码流中以传输至解码器。或者编码器将其码流单独发送至解码器。该过程可以参考前述步骤305,本申请实施例在此不做赘述。It should be noted that, the encoder performs entropy encoding on each non-first encoded data included in the current data stream to obtain a code stream of each non-first data. Furthermore, the current code stream is obtained according to the code stream of each non-first data. For the first coded data, its code stream can be included in the current code stream to be transmitted to the decoder. Or the encoder sends its bitstream to the decoder alone. For this process, reference may be made to the foregoing step 305 , and details are not described here in this embodiment of the present application.
步骤506、编码器估计得到第二估计概率分布。 Step 506, the encoder estimates to obtain a second estimated probability distribution.
该过程可以参考前述步骤406,本申请实施例在此不做赘述。For this process, reference may be made to the aforementioned step 406, which will not be described in detail here in this embodiment of the present application.
步骤507、编码器根据第二估计概率分布对第一边信息进行熵编码以得到第二码流。 Step 507, the encoder performs entropy encoding on the first side information according to the second estimated probability distribution to obtain a second code stream.
该过程可以参考前述步骤407,本申请实施例在此不做赘述。For this process, reference may be made to the aforementioned step 407, and details are not described here in this embodiment of the present application.
步骤508、编码器向解码器发送第二码流。 Step 508, the encoder sends the second code stream to the decoder.
可选地,编码器可以将第二码流单独发送至解码器,也可以将第二码流添加在第一码流中发送至解码器,本申请实施例对第二码流的发送方式不做限定。该过程可以参考前述步骤405,本申请实施例在此不做赘述。Optionally, the encoder can send the second code stream to the decoder alone, or add the second code stream to the first code stream and send it to the decoder. Do limited. For this process, reference may be made to the foregoing step 405 , and details are not described here in this embodiment of the present application.
步骤509、解码器获取第一上下文信息。 Step 509, the decoder obtains the first context information.
第一上下文信息的获取方式可以参考前述步骤306,本申请实施例在此不做赘述。For the manner of acquiring the first context information, reference may be made to the aforementioned step 306, which will not be described in detail here in this embodiment of the present application.
步骤510、解码器估计得到第二估计概率分布。 Step 510, the decoder estimates and obtains a second estimated probability distribution.
第二码流为第一边信息的码流,该过程可以参考前述步骤409,本申请实施例在此不做赘述。需要说明的是,解码器估计得到的第二估计概率分布需要与编码器估计得到的第二估计概率分布一致。The second code stream is the code stream of the first side information. For this process, reference may be made to the aforementioned step 409, and details are not described here in this embodiment of the present application. It should be noted that the second estimated probability distribution estimated by the decoder needs to be consistent with the second estimated probability distribution estimated by the encoder.
步骤511、解码器根据第二估计概率分布对第二码流进行熵解码以得到经解码第一边信息。 Step 511, the decoder performs entropy decoding on the second code stream according to the second estimated probability distribution to obtain the decoded first side information.
该过程可以参考前述步骤410,本申请实施例在此不做赘述。For this process, reference may be made to the foregoing step 410, and details are not described here in this embodiment of the present application.
步骤512、解码器根据第一上下文信息和经解码第一边信息估计得到第一估计概率分布。 Step 512, the decoder estimates and obtains a first estimated probability distribution according to the first context information and the decoded first side information.
该过程可以参考前述步骤303和403,本申请实施例在此不做赘述。For this process, reference may be made to the foregoing steps 303 and 403, and details are not described here in this embodiment of the present application.
步骤513、解码器根据第一估计概率分布对第一码流进行熵解码以得到经解码数据,经解码数据为当前数据流包含的多个数据中非首位解码的数据。 Step 513 , the decoder performs entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, where the decoded data is non-first decoded data among multiple data included in the current data stream.
对第一码流进行熵解码的过程可以参考前述步骤308,本申请实施例在此不做赘述。需要说明的是,在每解码得到一个数据后,即将该数据添加进已解码数据。For the process of performing entropy decoding on the first code stream, reference may be made to the foregoing step 308, and details are not described here in this embodiment of the present application. It should be noted that after each piece of data is decoded, the data is added to the decoded data.
综上所述,本申请实施例提供的熵编解码方法,编码器获取当前数据流、第一上下文 信息以及第一遍信息,之后根据第一上下文信息和第一边信息估计得到第一估计概率分布,并根据第一估计概率分布对待编码数据进行熵编码以得到第一码流,之后向解码器发送第一码流,编码器估计得到第二估计概率分布,根据第二估计概率分布对第一边信息进行熵编码以得到第二码流,并向解码器发送第二码流,解码器估计得到第二估计概率分布,根据第二估计概率分布对第二码流进行熵解码以得到第一边信息,解码器根据第一上下文信息和第一边信息估计得到第一估计概率分布,再根据第一估计概率分布对第一码流进行熵解码,第一上下文信息是将至少一个已编码数据或已解码数据输入自注意力解码网络得到的,自注意力解码网络可以对输入的所有已编码数据利用相应的权重进行加权得到第一上下文信息。第一边信息是将多个数据输入自注意力编码网络得到的,自注意力编码网络可以对输入的所有数据利用相应的权重进行加权得到第一边信息。这样,提高了获取第一上下文信息的过程中对已编码数据的利用率且得到的第一边信息的内容较为全面。在利用第一上下文信息和第一边信息估计得到第一估计概率分布时,能够提高得到的第一估计概率分布的准确性,进一步减小熵编码过程中的码率,进一步减小熵编码开销,从而减小了熵编码开销以及第一码流传输至解码器时的带宽占用率,提高了第一码流传输至解码器的传输效率。且在获取第一上下文信息的过程中无需考虑各个数据的位置信息,因此对多个数据的熵编码或熵解码过程可以并行执行,并行执行耗时较短,提高了熵编码和熵解码的效率。To sum up, in the entropy encoding and decoding method provided by the embodiment of the present application, the encoder obtains the current data stream, the first context information and the first pass information, and then estimates the first estimated probability according to the first context information and the first side information distribution, and perform entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain the first code stream, and then send the first code stream to the decoder, and the encoder estimates the second estimated probability distribution, and according to the second estimated probability distribution, the first code stream Perform entropy encoding on one side of the information to obtain the second code stream, and send the second code stream to the decoder, the decoder estimates the second estimated probability distribution, and performs entropy decoding on the second code stream according to the second estimated probability distribution to obtain the second code stream side information, the decoder estimates the first estimated probability distribution according to the first context information and the first side information, and then performs entropy decoding on the first code stream according to the first estimated probability distribution, the first context information is at least one encoded The data or the decoded data is obtained by inputting the self-attention decoding network, and the self-attention decoding network can weight all the input encoded data with corresponding weights to obtain the first context information. The first side information is obtained by inputting multiple data into the self-attention encoding network, and the self-attention encoding network can weight all the input data with corresponding weights to obtain the first side information. In this way, the utilization rate of encoded data in the process of acquiring the first context information is improved, and the content of the obtained first side information is more comprehensive. When the first estimated probability distribution is estimated by using the first context information and the first side information, the accuracy of the obtained first estimated probability distribution can be improved, the code rate in the entropy coding process can be further reduced, and the entropy coding overhead can be further reduced , thereby reducing the entropy encoding overhead and the bandwidth occupancy rate when the first code stream is transmitted to the decoder, and improving the transmission efficiency of the first code stream transmitted to the decoder. And in the process of obtaining the first context information, there is no need to consider the location information of each data, so the entropy encoding or entropy decoding process of multiple data can be executed in parallel, and the parallel execution takes less time, which improves the efficiency of entropy encoding and entropy decoding .
本申请实施例提供的方法的先后顺序可以进行适当调整,步骤也可以根据情况进行相应增减。任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本申请的保护范围之内,本申请实施例对此不做限定。The order of the methods provided in the embodiments of the present application can be adjusted appropriately, and the steps can also be increased or decreased according to the situation. Any person skilled in the art within the technical scope disclosed in this application can easily think of changing methods, which should be covered within the scope of protection of this application, which is not limited in the embodiments of this application.
请参考图26,图26为本申请实施例提供的熵编解码方法的过程600的流程图。过程600可由编码器和解码器执行,具体的,可以由编码器的熵编码单元和解码器的熵解码单元来执行。过程600描述为一系列的步骤或操作,应当理解的是,过程600可以以各种顺序执行和/或同时发生,不限于图26所示的执行顺序。假设具有多个数据的当前数据流正在使用编码器和解码器,执行包括如下步骤的过程600来对数据进行熵编码和熵解码。过程600可以包括:Please refer to FIG. 26 , which is a flowchart of a process 600 of the entropy encoding and decoding method provided by the embodiment of the present application. The process 600 can be performed by an encoder and a decoder, specifically, it can be performed by an entropy encoding unit of the encoder and an entropy decoding unit of the decoder. The process 600 is described as a series of steps or operations. It should be understood that the process 600 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 26 . Assuming that a current data stream with multiple data is using an encoder and a decoder, a process 600 including the following steps is performed to entropy encode and decode data. Process 600 may include:
步骤601、编码器获取待编码数据,待编码数据是当前数据流包含的多个数据中非首位编码的数据。In step 601, the encoder acquires data to be encoded, and the data to be encoded is the non-first encoded data among multiple data included in the current data stream.
需要说明的是,在对当前数据流包含的多个数据进行熵编码时,通常先对首位数据进行熵编码之后再对待编码数据进行熵编码。对于首位编码的数据,可以根据预先设置信息估计得到第四估计概率分布。或者利用训练得到的可学习模型估计得到第四估计概率分布。或者根据第一边信息和/或第二边信息估计得到第四估计概率分布。再根据第四估计概率分布对首位编码的数据进行熵编码以得到第四码流。本申请实施例对得到第四估计概率分布的方式不做限定。It should be noted that, when entropy encoding is performed on multiple pieces of data included in the current data stream, entropy encoding is generally performed on the first data first, and then entropy encoding is performed on the data to be encoded. For the first encoded data, the fourth estimated probability distribution may be obtained by estimating according to preset information. Alternatively, the fourth estimated probability distribution is obtained by estimating the learnable model obtained through training. Or estimate and obtain the fourth estimated probability distribution according to the first side information and/or the second side information. Entropy encoding is then performed on the first encoded data according to the fourth estimated probability distribution to obtain a fourth code stream. The embodiment of the present application does not limit the manner of obtaining the fourth estimated probability distribution.
该过程可以参考前述步骤301,本申请实施例在此不做赘述。For this process, reference may be made to the aforementioned step 301, and details are not described here in this embodiment of the present application.
步骤602、编码器获取第一上下文信息、第二上下文信息、第一边信息和第二边信息。 Step 602, the encoder acquires first context information, second context information, first side information and second side information.
第一上下文信息的获取方式等可以参考前述步骤302,第一边信息的获取方式可以参考前述步骤402,本申请实施例在此不做赘述。For the manner of acquiring the first context information, refer to the aforementioned step 302, and for the manner of acquiring the first side information, refer to the aforementioned step 402, which will not be repeated in this embodiment of the present application.
第二上下文信息是将至少一个已编码数据中符合预设条件的至少一个数据输入遮掩 卷积网络(Masked Convolution network)得到的。符合预设条件的至少一个数据可以是多个数据的至少一个已编码数据中与待编码数据近邻的至少一个数据。获取第二上下文信息的过程中利用到了已编码数据,能够提高后续估计得到的第一估计概率分布的准确性,从而减小熵编码过程中的码率,实现减小熵编码开销。The second context information is obtained by inputting at least one piece of data that meets the preset condition in the at least one coded data into a masked convolution network (Masked Convolution network). The at least one piece of data that meets the preset condition may be at least one piece of data that is adjacent to the data to be encoded among the at least one encoded data of the plurality of data. The encoded data is used in the process of obtaining the second context information, which can improve the accuracy of the first estimated probability distribution obtained by the subsequent estimation, thereby reducing the code rate in the process of entropy encoding and reducing the overhead of entropy encoding.
由此可知,前述图20所示实施例中的第一上下文信息是基于多个数据中的至少一个已编码数据得到的,该步骤602中的第二上下文信息是基于该至少一个已编码数据中与待编码数据近邻的至少一个数据得到的。以前述图21所示的初始数据流为例,第一上下文信息是基于位置a1至a9对应的数据得到的,第二上下文信息是基于与位置a10近邻的至少一个已解码数据(例如位置a6和位置a9对应的数据)得到的。即相较于第二上下文信息,第一上下文信息对已编码数据的利用率较高,内容较全面。It can be seen that the first context information in the embodiment shown in FIG. 20 is obtained based on at least one coded data among the plurality of data, and the second context information in step 602 is obtained based on the at least one coded data. Obtained from at least one piece of data adjacent to the data to be encoded. Taking the initial data stream shown in FIG. 21 as an example, the first context information is obtained based on the data corresponding to positions a1 to a9, and the second context information is obtained based on at least one decoded data adjacent to position a10 (for example, positions a6 and The data corresponding to position a9) is obtained. That is, compared with the second context information, the first context information has a higher utilization rate of encoded data and more comprehensive content.
第二边信息是将多个数据中符合预设条件的至少一个数据输入超编码网络(Hyper Encoder)得到的。符合预设条件的至少一个数据可以是多个数据中与待编码数据近邻的至少一个数据。The second side information is obtained by inputting at least one data that meets the preset conditions among the multiple data into a hyperencoder network (Hyper Encoder). The at least one piece of data that meets the preset condition may be at least one piece of data that is adjacent to the data to be encoded among the multiple pieces of data.
由此可知,前述图23所示实施例中的第一边信息是基于多个数据得到的,该步骤602中的第二边信息是基于该多个数据中与待编码数据近邻的至少一个数据得到的。以前述图21所示的初始数据流为例,第一边信息是基于位置a1至a16对应的数据得到的,第二边信息是基于与位置a10近邻的至少一个数据(例如位置a6、位置a9、位置a11以及位置a14对应的数据)得到的。即相较于第二边信息,第一边信息对数据的利用率较高,内容较全面。It can be seen that the first side information in the embodiment shown in FIG. 23 is obtained based on a plurality of data, and the second side information in step 602 is based on at least one data adjacent to the data to be encoded among the plurality of data. owned. Taking the initial data flow shown in Figure 21 as an example, the first side information is obtained based on the data corresponding to positions a1 to a16, and the second side information is obtained based on at least one data adjacent to position a10 (such as position a6, position a9 , data corresponding to position a11 and position a14) obtained. That is, compared with the second side information, the first side information has a higher utilization rate of data and more comprehensive content.
遮掩卷积网络或超编码网络具备局部感受野。遮掩卷积网络包括掩膜卷积层或常规卷积层,其输入为至少一个已编码数据中与待编码数据近邻的至少一个数据,输出为卷积输出的激活特征,即第二上下文信息。超编码网络包括常规卷积层,其输入为多个数据中与待编码数据近邻的至少一个数据,输出为卷积输出的激活特征,即第二边信息。Masked convolutional networks or superencoded networks have local receptive fields. The masked convolutional network includes a masked convolutional layer or a regular convolutional layer, the input of which is at least one piece of data adjacent to the data to be encoded in at least one encoded data, and the output is the activation feature of the convolution output, that is, the second context information. The super-encoding network includes a conventional convolutional layer, whose input is at least one data adjacent to the data to be encoded among the multiple data, and the output is the activation feature of the convolution output, that is, the second side information.
编码器通过遮掩卷积网络得到第二上下文信息的方式、编码器通过超编码网络得到第二边信息的方式、以及遮掩卷积网络和超编码网络的架构均可以参考前述步骤302中自注意力解码网络的相关内容,本申请实施例在此不做赘述。The way the encoder obtains the second context information through the masked convolutional network, the way the encoder obtains the second side information through the super-encoded network, and the architecture of the masked convolutional network and the super-encoded network can all refer to the self-attention in step 302 above. The relevant content of the decoding network is not described here in this embodiment of the present application.
本申请实施例中,后续联合第一上下文信息、第一边信息、第二上下文信息和第二边信息估计得到第一估计概率分布,能够进一步提高得到的第一估计概率分布的准确性,从而减小熵编码过程中的码率,实现减小熵编码开销。In the embodiment of the present application, the first estimated probability distribution can be obtained by combining the first context information, the first side information, the second context information and the second side information, which can further improve the accuracy of the obtained first estimated probability distribution, so that Reduce the code rate in the process of entropy encoding to realize the reduction of entropy encoding overhead.
步骤603、编码器根据第一上下文信息、第二上下文信息、第一边信息和第二边信息估计得到第一估计概率分布。 Step 603, the encoder estimates and obtains a first estimated probability distribution according to the first context information, the second context information, the first side information and the second side information.
编码器可以将第一上下文信息、第二上下文信息、第一边信息和第二边信息进行聚合,根据聚合后的信息估计得到第一估计概率分布。可选地,编码器可以将第一上下文信息、第二上下文信息、第一边信息和第二边信息通过聚合网络聚合。聚合网络可以包括自注意解码网络,自注意解码网络具备自注意力机制,其能够充分得到第一上下文信息、第一边信息、第二上下文信息和第二边信息的互补性,后续能够利用这四个信息高效地估计得到第一估计概率分布,从而提高估计得到的第一估计概率分布的准确性。根据聚合后的信息估计得到第一估计概率分布的过程可以参考前述步骤303,本申请实施例在此不做赘述。The encoder may aggregate the first context information, the second context information, the first side information, and the second side information, and estimate and obtain a first estimated probability distribution according to the aggregated information. Optionally, the encoder may aggregate the first context information, the second context information, the first side information and the second side information through an aggregation network. The aggregation network can include a self-attention decoding network. The self-attention decoding network has a self-attention mechanism, which can fully obtain the complementarity of the first context information, the first side information, the second context information and the second side information. The four pieces of information are efficiently estimated to obtain the first estimated probability distribution, thereby improving the accuracy of the estimated first estimated probability distribution. For the process of estimating and obtaining the first estimated probability distribution according to the aggregated information, reference may be made to the foregoing step 303 , which will not be described in detail here in the embodiment of the present application.
请参考图27,图27为本申请实施例提供的得到第一估计概率分布的过程的一种示意 图,图27以图21所示的初始数据流为例,将初始数据流a按照从上至下以及从左至右的顺序展平为一维格式,得到包括顺序排列的16个位置a1至a16的当前数据流b。将当前数据流b分别输入超编码网络、自注意力编码网络、自注意力解码网络和遮掩卷积网络。超编码网络和自注意力编码网络分别输出第二边信息和第一边信息,分解熵模型估计得到第二估计概率分布,超熵模型估计得到第三估计概率分布。熵编码模块根据第二估计概率分布对第一边信息进行熵编码,熵解码模块根据第二估计概率分布对第一边信息进行熵解码,将熵解码后的第一边信息输入聚合网络。熵编码模块根据第三估计概率分布对第二边信息进行熵编码,熵解码模块根据第三估计概率分布对第二边信息进行熵解码,将熵解码后的第二边信息输入聚合网络。自注意力解码网络和遮掩卷积网络分别输出第一上下文信息和第二上下文信息,该第一上下文信息和第二上下文信息均输入至聚合网络。聚合网络对输入的第一上下文信息、第二上下文信息、第一边信息和第二边信息进行聚合,并输出第一估计概率分布(即位置a10对应的数据的估计概率分布)。图27所示的过程仅为示例性说明,并不对得到第一估计概率分布的过程进行限定。Please refer to FIG. 27. FIG. 27 is a schematic diagram of the process of obtaining the first estimated probability distribution provided by the embodiment of the present application. FIG. 27 takes the initial data flow shown in FIG. The sequence from bottom to bottom and from left to right is flattened into a one-dimensional format, and the current data stream b including 16 positions a1 to a16 arranged in sequence is obtained. The current data stream b is fed into the super-encoding network, self-attention encoding network, self-attention decoding network and masked convolutional network respectively. The super-encoding network and the self-attention encoding network output the second side information and the first side information respectively, decompose the entropy model estimation to obtain the second estimated probability distribution, and the hyper-entropy model estimation obtains the third estimated probability distribution. The entropy encoding module entropy encodes the first side information according to the second estimated probability distribution, the entropy decoding module performs entropy decoding on the first side information according to the second estimated probability distribution, and inputs the entropy decoded first side information into the aggregation network. The entropy encoding module entropy encodes the second side information according to the third estimated probability distribution, the entropy decoding module performs entropy decoding on the second side information according to the third estimated probability distribution, and inputs the entropy decoded second side information into the aggregation network. The self-attention decoding network and the masking convolutional network output the first context information and the second context information respectively, and both the first context information and the second context information are input to the aggregation network. The aggregation network aggregates the input first context information, second context information, first side information and second side information, and outputs the first estimated probability distribution (ie, the estimated probability distribution of the data corresponding to position a10). The process shown in FIG. 27 is only an exemplary description, and does not limit the process of obtaining the first estimated probability distribution.
步骤604、编码器根据第一估计概率分布对待编码数据进行熵编码以得到第一码流。In step 604, the encoder performs entropy encoding on the data to be encoded according to the first estimated probability distribution to obtain a first code stream.
得到第一码流的过程可以参考前述步骤304,本申请实施例在此不做赘述。For the process of obtaining the first code stream, reference may be made to the aforementioned step 304, and details are not described here in this embodiment of the present application.
步骤605、编码器向解码器发送第一码流。 Step 605, the encoder sends the first code stream to the decoder.
需要说明的是,编码器对当前数据流包括的每个非首位编码的数据进行熵编码后得到每个非首位数据的码流。进而根据每个非首位数据的码流得到当前码流。对于首位编码的数据,第四码流可以包含在当前码流中以传输至解码器。或者编码器将第四码流单独发送至解码器。该过程可以参考前述步骤305,本申请实施例在此不做赘述。It should be noted that, the encoder performs entropy encoding on each non-first encoded data included in the current data stream to obtain a code stream of each non-first data. Furthermore, the current code stream is obtained according to the code stream of each non-first data. For data coded at the first bit, the fourth code stream can be included in the current code stream for transmission to the decoder. Or the encoder sends the fourth code stream to the decoder separately. For this process, reference may be made to the foregoing step 305 , and details are not described here in this embodiment of the present application.
步骤606、编码器估计得到第二估计概率分布。 Step 606, the encoder estimates and obtains a second estimated probability distribution.
该过程可以参考前述步骤406,本申请实施例在此不做赘述。For this process, reference may be made to the aforementioned step 406, which will not be described in detail here in this embodiment of the present application.
步骤607、编码器根据第二估计概率分布对第一边信息进行熵编码以得到第二码流。 Step 607, the encoder performs entropy encoding on the first side information according to the second estimated probability distribution to obtain a second code stream.
该过程可以参考前述步骤407,本申请实施例在此不做赘述。For this process, reference may be made to the aforementioned step 407, and details are not described here in this embodiment of the present application.
步骤608、编码器向解码器发送第二码流。 Step 608, the encoder sends the second code stream to the decoder.
可选地,编码器可以将第二码流单独发送至解码器,也可以将第二码流添加在第一码流中发送至解码器,本申请实施例对第二码流的发送方式不做限定。该过程可以参考前述步骤305,本申请实施例在此不做赘述。Optionally, the encoder can send the second code stream to the decoder alone, or add the second code stream to the first code stream and send it to the decoder. Do limited. For this process, reference may be made to the foregoing step 305 , and details are not described here in this embodiment of the present application.
步骤609、编码器估计得到第三估计概率分布。 Step 609, the encoder estimates and obtains a third estimated probability distribution.
该过程可以参考前述步骤406,本申请实施例在此不做赘述。For this process, reference may be made to the aforementioned step 406, which will not be described in detail here in this embodiment of the present application.
步骤610、编码器根据第三估计概率分布对第二边信息进行熵编码以得到第三码流。 Step 610, the encoder performs entropy encoding on the second side information according to the third estimated probability distribution to obtain a third code stream.
该过程可以参考前述步骤407,本申请实施例在此不做赘述。For this process, reference may be made to the aforementioned step 407, and details are not described here in this embodiment of the present application.
步骤611、编码器向解码器发送第三码流。 Step 611, the encoder sends the third code stream to the decoder.
可选地,编码器可以将第三码流单独发送至解码器,也可以将第三码流添加在第一码流中发送至解码器,本申请实施例对第三码流的发送方式不做限定。该过程可以参考前述步骤305,本申请实施例在此不做赘述。Optionally, the encoder can send the third code stream to the decoder alone, or add the third code stream to the first code stream and send it to the decoder. Do limited. For this process, reference may be made to the foregoing step 305 , and details are not described here in this embodiment of the present application.
步骤612、解码器获取第一上下文信息和第二上下文信息。 Step 612, the decoder acquires the first context information and the second context information.
第一上下文信息的获取方式可以参考前述步骤306,本申请实施例在此不做赘述。For the manner of acquiring the first context information, reference may be made to the aforementioned step 306, which will not be described in detail here in this embodiment of the present application.
该第一码流属于解码器接收到的当前码流中的一个码流,其解码后的经解码数据为当 前码流包含的多个数据中非首位解码的数据。第二上下文信息可以是将至少一个已解码数据中与符合预设条件的至少一个数据输入遮掩卷积网络得到的。该遮掩卷积网络可以参考前述步骤602,本申请实施例在此不做赘述。The first code stream belongs to a code stream in the current code stream received by the decoder, and the decoded data after decoding is the non-first decoded data among the multiple data contained in the current code stream. The second context information may be obtained by inputting at least one piece of at least one piece of decoded data that meets a preset condition into the masked convolutional network. For the masked convolutional network, reference may be made to the foregoing step 602, which will not be described in detail here in this embodiment of the present application.
需要说明的是,解码器在对接收到的当前码流中的各个码流进行熵解码时,通常先对第四码流进行熵解码。解码器可以根据预先设置信息估计得到第四估计概率分布。或者利用训练得到的可学习模型估计得到第四估计概率分布。或者根据第一边信息和/或第二边信息估计得到第四估计概率分布。再根据第四估计概率分布对第四码流进行熵解码以得到经解码首位数据,经解码首位数据是多个数据中首位解码的数据。It should be noted that, when the decoder performs entropy decoding on each code stream in the received current code stream, it usually performs entropy decoding on the fourth code stream first. The decoder can estimate and obtain the fourth estimated probability distribution according to preset information. Alternatively, the fourth estimated probability distribution is obtained by estimating the learnable model obtained through training. Or estimate and obtain the fourth estimated probability distribution according to the first side information and/or the second side information. Then perform entropy decoding on the fourth code stream according to the fourth estimated probability distribution to obtain decoded first data, where the decoded first data is first decoded data among the plurality of data.
解码器估计得到的第四估计概率分布需要与编码器估计得到的第四估计概率分布一致。示例地,当编码器根据预先设置信息估计得到第四估计概率分布时,则解码器根据相同的固定信息估计得到第四估计概率分布。当编码器利用训练得到的可学习模型估计得到第四估计概率分布时,则解码器根据相同的可学习模型估计得到第四估计概率分布,且估计得到的第四估计概率分布相同。当编码器根据第一边信息和第二边信息估计得到第四估计概率分布时,则解码器根据第一边信息和第二边信息估计得到第四估计概率分布。The fourth estimated probability distribution estimated by the decoder needs to be consistent with the fourth estimated probability distribution estimated by the encoder. For example, when the encoder estimates and obtains the fourth estimated probability distribution according to preset information, the decoder obtains the fourth estimated probability distribution according to the same fixed information. When the encoder estimates the fourth estimated probability distribution by using the learnable model obtained through training, the decoder estimates the fourth estimated probability distribution according to the same learnable model, and the estimated fourth estimated probability distribution is the same. When the encoder estimates and obtains the fourth estimated probability distribution according to the first side information and the second side information, the decoder obtains the fourth estimated probability distribution according to the first side information and the second side information.
步骤613、解码器估计得到第二估计概率分布。 Step 613, the decoder estimates and obtains a second estimated probability distribution.
该过程可以参考前述步骤409,本申请实施例在此不做赘述。需要说明的是,解码器估计得到的第二估计概率分布需要与编码器估计得到的第二估计概率分布一致。For this process, reference may be made to the foregoing step 409 , and details are not described here in this embodiment of the present application. It should be noted that the second estimated probability distribution estimated by the decoder needs to be consistent with the second estimated probability distribution estimated by the encoder.
步骤614、解码器根据第二估计概率分布对第二码流进行熵解码以得到经解码第一边信息。 Step 614, the decoder performs entropy decoding on the second code stream according to the second estimated probability distribution to obtain the decoded first side information.
该过程可以参考前述步骤410,本申请实施例在此不做赘述。For this process, reference may be made to the foregoing step 410, and details are not described here in this embodiment of the present application.
步骤615、解码器估计得到第三估计概率分布。 Step 615, the decoder estimates and obtains a third estimated probability distribution.
该过程可以参考前述步骤409,本申请实施例在此不做赘述。需要说明的是,解码器估计得到的第三估计概率分布需要与编码器估计得到的第三估计概率分布一致。For this process, reference may be made to the foregoing step 409 , and details are not described here in this embodiment of the present application. It should be noted that the third estimated probability distribution estimated by the decoder needs to be consistent with the third estimated probability distribution estimated by the encoder.
步骤616、解码器根据第三估计概率分布对第三码流进行熵解码以得到经解码第二边信息。 Step 616, the decoder performs entropy decoding on the third code stream according to the third estimated probability distribution to obtain decoded second side information.
该过程可以参考前述步骤410,本申请实施例在此不做赘述。For this process, reference may be made to the foregoing step 410, and details are not described here in this embodiment of the present application.
步骤617、解码器根据第一上下文信息、第二上下文信息、经解码第一边信息和经解码第二边信息估计得到第一估计概率分布。 Step 617, the decoder estimates and obtains a first estimated probability distribution according to the first context information, the second context information, the decoded first side information and the decoded second side information.
该过程可以参考前述步骤303和403,本申请实施例在此不做赘述。For this process, reference may be made to the foregoing steps 303 and 403, and details are not described here in this embodiment of the present application.
步骤618、解码器根据第一估计概率分布对第一码流进行熵解码以得到经解码数据,经解码数据为当前数据流包含的多个数据中非首位解码的数据。Step 618: The decoder performs entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, where the decoded data is non-first decoded data among multiple data included in the current data stream.
对第一码流进行熵解码的过程可以参考前述步骤308,本申请实施例在此不做赘述。需要说明的是,在每解码得到一个数据后,即将该数据添加进已解码数据。For the process of performing entropy decoding on the first code stream, reference may be made to the foregoing step 308, and details are not described here in this embodiment of the present application. It should be noted that after each piece of data is decoded, the data is added to the decoded data.
综上所述,本申请实施例提供的熵编解码方法,编码器获取当前数据流包含的待编码数据、第一上下文信息、第二上下文信息、第一边信息和第二边信息,之后根据第一上下文信息、第二上下文信息、第一边信息和第二边信息估计得到第一估计概率分布,并根据第一估计概率分布对待编码数据进行熵编码以得到第一码流,之后向解码器发送第一码流,编码器估计得到第二估计概率分布和第三估计概率分布,根据第二估计概率分布和第三估计概率分布分别对第一边信息和第二边信息进行熵编码以得到第二码流和第三码流,并向 解码器发送第二码流和第三码流,解码器获取第一上下文信息和第二上下文信息,且分别估计得到第二估计概率分布和第三估计概率分布,根据第二估计概率分布和第三估计概率分布分别对第二码流和第三码流进行熵解码以得到第一边信息和第二边信息,之后根据该第一上下文信息、第二上下文信息、第一边信息和第二边信息估计得到第一估计概率分布,再根据第一估计概率分布对第一码流进行熵解码,联合第一上下文信息、第一边信息、第二上下文信息和第二边信息估计得到第一估计概率分布,能够进一步提高得到的第一估计概率分布的准确性,减小熵编码过程中的码率,从而减小了熵编码开销以及当前数据流包括的各个数据传输至解码器时的带宽占用率,提高了当前数据流包括的各个数据的传输效率。To sum up, in the entropy encoding and decoding method provided by the embodiment of the present application, the encoder obtains the data to be encoded, the first context information, the second context information, the first side information and the second side information contained in the current data stream, and then according to The first context information, the second context information, the first side information and the second side information are estimated to obtain the first estimated probability distribution, and the data to be encoded is entropy encoded according to the first estimated probability distribution to obtain the first code stream, and then decoded The encoder sends the first code stream, the encoder estimates the second estimated probability distribution and the third estimated probability distribution, and performs entropy encoding on the first side information and the second side information according to the second estimated probability distribution and the third estimated probability distribution to obtain Obtain the second code stream and the third code stream, and send the second code stream and the third code stream to the decoder, the decoder obtains the first context information and the second context information, and estimates the second estimated probability distribution and the second estimated probability distribution respectively Three estimated probability distributions, performing entropy decoding on the second code stream and the third code stream respectively according to the second estimated probability distribution and the third estimated probability distribution to obtain the first side information and the second side information, and then according to the first context information , the second context information, the first side information and the second side information estimate to obtain the first estimated probability distribution, and then perform entropy decoding on the first code stream according to the first estimated probability distribution, and combine the first context information, the first side information, The second context information and the second side information are estimated to obtain the first estimated probability distribution, which can further improve the accuracy of the obtained first estimated probability distribution, reduce the code rate in the entropy coding process, and thus reduce the entropy coding overhead and the current The bandwidth occupancy rate when each data included in the data stream is transmitted to the decoder improves the transmission efficiency of each data included in the current data stream.
本申请实施例提供的方法的先后顺序可以进行适当调整,步骤也可以根据情况进行相应增减,例如步骤603至605、步骤606至608以及步骤609至611这三个流程可以同时执行,步骤612、步骤613至步骤614以及步骤615至616这三个流程可以同时执行。任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本申请的保护范围之内,本申请实施例对此不做限定。The order of the method provided in the embodiment of the present application can be adjusted appropriately, and the steps can also be increased or decreased according to the situation. For example, the three processes of steps 603 to 605, steps 606 to 608, and steps 609 to 611 can be executed at the same time. Step 612 , steps 613 to 614, and steps 615 to 616 can be executed simultaneously. Any person skilled in the art within the technical scope disclosed in this application can easily think of changing methods, which should be covered within the scope of protection of this application, which is not limited in the embodiments of this application.
在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。处理器可以是通用处理器、数字信号处理器(digital signal processor,DSP)、特定应用集成电路(application-specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。本申请实施例公开的方法的步骤可以直接体现为硬件编码处理器执行完成,或者用编码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。In the implementation process, each step of the above-mentioned method embodiments may be completed by an integrated logic circuit of hardware in a processor or instructions in the form of software. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other possible Program logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the methods disclosed in the embodiments of the present application may be directly implemented by a hardware coded processor, or executed by a combination of hardware and software modules in the coded processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
上述各实施例中提及的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。The memories mentioned in the above embodiments may be volatile memories or nonvolatile memories, or may include both volatile and nonvolatile memories. Among them, the non-volatile memory can be read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically programmable Erases programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, many forms of RAM are available such as static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (synchlink DRAM, SLDRAM ) and direct memory bus random access memory (direct rambus RAM, DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but not be limited to, these and any other suitable types of memory.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以 硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (personal computer, server, or network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the application, but the scope of protection of the application is not limited thereto. Anyone familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the application. Should be covered within the protection scope of this application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (32)

  1. 一种熵编码方法,其特征在于,所述方法包括:A kind of entropy encoding method, is characterized in that, described method comprises:
    获取待编码数据,所述待编码数据是当前数据流包含的多个数据中非首位编码的数据;Obtain the data to be encoded, the data to be encoded is the non-first encoded data among the multiple data contained in the current data stream;
    获取参照信息,所述参照信息至少包括第一上下文信息和第一边信息中的至少一项,所述第一上下文信息是将至少一个已编码数据输入自注意力解码网络得到的,所述第一边信息是将所述多个数据输入自注意力编码网络得到的;Obtaining reference information, the reference information including at least one of first context information and first side information, the first context information is obtained by inputting at least one encoded data into a self-attention decoding network, the first One side information is obtained by inputting the plurality of data into a self-attention encoding network;
    根据所述参照信息估计得到第一估计概率分布;estimating and obtaining a first estimated probability distribution according to the reference information;
    根据所述第一估计概率分布对所述待编码数据进行熵编码,以得到第一码流。Entropy encoding is performed on the data to be encoded according to the first estimated probability distribution to obtain a first code stream.
  2. 根据权利要求1所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息和所述第一边信息;The method according to claim 1, wherein the reference information specifically includes the first context information and the first side information;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息和所述第一边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。Inputting the first context information and the first side information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  3. 根据权利要求1所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息和第二上下文信息,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 1, wherein the reference information specifically includes the first context information and second context information, and the second context information is the at least one coded data conforming to a preset Conditional at least one data input masked convolutional network obtained;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。Inputting the first context information and the second context information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  4. 根据权利要求1所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息、所述第一边信息和第二上下文信息,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 1, wherein the reference information specifically includes the first context information, the first side information and second context information, and the second context information is the at least one Obtained by inputting at least one data that meets the preset conditions in the encoded data into the masked convolutional network;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息、所述第一边信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。Inputting the first context information, the first side information and the second context information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  5. 根据权利要求1所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的;The method according to claim 1, wherein the reference information specifically includes the first context information and second side information, and the second side information is a set of information that meets preset conditions among the plurality of data At least one data input into the hypercoding network is obtained;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。Inputting the first context information and the second side information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  6. 根据权利要求1所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息、所述第一边信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的;The method according to claim 1, wherein the reference information specifically includes the first context information, the first side information and second side information, and the second side information is a combination of the multiple Obtained by inputting at least one data that meets the preset conditions into the hypercoding network;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息、所述第一边信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。Inputting the first context information, the first side information and the second side information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  7. 根据权利要求1所述的方法,其特征在于,所述参照信息具体包括所述第一上下文 信息、第二上下文信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 1, wherein the reference information specifically includes the first context information, second context information, and second side information, and the second side information is the At least one data that meets the preset conditions is input into the super-encoding network, and the second context information is obtained by inputting at least one data that meets the preset conditions in the at least one encoded data into the masked convolutional network;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息、所述第二上下文信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。Inputting the first context information, the second context information and the second side information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  8. 根据权利要求1所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息、所述第一边信息、第二上下文信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 1, wherein the reference information specifically includes the first context information, the first side information, the second context information and the second side information, and the second side information is The second context information is obtained by inputting at least one data meeting preset conditions among the plurality of data into a super-coding network, and the second context information is obtained by inputting at least one data meeting preset conditions among the at least one coded data into masked convolution obtained from the network;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息、所述第一边信息、所述第二上下文信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。inputting the first context information, the first side information, the second context information and the second side information into a probability distribution estimation network to obtain the first estimated probability output by the probability distribution estimation network distributed.
  9. 根据权利要求1所述的方法,其特征在于,所述参照信息具体包括所述第一边信息和第二上下文信息,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 1, wherein the reference information specifically includes the first side information and second context information, and the second context information is the at least one coded data conforming to a preset Conditional at least one data input masked convolutional network obtained;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一边信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。Inputting the first side information and the second context information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  10. 根据权利要求1所述的方法,其特征在于,所述参照信息具体包括所述第一边信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的;The method according to claim 1, wherein the reference information specifically includes the first side information and the second side information, and the second side information is a set of information that meets preset conditions among the plurality of data. At least one data input into the hypercoding network is obtained;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一边信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。Inputting the first side information and the second side information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  11. 根据权利要求1所述的方法,其特征在于,所述参照信息具体包括所述第一边信息、第二上下文信息和第二边信息,所述第二边信息是将所述多个数据中符合预设条件的至少一个数据输入超编码网络得到的,所述第二上下文信息是将所述至少一个已编码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 1, wherein the reference information specifically includes the first side information, the second context information, and the second side information, and the second side information is the At least one data that meets the preset conditions is input into the super-encoding network, and the second context information is obtained by inputting at least one data that meets the preset conditions in the at least one encoded data into the masked convolutional network;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一边信息、所述第二上下文信息和所述第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。Inputting the first side information, the second context information and the second side information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  12. 根据权利要求1-2、4、6、8-11中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-2, 4, 6, 8-11, wherein the method further comprises:
    估计得到第二估计概率分布;Estimate the second estimated probability distribution;
    根据所述第二估计概率分布对所述第一边信息进行熵编码以得到第二码流。performing entropy encoding on the first side information according to the second estimated probability distribution to obtain a second code stream.
  13. 根据权利要求5-8、10-11中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 5-8, 10-11, wherein the method further comprises:
    估计得到所述第三估计概率分布;estimating said third estimated probability distribution;
    根据所述第三估计概率分布对所述第二边信息进行熵编码以得到第三码流。performing entropy encoding on the second side information according to the third estimated probability distribution to obtain a third code stream.
  14. 根据权利要求1-13中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-13, further comprising:
    获取所述多个数据中首位编码的数据;Obtaining the first coded data among the plurality of data;
    根据预先设置信息估计得到第四估计概率分布;Estimating and obtaining a fourth estimated probability distribution according to preset information;
    根据所述第四估计概率分布对所述首位编码的数据进行熵编码以得到第四码流。performing entropy encoding on the first bit encoded data according to the fourth estimated probability distribution to obtain a fourth code stream.
  15. 一种熵解码方法,其特征在于,所述方法包括:A kind of entropy decoding method, is characterized in that, described method comprises:
    获取第一码流;Obtain the first code stream;
    获取参照信息,所述参照信息至少包括第一上下文信息和经解码第一边信息中的至少一项,所述第一上下文信息是将至少一个已解码数据输入自注意力解码网络得到的,所述经解码第一边信息是对第二码流进行熵解码得到的;Obtaining reference information, the reference information including at least one of the first context information and the decoded first side information, the first context information is obtained by inputting at least one decoded data into the self-attention decoding network, so The decoded first side information is obtained by performing entropy decoding on the second code stream;
    根据所述参照信息估计得到第一估计概率分布;estimating and obtaining a first estimated probability distribution according to the reference information;
    根据所述第一估计概率分布对所述第一码流进行熵解码以得到经解码数据,所述经解码数据为当前数据流包含的多个数据中非首位解码的数据。Perform entropy decoding on the first code stream according to the first estimated probability distribution to obtain decoded data, where the decoded data is non-first decoded data among multiple data included in the current data stream.
  16. 根据权利要求15所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息和所述经解码第一边信息;The method according to claim 15, wherein the reference information specifically includes the first context information and the decoded first side information;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息和所述经解码第一边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。The first context information and the decoded first side information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  17. 根据权利要求15所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息和第二上下文信息,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 15, wherein the reference information specifically includes the first context information and second context information, and the second context information is a preset Conditional at least one data input masked convolutional network obtained;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。Inputting the first context information and the second context information into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  18. 根据权利要求15所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息、所述经解码第一边信息和第二上下文信息,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 15, wherein the reference information specifically includes the first context information, the decoded first side information and second context information, and the second context information is the Obtained by inputting at least one piece of data that meets the preset condition in the at least one piece of decoded data into the masked convolutional network;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息、所述经解码第一边信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。The first context information, the decoded first side information and the second context information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  19. 根据权利要求15所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的;The method according to claim 15, wherein the reference information specifically includes the first context information and decoded second side information, and the decoded second side information is entropy decoding of the third code stream owned;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息和所述经解码第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。The first context information and the decoded second side information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  20. 根据权利要求15所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息、所述经解码第一边信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的;The method according to claim 15, wherein the reference information specifically includes the first context information, the decoded first side information and the decoded second side information, and the decoded second side information is obtained by performing entropy decoding on the third code stream;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息、所述经解码第一边信息和所述经解码第二边信息输入概率分 布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。The first context information, the decoded first side information and the decoded second side information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  21. 根据权利要求15所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息、第二上下文信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 15, wherein the reference information specifically includes the first context information, the second context information, and the decoded second side information, and the decoded second side information is for the third The code stream is obtained by performing entropy decoding, and the second context information is obtained by inputting at least one data that meets a preset condition in the at least one decoded data into a masked convolutional network;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息、所述第二上下文信息和所述经解码第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。The first context information, the second context information and the decoded second side information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  22. 根据权利要求15所述的方法,其特征在于,所述参照信息具体包括所述第一上下文信息、所述经解码第一边信息、第二上下文信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 15, wherein the reference information specifically includes the first context information, the decoded first side information, the second context information and the decoded second side information, and the decoded Decoding the second side information is obtained by performing entropy decoding on the third code stream, and the second context information is obtained by inputting at least one data that meets a preset condition in the at least one decoded data into a masked convolutional network;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述第一上下文信息、所述经解码第一边信息、所述第二上下文信息和所述经解码第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。inputting the first context information, the decoded first side information, the second context information and the decoded second side information into a probability distribution estimation network to obtain the output of the probability distribution estimation network The first estimated probability distribution.
  23. 根据权利要求15所述的方法,其特征在于,所述参照信息具体包括所述经解码第一边信息和第二上下文信息,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 15, wherein the reference information specifically includes the decoded first side information and second context information, and the second context information is a combination of the at least one decoded data conforming to At least one data of the preset condition is input into the masked convolutional network to obtain;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述经解码第一边信息和所述第二上下文信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。The decoded first side information and the second context information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  24. 根据权利要求15所述的方法,其特征在于,所述参照信息具体包括所述经解码第一边信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的;The method according to claim 15, wherein the reference information specifically includes the decoded first side information and the decoded second side information, and the decoded second side information is the third code stream obtained by entropy decoding;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述经解码第一边信息和所述经解码第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。The decoded first side information and the decoded second side information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  25. 根据权利要求15所述的方法,其特征在于,所述参照信息具体包括所述经解码第一边信息、第二上下文信息和经解码第二边信息,所述经解码第二边信息是对第三码流进行熵解码得到的,所述第二上下文信息是将所述至少一个已解码数据中符合预设条件的至少一个数据输入遮掩卷积网络得到的;The method according to claim 15, wherein the reference information specifically includes the decoded first side information, the second context information, and the decoded second side information, and the decoded second side information is a reference to The third code stream is obtained by performing entropy decoding, and the second context information is obtained by inputting at least one data that meets a preset condition in the at least one decoded data into a masked convolutional network;
    所述根据所述参照信息估计得到第一估计概率分布,包括:The estimating and obtaining the first estimated probability distribution according to the reference information includes:
    将所述经解码第一边信息、所述第二上下文信息和所述经解码第二边信息输入概率分布估计网络,以得到所述概率分布估计网络输出的所述第一估计概率分布。The decoded first side information, the second context information and the decoded second side information are input into a probability distribution estimation network to obtain the first estimated probability distribution output by the probability distribution estimation network.
  26. 根据权利要求15-16、18、20、22-25中任一项所述的方法,其特征在于,当所述参照信息包括所述经解码第一边信息时,所述获取参照信息,包括:The method according to any one of claims 15-16, 18, 20, 22-25, wherein when the reference information includes the decoded first side information, the acquiring reference information includes :
    获取所述第二码流;Obtain the second code stream;
    估计得到第二估计概率分布;Estimate the second estimated probability distribution;
    根据所述第二估计概率分布对所述第二码流进行熵解码以得到所述经解码第一边信 息。Entropy decoding the second codestream according to the second estimated probability distribution to obtain the decoded first side information.
  27. 根据权利要求19-22、24-25中任一项所述的方法,其特征在于,当所述参照信息包括所述经解码第二边信息时,所述获取参照信息,还包括:The method according to any one of claims 19-22, 24-25, wherein when the reference information includes the decoded second side information, the obtaining the reference information further includes:
    获取所述第三码流;Obtain the third code stream;
    估计得到第三估计概率分布;Estimate a third estimated probability distribution;
    根据所述第三估计概率分布对所述第三码流进行熵解码以得到所述经解码第二边信息。Entropy decoding the third code stream according to the third estimated probability distribution to obtain the decoded second side information.
  28. 根据权利要求15-27中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 15-27, further comprising:
    获取第四码流;Obtain the fourth code stream;
    根据预先设置信息估计得到第四估计概率分布;Estimating and obtaining a fourth estimated probability distribution according to preset information;
    根据所述第四估计概率分布对所述第四码流进行熵解码以得到经解码首位数据,所述经解码首位数据是所述多个数据中首位解码的数据。Entropy decoding is performed on the fourth code stream according to the fourth estimated probability distribution to obtain decoded leading data, where the decoded leading data is first decoded data among the plurality of data.
  29. 一种熵编码设备,其特征在于,包括:An entropy encoding device, characterized in that it comprises:
    一个或多个处理器;one or more processors;
    存储器,用于存储一个或多个程序;memory for storing one or more programs;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-14中任一项所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the method according to any one of claims 1-14.
  30. 一种熵解码设备,其特征在于,包括:An entropy decoding device, characterized in that it comprises:
    一个或多个处理器;one or more processors;
    存储器,用于存储一个或多个程序;memory for storing one or more programs;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求15-28中任一项所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the method according to any one of claims 15-28.
  31. 一种计算机可读存储介质,其特征在于,包括计算机程序,所述计算机程序在计算机上被执行时,使得所述计算机执行权利要求1-28中任一项所述的方法。A computer-readable storage medium, characterized by comprising a computer program, when the computer program is executed on a computer, it causes the computer to execute the method according to any one of claims 1-28.
  32. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序代码,当所述计算机程序代码在计算机上运行时,使得计算机执行权利要求1-28中任一项所述的方法。A computer program product, characterized in that the computer program product includes computer program code, and when the computer program code is run on a computer, the computer is made to execute the method according to any one of claims 1-28.
PCT/CN2022/110827 2021-08-17 2022-08-08 Entropy encoding and decoding method and device WO2023020320A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110944357.5A CN115706798A (en) 2021-08-17 2021-08-17 Entropy encoding and decoding method and device
CN202110944357.5 2021-08-17

Publications (1)

Publication Number Publication Date
WO2023020320A1 true WO2023020320A1 (en) 2023-02-23

Family

ID=85181332

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/110827 WO2023020320A1 (en) 2021-08-17 2022-08-08 Entropy encoding and decoding method and device

Country Status (2)

Country Link
CN (1) CN115706798A (en)
WO (1) WO2023020320A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116128737B (en) * 2023-04-19 2023-06-27 南京大学 Image super-resolution network robustness improving device based on data compression

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111641826A (en) * 2019-03-01 2020-09-08 杭州海康威视数字技术股份有限公司 Method, device and system for encoding and decoding data
CN111818346A (en) * 2019-04-11 2020-10-23 富士通株式会社 Image encoding method and apparatus, image decoding method and apparatus
CN111868753A (en) * 2018-07-20 2020-10-30 谷歌有限责任公司 Data compression using conditional entropy models
GB202016824D0 (en) * 2020-10-23 2020-12-09 Deep Render Ltd DR big book 3
US20210099710A1 (en) * 2018-04-01 2021-04-01 Lg Electronics Inc. Method for image coding using convolution neural network and apparatus thereof
CN112771541A (en) * 2018-09-27 2021-05-07 谷歌有限责任公司 Data compression using integer neural networks

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210099710A1 (en) * 2018-04-01 2021-04-01 Lg Electronics Inc. Method for image coding using convolution neural network and apparatus thereof
CN111868753A (en) * 2018-07-20 2020-10-30 谷歌有限责任公司 Data compression using conditional entropy models
CN112771541A (en) * 2018-09-27 2021-05-07 谷歌有限责任公司 Data compression using integer neural networks
CN111641826A (en) * 2019-03-01 2020-09-08 杭州海康威视数字技术股份有限公司 Method, device and system for encoding and decoding data
CN111818346A (en) * 2019-04-11 2020-10-23 富士通株式会社 Image encoding method and apparatus, image decoding method and apparatus
GB202016824D0 (en) * 2020-10-23 2020-12-09 Deep Render Ltd DR big book 3

Also Published As

Publication number Publication date
CN115706798A (en) 2023-02-17

Similar Documents

Publication Publication Date Title
WO2020253858A1 (en) An encoder, a decoder and corresponding methods
WO2022068716A1 (en) Entropy encoding/decoding method and device
WO2020211765A1 (en) An encoder, a decoder and corresponding methods harmonzting matrix-based intra prediction and secoundary transform core selection
WO2020181997A1 (en) An encoder, a decoder and corresponding methods for inter prediction
WO2022063265A1 (en) Inter-frame prediction method and apparatus
EP3928517A1 (en) Method and apparatus for intra prediction using linear model
WO2020228560A1 (en) Method and device for obtaining a list of candidate motion vectors, and codec
CN114125446A (en) Image encoding method, decoding method and device
WO2022111233A1 (en) Intra prediction mode coding method, and apparatus
WO2023020320A1 (en) Entropy encoding and decoding method and device
US20230388490A1 (en) Encoding method, decoding method, and device
WO2020253681A1 (en) Method and device for constructing merge candidate motion information list, and codec
TWI748522B (en) Video encoder, video decoder, and related methods
WO2023011420A1 (en) Encoding method and apparatus, and decoding method and apparatus
WO2020216294A1 (en) Image prediction method and apparatus, and computer-readable storage medium
US20230239500A1 (en) Intra Prediction Method and Apparatus
CN116137659A (en) Inter-coded block partitioning method and apparatus
WO2020259353A1 (en) Entropy coding/decoding method for syntactic element, device, and codec
WO2020224476A1 (en) Image division method, apparatus and device
WO2024012249A1 (en) Method and apparatus for coding image including text, and method and apparatus for decoding image including text
WO2021043138A1 (en) An encoder, a decoder and corresponding methods of filter modification on general intra prediction process
WO2020125761A1 (en) Image block division method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22857632

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE