WO2023011420A1 - 编解码方法和装置 - Google Patents

编解码方法和装置 Download PDF

Info

Publication number
WO2023011420A1
WO2023011420A1 PCT/CN2022/109485 CN2022109485W WO2023011420A1 WO 2023011420 A1 WO2023011420 A1 WO 2023011420A1 CN 2022109485 W CN2022109485 W CN 2022109485W WO 2023011420 A1 WO2023011420 A1 WO 2023011420A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
rounded value
decoded
code stream
decoding
Prior art date
Application number
PCT/CN2022/109485
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to BR112024002242A priority Critical patent/BR112024002242A2/pt
Priority to EP22852132.4A priority patent/EP4373081A1/en
Priority to KR1020247006856A priority patent/KR20240039178A/ko
Publication of WO2023011420A1 publication Critical patent/WO2023011420A1/zh

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/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • G06N3/0455Auto-encoder networks; Encoder-decoder networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • 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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/184Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being bits, e.g. of the compressed video stream
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/463Embedding additional information in the video signal during the compression process by compressing encoding parameters before transmission
    • 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 present application relates to the technical field of artificial intelligence, and in particular to encoding and decoding methods and devices.
  • Compressing images based on neural networks can improve the efficiency of image compression.
  • Existing image compression methods based on neural networks are mainly divided into neural network image compression methods that require online training (referred to as method 1) and neural network image compression methods that do not require online training. (Method 2 for short), the rate-distortion performance of the first method is better, but the image compression speed is slow due to the need for online training, and the rate-distortion performance of the second method is poor but the image compression speed is fast.
  • the present application provides a codec method and device, which can improve the rate-distortion performance of the data codec method without online training.
  • the application adopts the following technical solutions:
  • the present application discloses an encoding method, the method comprising: first obtaining data to be encoded, then inputting the data to be encoded into a first encoding network to obtain target parameters; and then constructing a second encoding network according to the target parameters ; Next, input the data to be encoded into the second encoding network to obtain first features; finally encode the first features to obtain an encoded code stream.
  • the encoding network (ie, the second encoding network) uses fixed parameter weights to extract the content features (ie, the first feature) of the data to be encoded, and then encodes the content features into a code stream (ie, the encoded code stream) and sends it to the decoder.
  • the decoding end decodes and reconstructs the code stream to obtain decoded data. It can be seen that the parameter weights of the encoding network in the prior art are not related to the data to be encoded.
  • the data to be encoded is first input into the first encoding network, and then the first encoding network generates the parameter weights of the second encoding network according to the data to be encoded, and then dynamically adjusts the second encoding network according to the obtained weights
  • the parameter weight of the second encoding network is related to the parameter weight of the second encoding network, which increases the expressive ability of the second encoding network, so that the decoding end obtains the decoded data reconstructed by the code stream decoding and the data to be encoded through the first feature encoding closer, thereby improving the rate-distortion performance of the codec network.
  • the target parameter is a parameter weight of all convolutions or partial convolutions and nonlinear activations of the second encoding network.
  • the encoding the first feature to obtain an encoded code stream includes: rounding the first feature to obtain an integer value of the first feature; Probability estimation is performed on the rounded value of a feature to obtain an estimated probability distribution of the rounded value of the first feature; according to the estimated probability distribution of the rounded value of the first feature, entropy coding to obtain the coded code stream.
  • the rounded value of the first feature is entropy encoded to form a code stream, which can reduce the coding redundancy of outputting the first feature, and further reduce the data encoding and decoding (compression) process. data transfer volume.
  • the performing probability estimation on the rounded value of the first feature to obtain the estimated probability distribution of the rounded value of the first feature includes: Probability estimation is performed on the rounded value of a feature to obtain an estimated probability distribution of the rounded value of the first feature, and the first information includes at least one item of context information and side information.
  • Estimating the probability distribution through the context information and side information can improve the accuracy of the estimated probability distribution, thereby reducing the code rate in the entropy coding process and reducing the entropy coding overhead.
  • the present application provides a decoding method, the method comprising: first obtaining a code stream to be decoded; then decoding the code stream to be decoded to obtain the rounded value of the first feature and the rounded value of the second feature ; then input the rounded value of the second feature into the first decoding network to obtain the target parameter; then construct the second decoding network according to the target parameter; finally input the rounded value of the first feature into the The second decoding network to obtain decoded data.
  • the rounded value of the first feature is used to obtain decoded data
  • the rounded value of the second feature is used to obtain a target parameter.
  • the decoding network ie, the second decoding network
  • the content features and model features (i.e., the first feature and the second feature) of the data to be decoded are compiled into a code stream to be decoded, and then the decoding end obtains the rounded value of the second feature by decoding the code stream to be decoded, through Input the rounded value of the second feature into the first decoding network to obtain the parameter weight of the second decoding network, and then dynamically adjust the parameter weight of the second decoding network according to the parameter weight, so that the parameter weight of the second decoding network is consistent with the data to be decoded
  • Correlation improves the expressive ability of the second decoding network, and makes the decoded data obtained by decoding and reconstruction of the second decoding network closer to the data to be encoded, thereby improving the rate-distortion performance of the encoding and decoding network.
  • the target parameter is a parameter weight of all convolutions or partial convolutions and nonlinear activations of the second decoding network.
  • the code stream to be decoded may include a first code stream to be decoded and a second code stream to be decoded.
  • the decoding the code stream to be decoded to obtain the rounded value of the first feature and the rounded value of the second feature includes: performing Decoding to obtain an integer value of the first feature; decoding the second code stream to be decoded to obtain an integer value of the second feature.
  • the decoding the first code stream to be decoded to obtain the integer value of the first feature includes: decoding the first feature in the first code stream to be decoded Perform probability estimation on the rounded value of the first feature to obtain an estimated probability distribution of the rounded value of the first feature; perform entropy decoding on the first code stream to be decoded according to the estimated probability distribution of the rounded value of the first feature to obtain A rounded value of the first feature is obtained.
  • performing probability estimation on the rounded value of the first feature in the first code stream to be decoded to obtain an estimated probability distribution of the rounded value of the first feature includes: Probability estimation is performed on the rounded value of the first feature in the first code stream to be decoded according to the first information to obtain an estimated probability distribution of the rounded value of the first feature, where the first information includes context information and At least one item of side information.
  • the decoding the second code stream to be decoded to obtain the rounded value of the second feature includes: decoding the second feature in the second code stream to be decoded Perform probability estimation on the rounded value of the second feature to obtain an estimated probability distribution of the rounded value of the second feature; perform entropy decoding on the second code stream to be decoded according to the estimated probability distribution of the rounded value of the second feature to obtain A rounded value of the second feature is obtained.
  • performing probability estimation on the rounded value of the second feature in the second code stream to be decoded to obtain an estimated probability distribution of the rounded value of the second feature includes: performing probability estimation on the rounded value of the second feature in the second code stream to be decoded according to the first information to obtain an estimated probability distribution of the rounded value of the second feature, where the first information includes context information and At least one item of side information.
  • the present application provides a decoding method, which includes: firstly obtaining a code stream to be decoded; then decoding the code stream to be decoded to obtain the rounded value of the first feature; and then converting the code stream to The rounded value of a feature is input into the third decoding network to obtain the target parameter; then the second decoding network is constructed according to the target parameter; finally, the rounded value of the first feature is input into the second decoding network to obtain the decoded data.
  • the first feature is used to obtain decoded data and target parameters.
  • the decoding network ie, the second decoding network
  • the rounded value of the first feature is obtained by decoding the code stream to be decoded encoded by the feature of the data to be decoded (ie, the first feature), and the rounded value of the first feature is input into the first decoding network to obtain the first The parameter weight of the second decoding network, and then dynamically adjust the parameter weight of the second decoding network according to the parameter weight, so that the parameter weight of the second decoding network is related to the data to be decoded, which improves the expressive ability of the second decoding network, and makes the second decoding network
  • the decoded data obtained by network decoding reconstruction is closer to the data to be encoded, thereby improving the rate-distortion performance of the encoding and decoding network.
  • the target parameter is a parameter weight of all convolutions or partial convolutions and nonlinear activations of the second decoding network.
  • the decoding the code stream to be decoded to obtain the rounded value of the first feature includes: the rounded value of the first feature in the code stream to be decoded performing probability estimation to obtain an estimated probability distribution of the rounded value of the first feature; performing entropy decoding on the code stream to be decoded according to the estimated probability distribution of the rounded value of the first feature to obtain the first feature The rounded value of .
  • the probability estimation of the rounded value of the first feature in the code stream to be decoded to obtain the estimated probability distribution of the rounded value of the first feature includes: according to A piece of information that performs probability estimation on the rounded value of the first feature in the code stream to be decoded to obtain an estimated probability distribution of the rounded value of the first feature, where the first information includes context information and side information at least one.
  • the present application provides an encoding device, which includes a processing circuit, and the processing circuit is used to: acquire data to be encoded; input the data to be encoded into a first encoding network to obtain target parameters; according to the The target parameters construct a second encoding network; input the data to be encoded into the second encoding network to obtain a first feature; encode the first feature to obtain an encoded code stream.
  • the target parameter is a parameter weight of all convolutions or partial convolutions and nonlinear activations of the second encoding network.
  • the processing circuit is specifically configured to: perform rounding on the first feature to obtain a rounded value of the first feature; perform probability estimation on the rounded value of the first feature to obtain Obtain an estimated probability distribution of the rounded value of the first feature; perform entropy encoding on the rounded value of the first feature according to the estimated probability distribution of the rounded value of the first feature to obtain the coded code stream.
  • the processing circuit is specifically configured to: perform probability estimation on the rounded value of the first feature according to the first information to obtain an estimated probability distribution of the rounded value of the first feature,
  • the first information includes at least one of context information and side information.
  • the present application provides a decoding device, the decoding device includes a processing circuit, and the processing circuit is used to: obtain the code stream to be decoded; decode the code stream to be decoded to obtain the rounded value of the first feature and the rounded value of the second feature, the rounded value of the first feature is used to obtain the decoded data, the rounded value of the second feature is used to obtain the target parameter; the rounded value of the second feature is input A first decoding network to obtain the target parameters; constructing a second decoding network according to the target parameters; inputting the integer value of the first feature into the second decoding network to obtain decoded data.
  • the target parameter is a parameter weight of all convolutions or partial convolutions and nonlinear activations of the second decoding network.
  • the code stream to be decoded includes a first code stream to be decoded and a second code stream to be decoded.
  • the processing circuit is specifically configured to: decode the first code stream to be decoded to obtain an integer value of the first feature; Decode to obtain the rounded value of the second feature.
  • the processing circuit is specifically configured to: perform probability estimation on the rounded value of the first feature in the first code stream to be decoded to obtain the rounded value of the first feature Estimating a probability distribution: performing entropy decoding on the first code stream to be decoded according to the estimated probability distribution of the rounded value of the first feature to obtain the rounded value of the first feature.
  • the processing circuit is specifically configured to: perform probability estimation on the rounded value of the first feature in the first code stream to be decoded according to the first information to obtain the value of the first feature
  • An estimated probability distribution of rounded values, the first information includes at least one item of context information and side information.
  • the processing circuit is specifically configured to: perform probability estimation on the rounded value of the second feature in the second code stream to be decoded to obtain the rounded value of the second feature Estimating a probability distribution; performing entropy decoding on the second code stream to be decoded according to the estimated probability distribution of the rounded value of the second feature to obtain the rounded value of the second feature.
  • the processing circuit is specifically configured to: perform probability estimation on the rounded value of the second feature in the second to-be-decoded code stream according to the first information to obtain the value of the second feature
  • An estimated probability distribution of rounded values, the first information includes at least one item of context information and side information.
  • the present application provides a decoding device, which includes a processing circuit, and the processing circuit is configured to: obtain a code stream to be decoded; decode the code stream to be decoded to obtain a rounded value of the first feature , the rounded value of the first feature is used to obtain decoded data and target parameters; the rounded value of the first feature is input into the first decoding network to obtain the target parameters; the second decoding network is constructed according to the target parameters; Inputting the integer value of the first feature to the second decoding network to obtain decoded data.
  • the target parameter is a parameter weight of all convolutions or partial convolutions and nonlinear activations of the second decoding network.
  • the processing circuit is specifically configured to: perform probability estimation on the rounded value of the first feature in the code stream to be decoded to obtain an estimated probability of the rounded value of the first feature distribution: performing entropy decoding on the code stream to be decoded according to the estimated probability distribution of the rounded value of the first feature to obtain the rounded value of the first feature.
  • the processing circuit is specifically configured to: perform probability estimation on the rounded value of the first feature in the code stream to be decoded according to the first information to obtain the rounded value of the first feature An estimated probability distribution of values, the first information including at least one of context information and side information.
  • the embodiment of the present application further provides an encoder, the encoder includes: at least one processor, and when the at least one processor executes program codes or instructions, the above first aspect or any possible implementation thereof can be realized method described in the method.
  • the encoder may also include at least one memory for storing the program code or instructions.
  • the embodiment of the present application further provides a decoder, the decoder includes: at least one processor, and when the at least one processor executes program codes or instructions, the above-mentioned second aspect or any possible implementation thereof can be realized method described in the method.
  • the decoder may further include at least one memory, and the at least one memory is used to store the program code or instruction.
  • the embodiment of the present application further provides a chip, including: an input interface, an output interface, and at least one processor.
  • the chip also includes a memory.
  • the at least one processor is used to execute the code in the memory, and when the at least one processor executes the code, the chip implements the method described in the above first aspect or any possible implementation thereof.
  • the aforementioned chip may also be an integrated circuit.
  • the embodiment of the present application further provides a terminal, where the terminal includes the foregoing encoding device, decoding device, encoder, decoder, or the foregoing chip.
  • the present application further provides a computer-readable storage medium for storing a computer program, and the computer program includes a method for implementing the above-mentioned first aspect or any possible implementation thereof.
  • the embodiment of the present application further provides a computer program product containing instructions, which when run on a computer, enables the computer to implement the method described in the above first aspect or any possible implementation thereof.
  • the encoding device, decoding device, encoder, decoder, computer storage medium, computer program product and chip provided in this embodiment are all used to execute the method provided above, therefore, the beneficial effects it can achieve can refer to the above The beneficial effects of the provided method will not be repeated here.
  • Figure 1a is an exemplary block diagram of a decoding system provided by an embodiment of the present application.
  • FIG. 1b is an exemplary block diagram of a video decoding system provided by 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 an exemplary block diagram of a video decoding device provided in an embodiment of the present application.
  • FIG. 6 is an exemplary block diagram of a device provided by an embodiment of the present application.
  • Fig. 7a is a schematic diagram of an application scenario provided by the embodiment of the present application.
  • Fig. 7b is a schematic diagram of an application scenario provided by the embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a codec method provided in an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a codec system provided by an embodiment of the present application.
  • FIG. 10 is a schematic flowchart of another encoding and decoding method provided in the embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of another encoding and decoding system provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of another codec system provided by the embodiment of the present application.
  • FIG. 13 is a schematic flowchart of another encoding and decoding method provided in the embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of another codec system provided by the embodiment of the present application.
  • FIG. 15 is a schematic diagram of the performance of the codec method provided by the embodiment of the present application.
  • FIG. 16 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 17 is a schematic diagram of another application scenario provided by the embodiment of the present application.
  • FIG. 18 is a schematic structural diagram of a codec device provided by an embodiment of the present application.
  • FIG. 19 is a schematic structural diagram of another codec device provided by the embodiment of the present application.
  • FIG. 20 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • first and second in the specification and drawings of the present application are used to distinguish different objects, or to distinguish different processes for the same object, rather than to describe a specific sequence of objects.
  • 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 a codec technology to improve the traditional mixed data codec 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 of the present application 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 a to 3 .
  • FIG. 1a 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 pointing from the source device 12 to the corresponding communication channel 13 of the destination device 14 in FIG. 1 a, 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), Entropy coding is performed on the image block to be coded by using the estimated probability distribution obtained according to the estimation.
  • the training engine 25 please refer to the following method embodiment.
  • FIG. 1a shows the source device 12 and the destination device 14 as independent devices
  • device embodiments 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 both the source device 12 and the destination device 14.
  • 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. 1b is an exemplary block diagram of a video decoding system 40 provided by an embodiment of the present application, an encoder 20 (such as a video encoder 20) or a decoder 30 (such as a video decoder 30) or both All can be realized by processing circuits in the video decoding system 40 shown in FIG. 1b, such as one or more microprocessors, digital signal processors (digital signal processor, DSP), application-specific integrated circuits , ASIC), field-programmable gate array (field-programmable gate array, FPGA), discrete logic, hardware, video encoding dedicated processor, or any combination thereof.
  • DSP digital signal processor
  • ASIC application-specific integrated circuits
  • FPGA field-programmable gate array
  • 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 the instructions of the software in a suitable non-transitory computer-readable storage medium, and use one or more processors to execute the instructions in hardware, thereby Implement the technology of this application.
  • One of the video encoder 20 and the video decoder 30 may be integrated in a single device as part of a combined codec (encoder/decoder, CODEC), as shown in FIG. 1b.
  • 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. 1a is merely exemplary, and the techniques provided herein may be applicable to video coding settings (e.g., video encoding or video decoding) that do not necessarily include encoding 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.
  • FIG. 1b is an exemplary block diagram of a video decoding system 40 provided by an embodiment of the present application.
  • the video decoding system 40 may include an imaging device 41, a video encoder 20, a video decoding 30 (and/or a video codec implemented by processing circuitry 46 ), an antenna 42 , one or more processors 43 , one or more memory stores 44 and/or a display device 45 .
  • imaging device 41, antenna 42, processing circuit 46, video encoder 20, video decoder 30, processor 43, memory storage 44 and/or display device 45 are capable of communicating with each other.
  • the video coding system 40 may include only the video encoder 20 or only the video decoder 30 .
  • antenna 42 may be used to transmit or receive an encoded bitstream of video data.
  • display device 45 may be used to present video data.
  • the processing circuit 46 may include application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, and the like.
  • the video decoding system 40 may also include an optional processor 43, and the optional processor 43 may similarly include application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, and the like.
  • the memory storage 44 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 non-volatile memory volatile 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.
  • non-volatile memory volatile memory for example, flash memory, etc.
  • memory storage 44 may be implemented by cache memory.
  • processing circuitry 46 may include memory (eg, cache, etc.) for implementing an image buffer or the like.
  • video encoder 20 implemented by logic circuitry may include an image buffer (eg, implemented by processing circuitry 46 or memory storage 44 ) and a graphics processing unit (eg, implemented by processing circuitry 46 ).
  • a graphics processing unit may be communicatively coupled to the image buffer.
  • Graphics processing unit may include video encoder 20 implemented by processing circuitry 46 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 46 in a similar manner to implement the various aspects discussed with reference to video decoder 30 of FIG. 3 and/or any other decoder system or subsystem described herein. module.
  • logic circuit implemented video decoder 30 may include an image buffer (implemented by processing circuit 46 or memory storage 44 ) and a graphics processing unit (eg, implemented by processing circuit 46 ).
  • a graphics processing unit may be communicatively coupled to the image buffer.
  • Graphics processing unit may include video decoder 30 implemented by processing circuitry 46 to implement the various modules discussed with reference to FIG. 3 and/or any other decoder system or subsystem described herein.
  • antenna 42 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).
  • Video coding system 40 may also include video decoder 30 coupled to antenna 42 and used to decode the encoded bitstream.
  • a display device 45 is used to present 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 for partition coding
  • the segmentation structure of the tree unit In the coding tree structure in the coding 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.
  • several traditional angle intra prediction modes are adaptively replaced with wide angle intra prediction modes for non-square blocks defined in VVC.
  • to avoid the division operation of DC prediction only the longer side is used to calculate the average value of non-square blocks.
  • the intra prediction result of the planar mode can also be modified by using a position dependent intra prediction combination (PDPC) method.
  • 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 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.
  • the encoded bitstream 21 may be transmitted to the video decoder 30, or stored in memory for later transmission or retrieval by the 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 inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the loop filter 220, the decoded picture buffer DPB 230, the inter prediction unit 344 and the intra prediction unit 354 also constitute a video encoder 20's "built-in decoder".
  • the inverse quantization unit 310 may be functionally the same as the inverse quantization unit 110
  • the inverse transform processing unit 312 may be functionally the same as the inverse transform processing unit 122
  • the reconstruction unit 314 may 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 , and to provide 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 dequantized coefficients 311 , also referred to as transform coefficients 311 , and apply a transform to the dequantized 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.
  • FIG. 5 is an exemplary block diagram of a video decoding device 500 provided in an embodiment of the present application.
  • the video coding apparatus 500 is suitable for implementing the disclosed embodiments described herein.
  • the video decoding device 500 may be a decoder, such as the video decoder 30 in FIG. 1a, or an encoder, such as the video encoder 20 in FIG. 1a.
  • the video decoding device 500 includes: an input port 510 (or input port 510) for receiving data and a receiving unit (receiver unit, Rx) 520; a processor, a logic unit or a central processing unit (central processing unit) for processing data , CPU) 530;
  • the processor 530 here can be a neural network processor 530; a sending unit (transmitter unit, Tx) 540 and an output port 550 (or output port 550) for transmitting data; memory 560.
  • the video decoding device 500 may also include an optical-to-electrical (OE) component and an electrical-to-optical (EO) component coupled to the input port 510, the receiving unit 520, the transmitting unit 540 and the output port 550, For the exit or entrance of optical or electrical signals.
  • OE optical-to-electrical
  • EO electrical-to-optical
  • the processor 530 is realized by hardware and software.
  • Processor 530 may be implemented as one or more processor chips, cores (eg, multi-core processors), FPGAs, ASICs, and DSPs.
  • Processor 530 is in communication with ingress port 510 , receiving unit 520 , transmitting unit 540 , egress port 550 and memory 560 .
  • Processor 530 includes a decoding module 570 (eg, a neural network based decoding module 570).
  • the decoding module 570 implements the embodiments disclosed above. For example, the decode module 570 performs, processes, prepares, or provides for various encoding operations.
  • the decoding module 570 is implemented as instructions stored in the memory 560 and executed by the processor 530 .
  • Memory 560 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 execution of the programs.
  • Memory 560 may be volatile and/or nonvolatile, and may be a read-only memory (ROM), random access memory (random access memory, RAM), ternary content-addressable memory (ternary content-addressable memory (TCAM) and/or static random-access memory (static random-access memory, SRAM).
  • ROM read-only memory
  • RAM random access memory
  • TCAM ternary content-addressable memory
  • SRAM static random-access memory
  • FIG. 6 is an exemplary block diagram of an apparatus 600 provided in an embodiment of the present application.
  • the apparatus 600 may be used as either or both of the source device 12 and the destination device 14 in FIG. 1 a .
  • Processor 602 in apparatus 600 may be a central processing unit.
  • processor 602 may be any other type of device or devices, existing or to be developed in the future, capable of manipulating or processing information. While the disclosed implementations can be implemented using a single processor, such as processor 602 as shown, it is faster and more efficient to use more than one processor.
  • memory 604 in apparatus 600 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 604 .
  • Memory 604 may include code and data 606 accessed by processor 602 via bus 612 .
  • Memory 604 may also include an operating system 608 and application programs 610, including at least one program that allows processor 602 to perform the methods described herein.
  • application programs 610 may include applications 1 through N, and also include a video coding application that performs the methods described herein.
  • Apparatus 600 may also include one or more output devices, such as display 618 .
  • display 618 may be a touch-sensitive display that combines the display with touch-sensitive elements that may be used to sense touch input.
  • Display 618 may be coupled to processor 602 via bus 612 .
  • bus 612 in device 600 is described herein as a single bus, bus 612 may include multiple buses. Additionally, secondary storage may be directly coupled to other components of device 600 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, apparatus 600 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 multi-layer 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 values 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. 7a is a schematic diagram of an application scenario provided by the embodiment of the present application.
  • the application scenario is that the device acquires data, compresses the acquired data, and then stores the compressed data.
  • the device may integrate the functions of the aforementioned source device and destination device.
  • the device acquires data.
  • the device compresses the data to obtain the compressed data.
  • the device stores compressed data.
  • the device compresses the data to save storage space.
  • the device can store the compressed data in an album or cloud album.
  • the device decompresses the compressed data to obtain the data.
  • Figure 7b is a schematic diagram of an application scenario provided by the embodiment of the present application.
  • the application scenario is that the source device obtains data, compresses the obtained data to obtain compressed data, and then sends the compressed data to the destination device.
  • the source device may perform compression processing on the obtained data and then transmit it to the destination device, which can reduce the transmission bandwidth.
  • the source device acquires data.
  • the source device compresses the data to obtain compressed data.
  • the source device sends compressed data to the destination device.
  • the source device compresses the data before transmission, which can reduce the transmission bandwidth and improve the transmission efficiency.
  • the destination device decompresses the compressed data to obtain data.
  • FIG. 8 is a flowchart of an encoding and decoding method 800 provided in an embodiment of the present application.
  • the codec method 800 may be performed by an encoder and a decoder.
  • the codec method 800 is described as a series of steps or operations. It should be understood that the codec method 800 may be executed in various orders and/or concurrently, and is not limited to the execution order shown in FIG. 8 .
  • the codec method 800 may include:
  • Step 801 the encoder acquires data to be encoded.
  • the encoder obtains data x to be encoded.
  • Step 802 the encoder inputs the data to be encoded into the first encoding network to obtain target parameters.
  • the target parameter may be the parameter weight of all or part of the convolution and nonlinear activation of the second encoding network.
  • the first encoding network may include a convolution kernel generator (convolution or fully connected group), and the convolution kernel generator is used to generate target parameters according to the data to be encoded.
  • a convolution kernel generator convolution or fully connected group
  • the encoder inputs the data x to be encoded into the first encoding network to obtain the target parameter ⁇ g .
  • Step 803 the encoder constructs a second encoding network according to the target parameters.
  • the encoder constructs the second encoding network g a (x; ⁇ g ) according to the target parameter ⁇ g .
  • Step 804 the encoder inputs the data to be encoded into the second encoding network to obtain the first feature.
  • the first feature is used to reconstruct the data to be encoded, and the first feature may also be called a content feature.
  • the first feature may be a three-dimensional feature map of the data x to be encoded.
  • the encoder inputs the data x to be encoded into the second encoding network g a (x; ⁇ g ) to obtain the first feature y.
  • Step 805 the encoder encodes the first feature to obtain an encoded code stream (that is, a code stream to be decoded).
  • the encoder encodes the first feature to obtain an encoded code stream, which may include: the encoder first rounds the first feature to obtain the rounded value of the first feature; then the encoder rounds the first feature Probability estimation is performed on the rounded value of a feature to obtain an estimated probability distribution of the rounded value of the first feature; then the encoder performs entropy encoding on the rounded value of the first feature according to the estimated probability distribution of the rounded value of the first feature to obtain Get the encoded code stream.
  • the rounded value of the first feature may be referred to as a first value feature or a content rounded feature.
  • the encoder first rounds the first feature y to obtain the rounded value of the first feature Then the encoder rounds the integer value of the first feature Probability estimation to get an estimated probability distribution for the rounded values of the first feature Then the encoder estimates the probability distribution according to the rounded value of the first feature rounded value for the first feature Entropy encoding is performed to obtain an encoded code stream.
  • the encoder performs probability estimation on the rounded value of the first feature to obtain an estimated probability distribution of the rounded value of the first feature, which may include: the encoder performs probability estimation on the rounded value of the first feature according to the first information Estimate to obtain an estimated probability distribution of rounded values of the first feature.
  • the first information includes at least one item of context information and side information.
  • estimating the probability distribution through context information and side information can improve the accuracy of the estimated probability distribution, thereby reducing the code rate in the entropy coding process and reducing the entropy coding overhead.
  • Step 806 the encoder sends the coded code stream to the decoder.
  • Step 807 the decoder decodes the encoded code stream to obtain the integer value of the first feature.
  • the decoder decodes the coded code stream to obtain the rounded value of the first feature, which may include: the decoder first performs probability estimation on the rounded value of the first feature in the coded code stream to obtain The estimated probability distribution of the rounded value of the first feature; then, the decoder performs entropy decoding on the encoded code stream according to the estimated probability distribution of the rounded value of the first feature to obtain the rounded value of the first feature.
  • Step 808 the decoder inputs the integer value of the first feature into the decoding network to obtain decoded data.
  • the decoder takes the rounded value of the first feature input decoding network get decoded data Among them, the decoded data satisfy Parameter weights for full or partial convolutions and nonlinear activations of the decoding network.
  • the encoding network (ie, the second encoding network) uses fixed parameter weights to extract the content features (ie, the first feature) of the data to be encoded, and then encodes the content features into a code stream (ie, the encoded code stream) and sends it to the decoder.
  • the decoding end decodes and reconstructs the code stream to obtain decoded data. It can be seen that the parameter weights of the encoding network in the prior art are not related to the data to be encoded.
  • the data to be encoded is first input into the first encoding network, and then the first encoding network generates parameter weights of the second encoding network according to the data to be encoded, and then dynamically adjusts the second encoding network according to the obtained weights.
  • the parameter weight of the encoding network makes the parameter weight of the second encoding network related to the data to be encoded, which increases the expressive ability of the second encoding network, and enables the decoding end to obtain the decoded data reconstructed by decoding the code stream through the first feature encoding.
  • the encoded data is closer, which improves the rate-distortion performance of the codec network.
  • the codec method 800 provided in the embodiment of the present application may be applicable to the codec system shown in FIG. 9 .
  • the codec system includes a first encoding network 901 , a second encoding network 902 , a rounding module 903 , an entropy estimation network 904 , an entropy encoding module 905 , an entropy decoding module 906 , and a decoding network 907 .
  • the data to be encoded is first input into the first encoding network 901 to obtain the target parameters, and then the parameters of the second encoding network 902 are adjusted by the target parameters (that is, all convolutions of the second encoding network 902 are adjusted by the target parameters or parameter weights for partial convolutions and nonlinear activations).
  • the data to be encoded is input into the second encoding network 902 to obtain the first features.
  • the rounding module 903 rounds the first feature to obtain a rounded value of the first feature.
  • the entropy estimation network 904 performs probability estimation on the rounded value of the first feature to obtain an estimated probability distribution of the rounded value of the first feature.
  • the entropy coding module 905 performs entropy coding on the rounded value of the first feature according to the estimated probability distribution of the rounded value of the first feature to obtain a coded code stream.
  • the entropy decoding module 906 performs entropy decoding on the encoded code stream according to the estimated probability distribution of the rounded value of the first feature to obtain the rounded value of the first feature.
  • FIG. 10 is a flowchart of an encoding and decoding method 1000 provided in an embodiment of the present application.
  • the codec method 1000 can be performed by an encoder and a decoder.
  • the codec method 1000 is described as a series of steps or operations. It should be understood that the codec method 1000 may be executed in various orders and/or concurrently, and is not limited to the execution order shown in FIG. 10 .
  • the codec method 1000 may include:
  • Step 1001 the encoder acquires data to be encoded.
  • Step 1002 the encoder inputs the data to be encoded into the second encoding network to obtain the first features.
  • the first feature is used to reconstruct the data to be encoded.
  • Step 1003 the encoder inputs the data to be encoded into the first encoding network to obtain the second feature.
  • the second feature is used to reconstruct the target parameter
  • the second feature may also be called a model feature
  • the target parameter is the parameter weight of all or part of the convolution and nonlinear activation of the second decoding network.
  • the encoder can also divide the first feature into two parts (first sub-feature and second sub-feature) from the channel dimension, and one part is used to reconstruct the data to be encoded (first sub-feature feature), and the other part is used to reconstruct the target parameters (the second sub-feature). The encoder then feeds the second sub-features into the first encoding network to obtain the second features.
  • the second sub-feature before the second sub-feature is input into the third encoding network, the second sub-feature may be converted through a convolutional and fully connected network.
  • the second sub-feature before conversion may be called an initial model feature
  • the second sub-feature after conversion may be called a model feature.
  • Step 1004 the encoder encodes the first feature to obtain a first code stream to be decoded.
  • Step 1005 the encoder encodes the second feature to obtain a second code stream to be decoded.
  • the encoder may encode the first feature and the second feature to obtain a code stream to be decoded.
  • Step 1006 the encoder sends the first code stream to be decoded and the second code stream to be decoded to the decoder.
  • Step 1007 the decoder decodes the first code stream to be decoded to obtain the integer value of the first feature.
  • the decoder decoding the first code stream to be decoded to obtain the rounded value of the first feature may include: the decoder performing Probability estimation to obtain an estimated probability distribution of the rounded value of the first feature; performing entropy decoding on the code stream to be decoded according to the estimated probability distribution of the rounded value of the first feature to obtain the first feature The rounded value of .
  • the probability estimation of the rounded value of the first feature in the first code stream to be decoded to obtain the estimated probability distribution of the rounded value of the first feature includes: according to The first information performs probability estimation on the rounded value of the first feature in the first code stream to be decoded to obtain the estimated probability distribution of the rounded value of the first feature, and the first information includes context information and edge at least one of the information.
  • Step 1008 the decoder decodes the second code stream to be decoded to obtain the integer value of the second feature.
  • the rounded value of the second feature may also be referred to as a model rounded feature.
  • the decoder decodes the second code stream to be decoded to obtain the rounded value of the second feature, including: the decoder rounds the second feature in the second code stream to be decoded value to obtain the estimated probability distribution of the rounded value of the second feature; perform entropy decoding on the second code stream to be decoded according to the estimated probability distribution of the rounded value of the second feature to obtain the The rounded value of the second feature.
  • the probability estimation of the rounded value of the second feature in the second code stream to be decoded to obtain the estimated probability distribution of the rounded value of the second feature includes: according to The first information performs probability estimation on the rounded value of the second feature in the second code stream to be decoded to obtain the estimated probability distribution of the rounded value of the second feature, and the first information includes context information and edge at least one of the information.
  • Step 1009 the decoder inputs the rounded value of the second feature into the first decoding network to obtain the target parameter.
  • Step 1010 the decoder builds a second decoding network according to the target parameters.
  • Step 1011 the decoder inputs the integer value of the first feature into the second decoding network to obtain decoded data.
  • the decoding network ie, the second decoding network
  • the content features and model features (i.e., the first feature and the second feature) of the data to be decoded are compiled into a code stream to be decoded, and then the decoding end obtains the rounded value of the second feature by decoding the code stream to be decoded , by inputting the rounded value of the second feature into the first decoding network to obtain the parameter weight of the second decoding network, and then dynamically adjusting the parameter weight of the second decoding network according to the parameter weight, so that the parameter weight of the second decoding network is equal to that to be
  • the correlation of the decoded data improves the expressive ability of the second decoding network, and makes the decoded data obtained by decoding and reconstruction of the second decoding network closer to the data to be encoded, thereby improving the rate-distortion performance of the encoding and decoding network.
  • the encoding and decoding method 1000 provided in the embodiment of the present application may be applicable to the encoding and decoding system described in FIG. 11 .
  • the codec system includes a first encoding network 1101, a second encoding network 1102, a first rounding module 1103, a second rounding module 1104, an entropy estimation network 1105, a first entropy encoding module 1106, a second Two entropy coding module 1107 , first entropy decoding module 1108 , second entropy decoding module 1109 , first decoding network 1110 , and second decoding network 1111 .
  • the data to be encoded is first input into the second encoding network 1102 to obtain the first feature, and then the data to be encoded is input to the first encoding network 1101 to obtain the second feature.
  • the first rounding module 1103 rounds the first feature to obtain a rounded value of the first feature.
  • the second rounding module 1104 rounds the second feature to obtain a rounded value of the second feature.
  • the entropy estimation network 1105 first performs probability estimation on the rounded value of the first feature to obtain the estimated probability distribution of the rounded value of the first feature, and then performs probability estimation on the rounded value of the second feature to obtain the rounded value of the second feature Estimated probability distribution of values.
  • the first entropy coding module 1106 performs entropy coding on the rounded value of the first feature according to the estimated probability distribution of the rounded value of the first feature to obtain a first code stream to be decoded.
  • the second entropy coding module 1107 performs entropy coding on the rounded value of the second feature according to the estimated probability distribution of the rounded value of the second feature to obtain a second code stream to be decoded.
  • the first entropy decoding module 1108 performs entropy decoding on the first code stream to be decoded according to the estimated probability distribution of the rounded value of the first feature to obtain the rounded value of the first feature.
  • the second entropy decoding module 1109 performs entropy decoding on the second code stream to be decoded according to the estimated probability distribution of the rounded value of the second feature to obtain the rounded value of the second feature.
  • the rounded value of the second feature is first input into the first decoding network 1110 to obtain the target parameters, and then the parameters of the second decoding network 1111 are adjusted according to the target parameters (that is, all convolutions or partial convolutions of the second decoding network 1111 are adjusted by the target parameters Product and parameter weights for nonlinear activations).
  • the integer value of the first feature is input into the second decoding network 1111 to obtain decoded data.
  • the encoding and decoding method 1000 provided in the embodiment of the present application may also be applicable to the encoding and decoding system described in FIG. 12 .
  • the codec system includes a first encoding network 1201, a second encoding network 1202, a sub-channel module 1203, a first rounding module 1204, a second rounding module 1205, an entropy estimation network 1206, a first entropy An encoding module 1207 , a second entropy encoding module 1208 , a first entropy decoding module 1209 , a second entropy decoding module 1210 , a first decoding network 1211 , and a second decoding network 1212 .
  • the data to be encoded is first input into the second encoding network 1102 to obtain the first feature.
  • the first feature is input to the channel division module 1203 and divided into the first sub-feature and the second sub-feature in the channel dimension.
  • the second sub-features are input into the first encoding network 1201 to obtain the second features.
  • the first rounding module 1204 rounds the first sub-feature to obtain the rounded value of the first feature.
  • the second rounding module 1205 rounds the second feature to obtain a rounded value of the second feature.
  • the entropy estimation network 1206 first performs probability estimation on the rounded value of the first feature to obtain the estimated probability distribution of the rounded value of the first feature, and then performs probability estimation on the rounded value of the second feature to obtain the rounded value of the second feature Estimated probability distribution of values.
  • the first entropy coding module 1207 performs entropy coding on the rounded value of the first feature according to the estimated probability distribution of the rounded value of the first feature to obtain a first code stream to be decoded.
  • the second entropy coding module 1208 performs entropy coding on the rounded value of the second feature according to the estimated probability distribution of the rounded value of the second feature to obtain a second code stream to be decoded.
  • the first entropy decoding module 1209 performs entropy decoding on the first code stream to be decoded according to the estimated probability distribution of the rounded value of the first feature to obtain the rounded value of the first feature.
  • the second entropy decoding module 1210 performs entropy decoding on the second code stream to be decoded according to the estimated probability distribution of the rounded value of the second feature to obtain the rounded value of the second feature.
  • the rounded value of the second feature is first input into the first decoding network 1211 to obtain the target parameters, and then the parameters of the second decoding network 1212 are adjusted according to the target parameters (that is, all or part of the convolutions of the second decoding network 1212 are adjusted by the target parameters.
  • Product and parameter weights for nonlinear activations are adjusted according to the target parameters.
  • the rounded value of the first feature is input into the second decoding network 1212 to obtain decoded data.
  • FIG. 13 is a flowchart of a codec method 1300 provided in an embodiment of the present application.
  • the codec method 1300 can be performed by an encoder and a decoder.
  • the codec method 1300 is described as a series of steps or operations. It should be understood that the codec method 1300 may be executed in various orders and/or concurrently, and is not limited to the execution order shown in FIG. 13 .
  • the codec method 1300 may include:
  • Step 1301 the encoder acquires data to be encoded.
  • Step 1302 the encoder inputs the data to be encoded into the encoding network to obtain the first feature.
  • Step 1303 the encoder encodes the first feature to obtain a code stream to be decoded.
  • Step 1304 the encoder sends the code stream to be decoded to the decoder.
  • Step 1305 the decoder decodes the to-be-decoded code stream to obtain the integer value of the first feature.
  • the decoder decoding the code stream to be decoded to obtain the rounded value of the first feature may include: the decoder performs probability estimation on the rounded value of the first feature in the code stream to be decoded to obtain Obtain an estimated probability distribution of the rounded value of the first feature; perform entropy decoding on the code stream to be decoded according to the estimated probability distribution of the rounded value of the first feature to obtain the rounded value of the first feature value.
  • performing probability estimation on the rounded value of the first feature in the code stream to be decoded to obtain an estimated probability distribution of the rounded value of the first feature includes: according to the first information Performing probability estimation on the rounded value of the first feature in the code stream to be decoded to obtain an estimated probability distribution of the rounded value of the first feature, the first information includes at least one of context information and side information item.
  • Step 1306 the decoder inputs the integer value of the first feature into the first decoding network to obtain the target parameter.
  • the first decoding network may include a convolution kernel generator (convolution or fully connected group), and the convolution kernel generator is used to generate target parameters according to the rounded value of the first feature of the data to be encoded.
  • a convolution kernel generator convolution or fully connected group
  • Step 1307 the decoder builds a second decoding network according to the target parameters.
  • Step 1308 the decoder inputs the integer value of the first feature into the second decoding network to obtain decoded data.
  • the decoding network ie, the second decoding network
  • the rounded value of the first feature is obtained by decoding the code stream to be decoded encoded by the feature of the data to be decoded (that is, the first feature), and the rounded value of the first feature is input into the first decoding network to obtain
  • the parameter weight of the second decoding network is obtained, and then the parameter weight of the second decoding network is dynamically adjusted according to the parameter weight, so that the parameter weight of the second decoding network is related to the data to be decoded, which improves the expressive ability of the second decoding network and makes the second decoding network
  • the decoded data obtained by decoding and reconstruction of the binary decoding network is closer to the data to be encoded, thereby improving the rate-distortion performance of the encoding and decoding network.
  • the codec method 1300 provided in the embodiment of the present application may be applicable to the codec system described in FIG. 14 .
  • the encoding and decoding system includes an encoding network 1401 , a rounding module 1402 , an entropy estimation network 1403 , an entropy encoding module 1404 , an entropy decoding module 1405 , a first decoding network 1406 , and a second decoding network 1407 .
  • the data to be encoded is first input into the encoding network 1401 to obtain the first feature.
  • the rounding module 1402 rounds the first feature to obtain a rounded value of the first feature.
  • the entropy estimation network 1403 performs probability estimation on the rounded value of the first feature to obtain an estimated probability distribution of the rounded value of the first feature.
  • the entropy coding module 1404 performs entropy coding on the rounded value of the first feature according to the estimated probability distribution of the rounded value of the first feature to obtain a code stream to be decoded.
  • the entropy decoding module 1405 performs entropy decoding on the code stream to be decoded according to the estimated probability distribution of the rounded value of the first feature to obtain the rounded value of the first feature.
  • FIG. 15 is a schematic diagram of the performance of the encoding and decoding method provided by the embodiment of the present application.
  • the coordinate system in FIG. 15 shows the peak signal to noise ratio (Peak Signal to Noise Ratio, PSNR) index used
  • PSNR Peak Signal to Noise Ratio
  • the embodiments of the present application and related technologies respectively perform encoding and decoding performance on the 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 is bit rate (bits per pixel, BPP), and the ordinate is PSNR.
  • BPP is the number of bits used to store each pixel, and the smaller the bit rate, the smaller the compression rate.
  • PSNR is an objective standard for evaluating images, the higher the image quality, the better.
  • Line segment A in the coordinate system shown in FIG. 15 represents the embodiment of the present application
  • line segment B represents the related technology.
  • the PSNR index of the embodiment of the present application is higher than that of the related art
  • the BPP index of the embodiment of the present application is lower than that of the related art under the same picture compression quality (i.e. PSNR index).
  • the rate-distortion performance of the embodiment of the present application is higher than that of the related technology, and the embodiment of the present application can improve the rate-distortion performance of the data encoding and decoding method.
  • Applicable scenarios for the codec method provided by the embodiments of the present application include but are not limited to: electronic devices, cloud services, and video surveillance, all services involving the collection, storage, and transmission of data such as images, videos, and voices. (Such as electronic equipment taking pictures, video and audio, photo albums, cloud photo albums, video surveillance, video conferencing, model compression, etc.).
  • Fig. 16 is a schematic diagram of an application scenario provided by the embodiment of the present application.
  • the electronic device captures image data (data to be compressed) in the application scenario
  • the captured image data (such as RAW, YUV format) , RGB format image data) into the AI coding unit of the electronic device.
  • the AI encoding unit of the electronic device invokes the first encoding network, the second encoding network and the entropy estimation network to transform the image data into output features with lower redundancy and generate an estimated probability distribution of the output features.
  • the arithmetic coding unit of the electronic device calls the entropy coding module to encode the output features into a data file according to the estimated probability distribution of the output features.
  • the file saving unit saves the data file generated by the entropy encoding module to a corresponding storage location of the electronic device.
  • the electronic device loads the data file from the corresponding storage location of the electronic device through the loading file unit, and inputs it into the arithmetic decoding unit, and the arithmetic decoding unit calls the entropy decoding module to decode the data file to obtain the output feature, and outputs
  • the features are input to the AI decoding unit, and the AI decoding unit calls the first decoding network, the second decoding network and the third decoding network to inversely transform the output features, and parse the output features into image data (such as RGB image data), that is, compressed data.
  • the AI coding unit and the AI decoding unit can be deployed in a neural network processing unit (neural network processing unit, NPU or a graphics processing unit, GPU) of an electronic device.
  • the arithmetic decoding unit may be deployed in the CPU of the electronic device.
  • FIG 17 is a schematic diagram of another application scenario provided by the embodiment of the present application.
  • the electronic device directly uploads or encodes (such as JPEG encoding) the stored picture data (data to be compressed) to the On the cloud side (such as a server), the cloud side directly inputs or decodes the received picture data (such as JPEG decoding) and then inputs it into the AI coding unit on the cloud side.
  • the AI coding unit on the cloud side calls the first coding network, the second coding network and An entropy estimation network transforms the image data into less redundant output features and produces an estimated probability distribution of the output features.
  • the arithmetic coding unit on the cloud side calls the entropy coding module to encode the output features into data files according to the estimated probability distribution of the output features.
  • the file saving unit saves the data file generated by the entropy encoding module to a corresponding storage location on the cloud side.
  • the electronic device When the electronic device needs to use the data file, it sends a download request to the cloud side. After receiving the download request, the cloud side loads the data file from the corresponding storage location on the cloud side through the file loading unit, and inputs it into the arithmetic decoding unit.
  • the unit calls the entropy decoding module to decode the data file to obtain the output features, and input the output features to the AI decoding unit, and the AI decoding unit calls the first decoding network, the second decoding network and the third decoding network to inversely transform the output features, and the output features parsed as image data.
  • the cloud sends the image data (compressed data) directly or encodes it to the electronic device.
  • a codec device for performing the above codec method will be introduced below with reference to FIG. 18 and FIG. 19 .
  • the codec device includes hardware and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware 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 in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • the embodiments of the present application may divide the functional modules of the codec device according to the above method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules may be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 18 shows a possible composition diagram of the codec device involved in the above embodiment.
  • the device 1800 may include: a transceiver unit 1801 and a processing unit 1802, where the processing unit 1802 can implement the methods performed by the encoding device, decoding device, encoder or decoder in the above method embodiments, and/or other processes for the technologies described herein.
  • the apparatus 1800 may include a processing unit, a storage unit, and a communication unit.
  • the processing unit may be used to control and manage the actions of the apparatus 1800, for example, may be used to support the apparatus 1800 to execute the steps performed by the above-mentioned units.
  • the storage unit may be used to support the device 1800 to execute stored program codes, and/or data, and the like.
  • the communication unit may be used to support communication of the apparatus 1800 with other devices.
  • the processing unit may be a processor or a controller. It can implement or execute the various illustrative logical blocks, modules and circuits described in connection with the present disclosure.
  • the processor can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (digital signal processing, DSP) and a microprocessor, and the like.
  • the storage unit may be a memory.
  • the communication unit may be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, and a Wi-Fi chip.
  • the codec apparatus involved in this embodiment of the present application may be an apparatus 1900 having the structure shown in FIG. 19 , where the apparatus 1900 includes a processor 1901 and a transceiver 1902 .
  • the transceiver unit 1801 and the processing unit 1802 in FIG. 18 may be implemented by the processor 1901 .
  • the apparatus 1900 may further include a memory 1903, and the processor 1901 and the memory 1903 communicate with each other through an internal connection path.
  • the relevant functions implemented by the storage unit in FIG. 18 may be implemented by the memory 1903 .
  • the embodiment of the present application also provides a computer storage medium, where computer instructions are stored in the computer storage medium, and when the computer instructions are run on the electronic device, the electronic device is made to execute the above-mentioned related method steps to implement the codec method in the above-mentioned embodiment .
  • An embodiment of the present application also provides a computer program product, which, when running on a computer, causes the computer to execute the above-mentioned related steps, so as to implement the encoding and decoding method in the above-mentioned embodiments.
  • the embodiment of the present application also provides a codec device, which may specifically be a chip, an integrated circuit, a component, or a module.
  • the device may include a connected processor and a memory for storing instructions, or the device may include at least one processor for fetching instructions from an external memory.
  • the processor can execute instructions, so that the chip executes the encoding and decoding methods in the above method embodiments.
  • FIG. 20 shows a schematic structural diagram of a chip 2000 .
  • the chip 2000 includes one or more processors 2001 and an interface circuit 2002 .
  • the above-mentioned chip 2000 may further include a bus 2003 .
  • the processor 2001 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above encoding method may be completed by an integrated logic circuit of hardware in the processor 2001 or instructions in the form of software.
  • the above-mentioned processor 2001 may be a general-purpose processor, a digital signal processing (digital signal processing, DSP) device, an integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array) , FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processing
  • ASIC application specific integrated circuit
  • FPGA field-programmable gate array
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the interface circuit 2002 can be used for sending or receiving data, instructions or information.
  • the processor 2001 can process the data, instructions or other information received by the interface circuit 2002, and can send the processing completion information through the interface circuit 2002.
  • the chip further includes a memory, which may include a read-only memory and a random access memory, and provides operation instructions and data to the processor.
  • a portion of the memory may also include non-volatile random access memory (non-volatile random access memory, NVRAM).
  • the memory stores executable software modules or data structures
  • the processor can execute corresponding operations by calling operation instructions stored in the memory (the operation instructions can be stored in the operating system).
  • the chip may be used in the electronic device or DOP involved in the embodiment of the present application.
  • the interface circuit 2002 may be used to output the execution result of the processor 2001.
  • processor 2001 and the interface circuit 2002 can be realized by hardware design, software design, or a combination of software and hardware, which is not limited here.
  • the electronic device, computer storage medium, computer program product or chip provided in this embodiment is all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the corresponding method provided above The beneficial effects in the method will not be repeated here.
  • sequence numbers of the above-mentioned processes do not mean the order of execution, and the execution order of the processes should be determined by their functions and internal logic, and should not be used in the embodiments of the present application.
  • the implementation process constitutes any limitation.
  • the disclosed systems, devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the above units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or can be Integrate 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 above as separate components may or may not be physically separated, and the components displayed 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 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 (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the above-mentioned methods in 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 disk and other various media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Probability & Statistics with Applications (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本申请公开了编解码方法和装置,涉及人工智能技术领域,能够提升数据编解码方法的率失真性能。该方法包括:首先获取待编码数据,然后将所述待编码数据输入第一编码网络以得到目标参数;之后根据所述目标参数构建第二编码网络;接着将所述待编码数据输入所述第二编码网络以得到第一特征;最后对所述第一特征进行编码以得到编码码流。

Description

编解码方法和装置
本申请要求在2021年8月5日提交中国专利局、申请号为202110898667.8、发明名称为“编解码方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及编解码方法和装置。
背景技术
随着科技的进步,图像的数量和分辨率的不断增加,大量的图像不仅需要更大容量的存储媒介,还需要更宽的传输频带和更长的传输时间,这也成为图像处理中的最基本的问题。为了提高图片的存储效率和传输效率,就需要对数据量大的图像进行编码以压缩图像。
基于神经网络对图像进行压缩可以提高图像压缩的效率,现有基于神经网络的图像压缩方法主要分为需要在线训练的神经网络图像压缩方法(简称方式一)和无需在线训练的神经网络图像压缩方法(简称方式二),方式一的率失真性能较好,但因需要在线训练导致图像压缩速度慢,方式二的率失真性能较差但图像压缩速度快。
发明内容
本申请提供了编解码方法和装置,能够提升数据编解码方法的率失真性能且无需在线训练。为达到上述目的,本申请采用如下技术方案:
第一方面,本申请了一种编码方法,该方法包括:首先获取待编码数据,然后将所述待编码数据输入第一编码网络以得到目标参数;之后根据所述目标参数构建第二编码网络;接着将所述待编码数据输入所述第二编码网络以得到第一特征;最后对所述第一特征进行编码以得到编码码流。
现有编码方法中编码网络(即第二编码网络)采用固定的参数权重提取待编码数据的内容特征(即第一特征),然后将内容特征编码为码流(即编码码流)发送至解码端,解码端对码流进行解码重构得到解码数据。可以看出,现有技术中编码网络的参数权重与待编码数据不相关。而本申请提供的编码方法中,先将待编码数据输入到第一编码网络,然后第一编码网络根据待编码数据生成第二编码网络的参数权重,然后根据得到的权重动态调整第二编码网络的参数权重,使第二编码网络的参数权重与待编码数据相关,增加了第二编码网络的表达能力,使解码端通过第一特征编码得到码流解码重构出的解码数据与待编码数据更加接近,从而提升了编解码网络的率失真性能。
可选地,所述目标参数为所述第二编码网络的全部卷积或部分卷积和非线性激活的参数权重。
在一种可能的实现方式中,所述对所述第一特征进行编码以得到编码码流,包括:对所述第一特征进行取整以得到第一特征的取整值;对所述第一特征的取整值进行概率估计 以得到所述第一特征的取整值的估计概率分布;根据所述第一特征的取整值的估计概率分布对所述第一特征的取整值进行熵编码以得所述编码码流。
通过第一特征的取整值的估计概率分布将第一特征的取整值进行熵编码,形成码流,可以降低输出第一特征的编码冗余,进一步降低数据编解码(压缩)过程中的数据传输量。
在一种可能的实现方式中,所述对所述第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,包括:根据第一信息对所述第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
通过上下文信息和边信息进行估计概率分布,能够提高得到的估计概率分布的准确性,从而减小熵编码过程中的码率,实现减小熵编码开销。
第二方面,本申请了一种解码方法,该方法包括:首先获取待解码码流;然后对所述待解码码流进行解码以得到第一特征的取整值和第二特征的取整值;再然后将所述第二特征的取整值输入第一解码网络以得到所述目标参数;接着根据所述目标参数构建第二解码网络;最后将所述第一特征的取整值输入所述第二解码网络以得到解码数据。其中,所述第一特征的取整值用于获得解码数据,所述第二特征的取整值用于获得目标参数。
现有解码方法中解码网络(即第二解码网络)采用固定的参数权重对待编码数据的内容取值特征(即第一特征的取整值)进行解码重构得到解码数据。可以看出,现有技术中解码网络的参数权重与待解码数据不相关。而本申请中将待解码数据的内容特征和模型特征(即第一特征和第二特征)编成待解码码流,然后解码端通过解码待解码码流得到第二特征的取整值,通过将第二特征的取整值输入第一解码网络以得到第二解码网络的参数权重,然后根据该参数权重动态调整第二解码网络的参数权重,使第二解码网络的参数权重与待解码数据相关,提升了第二解码网络的表达能力,使第二解码网络解码重构得到的解码数据与待编码数据更加接近,从而提升了编解码网络的率失真性能。
可选地,所述目标参数为所述第二解码网络的全部卷积或部分卷积和非线性激活的参数权重。
可选地,待解码码流可以包括第一待解码码流和第二待解码码流。
在一种可能的实现方式中,所述对所述待解码码流进行解码以得到第一特征的取整值和第二特征的取整值,包括:对所述第一待解码码流进行解码以得到所述第一特征的取整值;对所述第二待解码码流进行解码以得到所述第二特征的取整值。
在一种可能的实现方式中,所述对所述第一待解码码流进行解码以得到所述第一特征的取整值,包括:对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;根据所述第一特征的取整值的估计概率分布对所述第一待解码码流进行熵解码以得到所述第一特征的取整值。
在一种可能的实现方式中,所述对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,包括:根据第一信息对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
在一种可能的实现方式中,所述对所述第二待解码码流进行解码以得到所述第二特征的取整值,包括:对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述 第二特征的取整值的估计概率分布;根据所述第二特征的取整值的估计概率分布对所述第二待解码码流进行熵解码以得到所述第二特征的取整值。
在一种可能的实现方式中,所述对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布,包括:根据第一信息对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
第三方面,本申请了一种解码方法,该方法包括:首先获取待解码码流;然后对所述待解码码流进行解码以得到所述第一特征的取整值;之后将所述第一特征的取整值输入第三解码网络以得到目标参数;接着根据所述目标参数构建第二解码网络;最后将所述第一特征的取整值输入到所述第二解码网络以得到解码数据。其中,所述第一特征用于获得解码数据和目标参数。
现有解码方法中解码网络(即第二解码网络)采用固定的参数权重对待编码数据的内容取值特征(即第一特征的取整值)进行解码重构得到解码数据。可以看出,现有技术中解码网络的参数权重与待解码数据不相关。而本申请中通过解码待解码数据的特征(即第一特征)编码成的待解码码流得到第一特征的取整值,通过将第一特征的取整值输入第一解码网络以得到第二解码网络的参数权重,然后根据该参数权重动态调整第二解码网络的参数权重,使第二解码网络的参数权重与待解码数据相关,提升了第二解码网络的表达能力,使第二解码网络解码重构得到的解码数据与待编码数据更加接近,从而提升了编解码网络的率失真性能。
可选地,所述目标参数为所述第二解码网络的全部卷积或部分卷积和非线性激活的参数权重。
在一种可能的实现方式中,所述对所述待解码码流进行解码以得到所述第一特征的取整值,包括:对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;根据所述第一特征的取整值的估计概率分布对所述待解码码流进行熵解码以得到所述第一特征的取整值。
在一种可能的实现方式中,所述对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,包括:根据第一信息对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
第四方面,本申请了一种编码装置,该编码装置包括处理电路,所述处理电路用于:获取待编码数据;将所述待编码数据输入第一编码网络以得到目标参数;根据所述目标参数构建第二编码网络;将所述待编码数据输入所述第二编码网络以得到第一特征;对所述第一特征进行编码以得到编码码流。
可选地,所述目标参数为所述第二编码网络的全部卷积或部分卷积和非线性激活的参数权重。
在一种可能的实现方式中,所述处理电路具体用于:对所述第一特征进行取整以得到第一特征的取整值;对所述第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;根据所述第一特征的取整值的估计概率分布对所述第一特征的取整值进行熵编码以得所述编码码流。
在一种可能的实现方式中,所述处理电路具体用于:根据第一信息对所述第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
第五方面,本申请了一种解码装置,该解码装置包括处理电路,所述处理电路用于:获取待解码码流;对所述待解码码流进行解码以得到第一特征的取整值和第二特征的取整值,所述第一特征的取整值用于获得解码数据,所述第二特征的取整值用于获得目标参数;将所述第二特征的取整值输入第一解码网络以得到所述目标参数;根据所述目标参数构建第二解码网络;将所述第一特征的取整值输入所述第二解码网络以得到解码数据。
可选地,所述目标参数为所述第二解码网络的全部卷积或部分卷积和非线性激活的参数权重。
可选地,所述待解码码流包括第一待解码码流和第二待解码码流。
在一种可能的实现方式中,所述处理电路具体用于:对所述第一待解码码流进行解码以得到所述第一特征的取整值;对所述第二待解码码流进行解码以得到所述第二特征的取整值。
在一种可能的实现方式中,所述处理电路具体用于:对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;根据所述第一特征的取整值的估计概率分布对所述第一待解码码流进行熵解码以得到所述第一特征的取整值。
在一种可能的实现方式中,所述处理电路具体用于:根据第一信息对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
在一种可能的实现方式中,所述处理电路具体用于:对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布;根据所述第二特征的取整值的估计概率分布对所述第二待解码码流进行熵解码以得到所述第二特征的取整值。
在一种可能的实现方式中,所述处理电路具体用于:根据第一信息对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
第六方面,本申请了一种解码装置,该解码装置包括处理电路,所述处理电路用于:获取待解码码流;对所述待解码码流进行解码以得到第一特征的取整值,所述第一特征的取整值用于获得解码数据和目标参数;将所述第一特征的取整值输入第一解码网络以得到目标参数;根据所述目标参数构建第二解码网络;将所述第一特征的取整值输入到所述第二解码网络以得到解码数据。
可选地,所述目标参数为所述第二解码网络的全部卷积或部分卷积和非线性激活的参数权重。
在一种可能的实现方式中,所述处理电路具体用于:对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;根据所述第一特征的取整值的估计概率分布对所述待解码码流进行熵解码以得到所述第一特征的取整值。
在一种可能的实现方式中,所述处理电路具体用于:根据第一信息对所述待解码码流 中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
第七方面,本申请实施例还提供一种编码器,该编码器包括:至少一个处理器,当所述至少一个处理器执行程序代码或指令时,实现上述第一方面或其任意可能的实现方式中所述的方法。
可选地,该编码器还可以包括至少一个存储器,该至少一个存储器用于存储该程序代码或指令。
第八方面,本申请实施例还提供一种解码器,该解码器包括:至少一个处理器,当所述至少一个处理器执行程序代码或指令时,实现上述第二方面或其任意可能的实现方式中所述的方法。
可选地,该解码器还可以包括至少一个存储器,该至少一个存储器用于存储该程序代码或指令。
第九方面,本申请实施例还提供一种芯片,包括:输入接口、输出接口、至少一个处理器。可选地,该芯片还包括存储器。该至少一个处理器用于执行该存储器中的代码,当该至少一个处理器执行该代码时,该芯片实现上述第一方面或其任意可能的实现方式中所述的方法。
可选地,上述芯片还可以为集成电路。
第十方面,本申请实施例还提供一种终端,该终端包括上述编码装置、解码装置、编码器、解码器或上述芯片。
第十一方面,本申请还提供一种计算机可读存储介质,用于存储计算机程序,该计算机程序包括用于实现上述第一方面或其任意可能的实现方式中所述的方法。
第十二方面,本申请实施例还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机实现上述第一方面或其任意可能的实现方式中所述的方法。
本实施例提供的编码装置、解码装置、编码器、解码器、计算机存储介质、计算机程序产品和芯片均用于执行上文所提供的方法,因此,其所能达到的有益效果可参考上文所提供的方法中的有益效果,此处不再赘述。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1a为本申请实施例提供的译码系统的一种示例性框图;
图1b为本申请实施例提供的视频译码系统的一种示例性框图;
图2为本申请实施例提供的视频编码器的一种示例性框图;
图3为本申请实施例提供的视频解码器的一种示例性框图;
图4为本申请实施例提供的候选图像块的一种示例性的示意图;
图5为本申请实施例提供的视频译码设备的一种示例性框图;
图6为本申请实施例提供的装置的一种示例性框图;
图7a为本申请实施例提供的一个应用场景的示意图;
图7b为本申请实施例提供的一个应用场景的示意图;
图8为本申请实施例提供的一种编解码方法的流程示意图;
图9为本申请实施例提供的一种编解码系统的结构示意图;
图10为本申请实施例提供的另一种编解码方法的流程示意图;
图11为本申请实施例提供的另一种编解码系统的结构示意图;
图12为本申请实施例提供的又一种编解码系统的结构示意图;
图13为本申请实施例提供的又一种编解码方法的流程示意图;
图14为本申请实施例提供的又一种编解码系统的结构示意图;
图15为本申请实施例提供的编解码方法的性能的示意图;
图16为本申请实施例提供的一个应用场景的示意图;
图17为本申请实施例提供的另一个应用场景的示意图;
图18为本申请实施例提供的一种编解码装置的结构示意图;
图19为本申请实施例提供的另一种编解码装置的结构示意图;
图20为本申请实施例提供的一种芯片的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。
本申请的说明书以及附图中的术语“第一”和“第二”等是用于区别不同的对象,或者用于区别对同一对象的不同处理,而不是用于描述对象的特定顺序。
此外,本申请的描述中所提到的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选的还包括其他没有列出的步骤或单元,或可选的还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。
需要说明的是,本申请实施例的描述中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。
在本申请的描述中,除非另有说明,“多个”的含义是指两个或两个以上。
本申请实施例提供一种基于AI的数据压缩/解压缩技术,尤其是提供一种基于神经网络的数据压缩/解压缩技术,具体提供一种编解码技术,以改进传统的混合数据编解码系统。
数据编解码包括数据编码和数据解码两部分。数据编码在源侧(或通常称为编码器侧) 执行,通常包括处理(例如,压缩)原始数据以减少表示该原始数据所需的数据量(从而更高效存储和/或传输)。数据解码在目的地侧(或通常称为解码器侧)执行,通常包括相对于编码器侧作逆处理,以重建原始数据。本申请实施例涉及的数据的“编解码”应理解为数据的“编码”或“解码”。编码部分和解码部分也合称为编解码(编码和解码,CODEC)。
在无损数据编码情况下,可以重建原始数据,即重建的原始数据与原始数据具有相同的质量(假设存储或传输期间没有传输损耗或其它数据丢失)。在有损数据编码情况下,通过量化等执行进一步压缩,来减少表示原始数据所需的数据量,而解码器侧无法完全重建原始数据,即重建的原始数据的质量比原始数据的质量低或差。
本申请实施例可以应用于对视频数据、图像数据、音频数据、整数型数据以及其他具有压缩/解压缩需求的数据等。以下以视频数据的编码(简称视频编码)为例对本申请实施例进行说明,其他类型的数据(例如图像数据、音频数据、整数型数据以及其他具有压缩/解压缩需求的数据)可以参考以下描述,本申请实施例对此不再赘述。需要说明的是,相对于视频编码,音频数据以及整数型数据等数据的编码过程中无需将数据分割为块,而是可以直接对数据进行编码。
视频编码通常是指处理形成视频或视频序列的图像序列。在视频编码领域,术语“图像(picture)”、“帧(frame)”或“图片(image)”可以用作同义词。
几个视频编码标准属于“有损混合型视频编解码”(即,将像素域中的空间和时间预测与变换域中用于应用量化的2D变换编码结合)。视频序列中的每个图像通常分割成不重叠的块集合,通常在块级上进行编码。换句话说,编码器通常在块(视频块)级处理即编码视频,例如,通过空间(帧内)预测和时间(帧间)预测来产生预测块;从当前块(当前处理/待处理的块)中减去预测块,得到残差块;在变换域中变换残差块并量化残差块,以减少待传输(压缩)的数据量,而解码器侧将相对于编码器的逆处理部分应用于编码或压缩的块,以重建用于表示的当前块。另外,编码器需要重复解码器的处理步骤,使得编码器和解码器生成相同的预测(例如,帧内预测和帧间预测)和/或重建像素,用于处理,即编码后续块。
在以下译码系统10的实施例中,编码器20和解码器30根据图1a至图3进行描述。
图1a为本申请实施例提供的译码系统10的一种示例性框图,例如可以利用本申请技术的视频译码系统10(或简称为译码系统10)。视频译码系统10中的视频编码器20(或简称为编码器20)和视频解码器30(或简称为解码器30)代表可用于根据本申请中描述的各种示例执行各技术的设备等。
如图1a所示,译码系统10包括源设备12,源设备12用于将编码图像等编码图像数据21提供给用于对编码图像数据21进行解码的目的设备14。
源设备12包括编码器20,另外即可选地,可包括图像源16、图像预处理器等预处理器(或预处理单元)18、通信接口(或通信单元)22。
图像源16可包括或可以为任意类型的用于捕获现实世界图像等的图像捕获设备,和/或任意类型的图像生成设备,例如用于生成计算机动画图像的计算机图形处理器或任意类型的用于获取和/或提供现实世界图像、计算机生成图像(例如,屏幕内容、虚拟现实(virtual reality,VR)图像和/或其任意组合(例如增强现实(augmented reality,AR)图像)的设备。所述图像源可以为存储上述图像中的任意图像的任意类型的内存或存储器。
为了区分预处理器(或预处理单元)18执行的处理,图像(或图像数据)17也可称为原始图像(或原始图像数据)17。
预处理器18用于接收原始图像数据17,并对原始图像数据17进行预处理,得到预处理图像(或预处理图像数据)19。例如,预处理器18执行的预处理可包括修剪、颜色格式转换(例如从RGB转换为YCbCr)、调色或去噪。可以理解的是,预处理单元18可以为可选组件。
视频编码器(或编码器)20用于接收预处理图像数据19并提供编码图像数据21(下面将根据图2等进一步描述)。
源设备12中的通信接口22可用于:接收编码图像数据21并通过通信信道13向目的设备14等另一设备或任何其它设备发送编码图像数据21(或其它任意处理后的版本),以便存储或直接重建。
目的设备14包括解码器30,另外即可选地,可包括通信接口(或通信单元)28、后处理器(或后处理单元)32和显示设备34。
目的设备14中的通信接口28用于直接从源设备12或从存储设备等任意其它源设备接收编码图像数据21(或其它任意处理后的版本),例如,存储设备为编码图像数据存储设备,并将编码图像数据21提供给解码器30。
通信接口22和通信接口28可用于通过源设备12与目的设备14之间的直连通信链路,例如直接有线或无线连接等,或者通过任意类型的网络,例如有线网络、无线网络或其任意组合、任意类型的私网和公网或其任意类型的组合,发送或接收编码图像数据(或编码数据)21。
例如,通信接口22可用于将编码图像数据21封装为报文等合适的格式,和/或使用任意类型的传输编码或处理来处理所述编码后的图像数据,以便在通信链路或通信网络上进行传输。
通信接口28与通信接口22对应,例如,可用于接收传输数据,并使用任意类型的对应传输解码或处理和/或解封装对传输数据进行处理,得到编码图像数据21。
通信接口22和通信接口28均可配置为如图1a中从源设备12指向目的设备14的对应通信信道13的箭头所指示的单向通信接口,或双向通信接口,并且可用于发送和接收消息等,以建立连接,确认并交换与通信链路和/或例如编码后的图像数据传输等数据传输相关的任何其它信息,等等。
视频解码器(或解码器)30用于接收编码图像数据21并提供解码图像数据(或解码图像数据)31(下面将根据图3等进一步描述)。
后处理器32用于对解码后的图像等解码图像数据31(也称为重建后的图像数据)进行后处理,得到后处理后的图像等后处理图像数据33。后处理单元32执行的后处理可以包括例如颜色格式转换(例如从YCbCr转换为RGB)、调色、修剪或重采样,或者用于产生供显示设备34等显示的解码图像数据31等任何其它处理。
显示设备34用于接收后处理图像数据33,以向用户或观看者等显示图像。显示设备34可以为或包括任意类型的用于表示重建后图像的显示器,例如,集成或外部显示屏或显示器。例如,显示屏可包括液晶显示器(liquid crystal display,LCD)、有机发光二极管(organic light emitting diode,OLED)显示器、等离子显示器、投影仪、微型LED显 示器、硅基液晶显示器(liquid crystal on silicon,LCoS)、数字光处理器(digital light processor,DLP)或任意类型的其它显示屏。
译码系统10还包括训练引擎25,训练引擎25用于训练编码器20(尤其是编码器20中的熵编码单元270)或解码器30(尤其是解码器30中的熵解码单元304),以根据估计得到的估计概率分布对待编码图像块进行熵编码,训练引擎25的详细说明请参考下述方法测实施例。
尽管图1a示出了源设备12和目的设备14作为独立的设备,但设备实施例也可以同时包括源设备12和目的设备14或同时包括源设备12和目的设备14的功能,即同时包括源设备12或对应功能和目的设备14或对应功能。在这些实施例中,源设备12或对应功能和目的设备14或对应功能可以使用相同硬件和/或软件或通过单独的硬件和/或软件或其任意组合来实现。
根据描述,图1a所示的源设备12和/或目的设备14中的不同单元或功能的存在和(准确)划分可能根据实际设备和应用而有所不同,这对技术人员来说是显而易见的。
请参考图1b,图1b为本申请实施例提供的视频译码系统40的一种示例性框图,编码器20(例如视频编码器20)或解码器30(例如视频解码器30)或两者都可通过如图1b所示的视频译码系统40中的处理电路实现,例如一个或多个微处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application-specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)、离散逻辑、硬件、视频编码专用处理器或其任意组合。请参考图2和图3,图2为本申请实施例提供的视频编码器的一种示例性框图,图3为本申请实施例提供的视频解码器的一种示例性框图。编码器20可以通过处理电路46实现,以包含参照图2编码器20论述的各种模块和/或本文描述的任何其它编码器系统或子系统。解码器30可以通过处理电路46实现,以包含参照图3解码器30论述的各种模块和/或本文描述的任何其它解码器系统或子系统。所述处理电路46可用于执行下文论述的各种操作。如图5所示,如果部分技术在软件中实施,则设备可以将软件的指令存储在合适的非瞬时性计算机可读存储介质中,并且使用一个或多个处理器在硬件中执行指令,从而执行本申请技术。视频编码器20和视频解码器30中的其中一个可作为组合编解码器(encoder/decoder,CODEC)的一部分集成在单个设备中,如图1b所示。
源设备12和目的设备14可包括各种设备中的任一种,包括任意类型的手持设备或固定设备,例如,笔记本电脑或膝上型电脑、手机、智能手机、平板或平板电脑、相机、台式计算机、机顶盒、电视机、显示设备、数字媒体播放器、视频游戏控制台、视频流设备(例如,内容业务服务器或内容分发服务器)、广播接收设备、广播发射设备以及监控设备等等,并可以不使用或使用任意类型的操作系统。源设备12和目的设备14也可以是云计算场景中的设备,例如云计算场景中的虚拟机等。在一些情况下,源设备12和目的设备14可配备用于无线通信的组件。因此,源设备12和目的设备14可以是无线通信设备。
源设备12和目的设备14可以安装虚拟现实(virtual reality,VR)应用、增强现实(augmented reality,AR)应用或者混合现实(mixed reality,MR)应用等虚拟场景应用程序(application,APP),并可以基于用户的操作(例如点击、触摸、滑动、抖动、声控等)运行VR应用、AR应用或者MR应用。源设备12和目的设备14可以通过摄像头 和/或传感器采集环境中任意物体的图像/视频,再根据采集的图像/视频在显示设备上显示虚拟物体,该虚拟物体可以是VR场景、AR场景或MR场景中的虚拟物体(即虚拟环境中的物体)。
需要说明的是,本申请实施例中,源设备12和目的设备14中的虚拟场景应用程序可以是源设备12和目的设备14自身内置的应用程序,也可以是用户自行安装的第三方服务商提供的应用程序,对此不做具体限定。
此外,源设备12和目的设备14可以安装实时视频传输应用,例如直播应用。源设备12和目的设备14可以通过摄像头采集图像/视频,再将采集的图像/视频在显示设备上显示。
在一些情况下,图1a所示的视频译码系统10仅仅是示例性的,本申请提供的技术可适用于视频编码设置(例如,视频编码或视频解码),这些设置不一定包括编码设备与解码设备之间的任何数据通信。在其它示例中,数据从本地存储器中检索,通过网络发送,等等。视频编码设备可以对数据进行编码并将数据存储到存储器中,和/或视频解码设备可以从存储器中检索数据并对数据进行解码。在一些示例中,编码和解码由相互不通信而只是编码数据到存储器和/或从存储器中检索并解码数据的设备来执行。
请参考图1b,图1b为本申请实施例提供的视频译码系统40的一种示例性框图,如图1b所示,视频译码系统40可以包含成像设备41、视频编码器20、视频解码器30(和/或藉由处理电路46实施的视频编/解码器)、天线42、一个或多个处理器43、一个或多个内存存储器44和/或显示设备45。
如图1b所示,成像设备41、天线42、处理电路46、视频编码器20、视频解码器30、处理器43、内存存储器44和/或显示设备45能够互相通信。在不同实例中,视频译码系统40可以只包含视频编码器20或只包含视频解码器30。
在一些实例中,天线42可以用于传输或接收视频数据的经编码比特流。另外,在一些实例中,显示设备45可以用于呈现视频数据。处理电路46可以包含专用集成电路(application-specific integrated circuit,ASIC)逻辑、图形处理器、通用处理器等。视频译码系统40也可以包含可选的处理器43,该可选处理器43类似地可以包含专用集成电路(application-specific integrated circuit,ASIC)逻辑、图形处理器、通用处理器等。另外,内存存储器44可以是任何类型的存储器,例如易失性存储器(例如,静态随机存取存储器(static random access memory,SRAM)、动态随机存储器(dynamic random access memory,DRAM)等)或非易失性存储器(例如,闪存等)等。在非限制性实例中,内存存储器44可以由超速缓存内存实施。在其它实例中,处理电路46可以包含存储器(例如,缓存等)用于实施图像缓冲器等。
在一些实例中,通过逻辑电路实施的视频编码器20可以包含(例如,通过处理电路46或内存存储器44实施的)图像缓冲器和(例如,通过处理电路46实施的)图形处理单元。图形处理单元可以通信耦合至图像缓冲器。图形处理单元可以包含通过处理电路46实施的视频编码器20,以实施参照图2和/或本文中所描述的任何其它编码器系统或子系统所论述的各种模块。逻辑电路可以用于执行本文所论述的各种操作。
在一些实例中,视频解码器30可以以类似方式通过处理电路46实施,以实施参照图3的视频解码器30和/或本文中所描述的任何其它解码器系统或子系统所论述的各种模块。 在一些实例中,逻辑电路实施的视频解码器30可以包含(通过处理电路46或内存存储器44实施的)图像缓冲器和(例如,通过处理电路46实施的)图形处理单元。图形处理单元可以通信耦合至图像缓冲器。图形处理单元可以包含通过处理电路46实施的视频解码器30,以实施参照图3和/或本文中所描述的任何其它解码器系统或子系统所论述的各种模块。
在一些实例中,天线42可以用于接收视频数据的经编码比特流。如所论述,经编码比特流可以包含本文所论述的与编码视频帧相关的数据、指示符、索引值、模式选择数据等,例如与编码分割相关的数据(例如,变换系数或经量化变换系数,(如所论述的)可选指示符,和/或定义编码分割的数据)。视频译码系统40还可包含耦合至天线42并用于解码经编码比特流的视频解码器30。显示设备45用于呈现视频帧。
应理解,本申请实施例中对于参考视频编码器20所描述的实例,视频解码器30可以用于执行相反过程。关于信令语法元素,视频解码器30可以用于接收并解析这种语法元素,相应地解码相关视频数据。在一些例子中,视频编码器20可以将语法元素熵编码成经编码视频比特流。在此类实例中,视频解码器30可以解析这种语法元素,并相应地解码相关视频数据。
为便于描述,参考通用视频编码(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。
编码器和编码方法
如图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也可称为混合型视频编码器或基于混合型视频编解码器的视频编码器。
参见图2,帧间预测单元为经过训练的目标模型(亦称为神经网络),该神经网络用于处理输入图像或图像区域或图像块,以生成输入图像块的预测值。例如,用于帧间预测的神经网络用于接收输入的图像或图像区域或图像块,并且生成输入的图像或图像区域或图像块的预测值。
残差计算单元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的“内置解码器”。
图像和图像分割(图像和块)
编码器20可用于通过输入端201等接收图像(或图像数据)17,例如,形成视频或视频序列的图像序列中的图像。接收的图像或图像数据也可以是预处理后的图像(或预处理后的图像数据)19。为简单起见,以下描述使用图像17。图像17也可称为当前图像或待编码的图像(尤其是在视频编码中将当前图像与其它图像区分开时,其它图像例如同一视频序列,即也包括当前图像的视频序列,中的之前编码后图像和/或解码后图像)。
(数字)图像为或可以视为具有强度值的像素点组成的二维阵列或矩阵。阵列中的像素点也可以称为像素(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彩色格式的亮度像素点阵列和两个相应的色度像素点阵列。
在一个实施例中,视频编码器20的实施例可包括图像分割单元(图2中未示出),用于将图像17分割成多个(通常不重叠)图像块203。这些块在H.265/HEVC和VVC标准中也可以称为根块、宏块(H.264/AVC)或编码树块(coding tree block,CTB),或编码树单元(coding tree unit,CTU)。分割单元可用于对视频序列中的所有图像使用相同的块大小和使用限定块大小的对应网格,或在图像或图像子集或图像组之间改变块大小,并将每个图像分割成对应块。
在其它实施例中,视频编码器可用于直接接收图像17的块203,例如,组成所述图像17的一个、几个或所有块。图像块203也可以称为当前图像块或待编码图像块。
与图像17一样,图像块203同样是或可认为是具有强度值(像素点值)的像素点组成的二维阵列或矩阵,但是图像块203的比图像17的小。换句话说,块203可包括一个像素点阵列(例如,单色图像17情况下的亮度阵列或彩色图像情况下的亮度阵列或色度阵列)或三个像素点阵列(例如,彩色图像17情况下的一个亮度阵列和两个色度阵列)或根据所采用的颜色格式的任何其它数量和/或类型的阵列。块203的水平方向和垂直方向(或轴线)上的像素点数量限定了块203的大小。相应地,块可以为M×N(M列×N行)个像素点阵列,或M×N个变换系数阵列等。
在一个实施例中,图2所示的视频编码器20用于逐块对图像17进行编码,例如,对每个块203执行编码和预测。
在一个实施例中,图2所示的视频编码器20还可以用于使用片(也称为视频片)分割和/或编码图像,其中图像可以使用一个或多个片(通常为不重叠的)进行分割或编码。每个片可包括一个或多个块(例如,编码树单元CTU)或一个或多个块组(例如 H.265/HEVC/VVC标准中的编码区块(tile)和VVC标准中的砖(brick)。
在一个实施例中,图2所示的视频编码器20还可以用于使用片/编码区块组(也称为视频编码区块组)和/或编码区块(也称为视频编码区块)对图像进行分割和/或编码,其中图像可以使用一个或多个片/编码区块组(通常为不重叠的)进行分割或编码,每个片/编码区块组可包括一个或多个块(例如CTU)或一个或多个编码区块等,其中每个编码区块可以为矩形等形状,可包括一个或多个完整或部分块(例如CTU)。
残差计算
残差计算单元204用于通过如下方式根据图像块(或原始块)203和预测块265来计算残差块205(后续详细介绍了预测块265):例如,逐个像素点(逐个像素)从图像块203的像素点值中减去预测块265的像素点值,得到像素域中的残差块205。
变换
变换处理单元206用于对残差块205的像素点值执行离散余弦变换(discrete cosine transform,DCT)或离散正弦变换(discrete sine transform,DST)等,得到变换域中的变换系数207。变换系数207也可称为变换残差系数,表示变换域中的残差块205。
变换处理单元206可用于应用DCT/DST的整数化近似,例如为H.265/HEVC指定的变换。与正交DCT变换相比,这种整数化近似通常由某一因子按比例缩放。为了维持经过正变换和逆变换处理的残差块的范数,使用其它比例缩放因子作为变换过程的一部分。比例缩放因子通常是根据某些约束条件来选择的,例如比例缩放因子是用于移位运算的2的幂、变换系数的位深度、准确性与实施成本之间的权衡等。例如,在编码器20侧通过逆变换处理单元212为逆变换(以及在解码器30侧通过例如逆变换处理单元312为对应逆变换)指定具体的比例缩放因子,以及相应地,可以在编码器20侧通过变换处理单元206为正变换指定对应比例缩放因子。
在一个实施例中,视频编码器20(对应地,变换处理单元206)可用于输出一种或多种变换的类型等变换参数,例如,直接输出或由熵编码单元270进行编码或压缩后输出,例如使得视频解码器30可接收并使用变换参数进行解码。
量化
量化单元208用于通过例如标量量化或矢量量化对变换系数207进行量化,得到量化变换系数209。量化变换系数209也可称为量化残差系数209。
量化过程可减少与部分或全部变换系数207有关的位深度。例如,可在量化期间将n位变换系数向下舍入到m位变换系数,其中n大于m。可通过调整量化参数(quantization parameter,QP)修改量化程度。例如,对于标量量化,可以应用不同程度的比例来实现较细或较粗的量化。较小量化步长对应较细量化,而较大量化步长对应较粗量化。可通过量化参数(quantization parameter,QP)指示合适的量化步长。例如,量化参数可以为合适的量化步长的预定义集合的索引。例如,较小的量化参数可对应精细量化(较小量化步长),较大的量化参数可对应粗糙量化(较大量化步长),反之亦然。量化可包括除以量化步长,而反量化单元210等执行的对应或逆解量化可包括乘以量化步长。根据例如HEVC一些标准的实施例可用于使用量化参数来确定量化步长。一般而言,可以根据量化参数使用包含除法的等式的定点近似来计算量化步长。可以引入其它比例缩放因子来进行量化和解量化,以恢复可能由于在用于量化步长和量化参数的等式的定点近似中使用的比例而修 改的残差块的范数。在一种示例性实现方式中,可以合并逆变换和解量化的比例。或者,可以使用自定义量化表并在比特流中等将其从编码器向解码器指示。量化是有损操作,其中量化步长越大,损耗越大。
在一个实施例中,视频编码器20(对应地,量化单元208)可用于输出量化参数(quantization parameter,QP),例如,直接输出或由熵编码单元270进行编码或压缩后输出,例如使得视频解码器30可接收并使用量化参数进行解码。
反量化
反量化单元210用于对量化系数执行量化单元208的反量化,得到解量化系数211,例如,根据或使用与量化单元208相同的量化步长执行与量化单元208所执行的量化方案的反量化方案。解量化系数211也可称为解量化残差系数211,对应于变换系数207,但是由于量化造成损耗,反量化系数211通常与变换系数不完全相同。
逆变换
逆变换处理单元212用于执行变换处理单元206执行的变换的逆变换,例如,逆离散余弦变换(discrete cosine transform,DCT)或逆离散正弦变换(discrete sine transform,DST),以在像素域中得到重建残差块213(或对应的解量化系数213)。重建残差块213也可称为变换块213。
重建
重建单元214(例如,求和器214)用于将变换块213(即重建残差块213)添加到预测块265,以在像素域中得到重建块215,例如,将重建残差块213的像素点值和预测块265的像素点值相加。
滤波
环路滤波器单元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。
在一个实施例中,视频编码器20(对应地,环路滤波器单元220)可用于输出环路滤波器参数(例如SAO滤波参数、ALF滤波参数或LMCS参数),例如,直接输出或由熵编码单元270进行熵编码后输出,例如使得解码器30可接收并使用相同或不同的环路滤波器参数进行解码。
解码图像缓冲器
解码图像缓冲器(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,或未进行任何其它处理的重建块或重建像素点。
模式选择(分割和预测)
模式选择单元260包括分割单元262、帧间预测单元244和帧内预测单元254,用于从解码图像缓冲器230或其它缓冲器(例如,列缓冲器,图2中未显示)接收或获得原始块203(当前图像17的当前块203)和重建图像数据等原始图像数据,例如,同一(当前)图像和/或一个或多个之前解码图像的滤波和/或未经滤波的重建像素点或重建块。重建图像数据用作帧间预测或帧内预测等预测所需的参考图像数据,以得到预测块265或预测值265。
模式选择单元260可用于为当前块(包括不分割)和预测模式(例如帧内或帧间预测模式)确定或选择一种分割,生成对应的预测块265,以对残差块205进行计算和对重建块215进行重建。
在一个实施例中,模式选择单元260可用于选择分割和预测模式(例如,从模式选择单元260支持的或可用的预测模式中),所述预测模式提供最佳匹配或者说最小残差(最小残差是指传输或存储中更好的压缩),或者提供最小信令开销(最小信令开销是指传输或存储中更好的压缩),或者同时考虑或平衡以上两者。模式选择单元260可用于根据码率失真优化(rate distortion Optimization,RDO)确定分割和预测模式,即选择提供最小码率失真优化的预测模式。本文“最佳”、“最低”、“最优”等术语不一定指总体上“最佳”、“最低”、“最优”的,但也可以指满足终止或选择标准的情况,例如,超过或低于阈值的值或其他限制可能导致“次优选择”,但会降低复杂度和处理时间。
换言之,分割单元262可用于将视频序列中的图像分割为编码树单元(coding tree unit,CTU)序列,CTU 203可进一步被分割成较小的块部分或子块(再次形成块),例如,通过迭代使用四叉树(quad-tree partitioning,QT)分割、二叉树(binary-tree partitioning,BT)分割或三叉树(triple-tree partitioning,TT)分割或其任意组合,并且用于例如对块部分或子块中的每一个执行预测,其中模式选择包括选择分割块203的树结构和选择应用于块部分或子块中的每一个的预测模式。
下文将详细地描述由视频编码器20执行的分割(例如,由分割单元262执行)和预测处理(例如,由帧间预测单元244和帧内预测单元254执行)。
分割
分割单元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)。
例如,编码树单元(CTU)可以为或包括亮度像素点的CTB、具有三个像素点阵列的图像的色度像素点的两个对应CTB、或单色图像的像素点的CTB或使用三个独立颜色平面和语法结构(用于编码像素点)编码的图像的像素点的CTB。相应地,编码树块(CTB)可以为N×N个像素点块,其中N可以设为某个值使得分量划分为CTB,这就是分割。编码单元(coding unit,CU)可以为或包括亮度像素点的编码块、具有三个像素点阵列的图像的色度像素点的两个对应编码块、或单色图像的像素点的编码块或使用三个独立颜色平面和语法结构(用于编码像素点)编码的图像的像素点的编码块。相应地,编码块(CB)可以为M×N个像素点块,其中M和N可以设为某个值使得CTB划分为编码块,这就是分割。
例如,在实施例中,根据HEVC可通过使用表示为编码树的四叉树结构将编码树单元(CTU)划分为多个CU。在叶CU级作出是否使用帧间(时间)预测或帧内(空间)预测对图像区域进行编码的决定。每个叶CU可以根据PU划分类型进一步划分为一个、两个或四个PU。一个PU内使用相同的预测过程,并以PU为单位向解码器传输相关信息。在根据PU划分类型应用预测过程得到残差块之后,可以根据类似于用于CU的编码树的其它四叉树结构将叶CU分割为变换单元(TU)。
例如,在实施例中,根据当前正在开发的最新视频编码标准(称为通用视频编码(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的大小。
另外,需要说明的是,当树节点块的一部分超出底部或图像右边界时,强制对该树节点块进行划分,直到每个编码CU的所有像素点都位于图像边界内。
例如,所述帧内子分割(intra sub-partitions,ISP)工具可以根据块大小将亮度帧内预测块垂直或水平地分为两个或四个子部分。
在一个示例中,视频编码器20的模式选择单元260可以用于执行上文描述的分割技术的任意组合。
如上所述,视频编码器20用于从(预定的)预测模式集合中确定或选择最好或最优的预测模式。预测模式集合可包括例如帧内预测模式和/或帧间预测模式。
帧内预测
帧内预测模式集合可包括35种不同的帧内预测模式,例如,像DC(或均值)模式和平面模式的非方向性模式,或如HEVC定义的方向性模式,或者可包括67种不同的帧内预测模式,例如,像DC(或均值)模式和平面模式的非方向性模式,或如VVC中定义的方向性模式。例如,若干传统角度帧内预测模式自适应地替换为VVC中定义的非正方形块的广角帧内预测模式。又例如,为了避免DC预测的除法运算,仅使用较长边来计算非正方形块的平均值。并且,平面模式的帧内预测结果还可以使用位置决定的帧内预测组合(position dependent intra prediction combination,PDPC)方法修改。
帧内预测单元254用于根据帧内预测模式集合中的帧内预测模式使用同一当前图像的相邻块的重建像素点来生成帧内预测块265。
帧内预测单元254(或通常为模式选择单元260)还用于输出帧内预测参数(或通常 为指示块的选定帧内预测模式的信息)以语法元素266的形式发送到熵编码单元270,以包含到编码图像数据21中,从而视频解码器30可执行操作,例如接收并使用用于解码的预测参数。
HEVC中的帧内预测模式包括直流预测模式,平面预测模式和33种角度预测模式,共计35个候选预测模式。当前块可以使用左侧和上方已重建图像块的像素作为参考进行帧内预测。当前块的周边区域中用来对当前块进行帧内预测的图像块成为参考块,参考块中的像素称为参考像素。35个候选预测模式中,直流预测模式适用于当前块中纹理平坦的区域,该区域中所有像素均使用参考块中的参考像素的平均值作为预测;平面预测模式适用于纹理平滑变化的图像块,符合该条件的当前块使用参考块中的参考像素进行双线性插值作为当前块中的所有像素的预测;角度预测模式利用当前块的纹理与相邻已重建图像块的纹理高度相关的特性,沿某一角度复制对应的参考块中的参考像素的值作为当前块中的所有像素的预测。
HEVC编码器给当前块从35个候选预测模式中选择一个最优帧内预测模式,并将该最优帧内预测模式写入视频码流。为提升帧内预测的编码效率,编码器/解码器会从周边区域中、采用帧内预测的已重建图像块各自的最优帧内预测模式中推导出3个最可能模式,如果给当前块选择的最优帧内预测模式是这3个最可能模式的其中之一,则编码一个第一索引指示所选择的最优帧内预测模式是这3个最可能模式的其中之一;如果选中的最优帧内预测模式不是这3个最可能模式,则编码一个第二索引指示所选择的最优帧内预测模式是其他32个模式(35个候选预测模式中除前述3个最可能模式外的其他模式)的其中之一。HEVC标准使用5比特的定长码作为前述第二索引。
HEVC编码器推导出3个最可能模式的方法包括:选取当前块的左相邻图像块和上相邻图像块的最优帧内预测模式放入集合,如果这两个最优帧内预测模式相同,则集合中只保留一个即可。如果这两个最优帧内预测模式相同且均为角度预测模式,则再选取与该角度方向邻近的两个角度预测模式加入集合;否则,依次选择平面预测模式、直流模式模式和竖直预测模式加入集合,直到集合中的模式数量达到3。
HEVC解码器对码流做熵解码后,获得当前块的模式信息,该模式信息包括指示当前块的最优帧内预测模式是否在3个最可能模式中的指示标识,以及当前块的最优帧内预测模式在3个最可能模式中的索引或者当前块的最优帧内预测模式在其他32个模式中的索引。
帧间预测
在可能的实现中,帧间预测模式集合取决于可用参考图像(即,例如前述存储在DBP230中的至少部分之前解码的图像)和其它帧间预测参数,例如取决于是否使用整个参考图像或只使用参考图像的一部分,例如当前块的区域附近的搜索窗口区域,来搜索最佳匹配参考块,和/或例如取决于是否执行半像素、四分之一像素和/或16分之一内插的像素内插。
除上述预测模式外,还可以采用跳过模式和/或直接模式。
例如,扩展合并预测,这个模式的合并候选列表由以下五个候选类型按顺序组成:来自空间相邻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以对角线划分和反对角线划分两种划分方式被均匀划分为两个三角形部分。此外,双向预测模式在简单平均的基础上进行了扩展,以支持两个预测信号的加权平均。
帧间预测单元244可包括运动估计(motion estimation,ME)单元和运动补偿(motion compensation,MC)单元(两者在图2中未示出)。运动估计单元可用于接收或获取图像块203(当前图像17的当前图像块203)和解码图像231,或至少一个或多个之前重建块,例如,一个或多个其它/不同之前解码图像231的重建块,来进行运动估计。例如,视频序列可包括当前图像和之前的解码图像231,或换句话说,当前图像和之前的解码图像231可以为形成视频序列的图像序列的一部分或形成该图像序列。
例如,编码器20可用于从多个其它图像中的同一或不同图像的多个参考块中选择参考块,并将参考图像(或参考图像索引)和/或参考块的位置(x、y坐标)与当前块的位置之间的偏移(空间偏移)作为帧间预测参数提供给运动估计单元。该偏移也称为运动矢量(motion vector,MV)。
运动补偿单元用于获取,例如接收,帧间预测参数,并根据或使用该帧间预测参数执行帧间预测,得到帧间预测块246。由运动补偿单元执行的运动补偿可能包含根据通过运动估计确定的运动/块矢量来提取或生成预测块,还可能包括对子像素精度执行内插。内插滤波可从已知像素的像素点中产生其它像素的像素点,从而潜在地增加可用于对图像块进行编码的候选预测块的数量。一旦接收到当前图像块的PU对应的运动矢量时,运动补偿单元可在其中一个参考图像列表中定位运动矢量指向的预测块。
运动补偿单元还可以生成与块和视频片相关的语法元素,以供视频解码器30在解码视频片的图像块时使用。此外,或者作为片和相应语法元素的替代,可以生成或使用编码区块组和/或编码区块以及相应语法元素。
在获取先进的运动矢量预测(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)。
得到上述候选运动矢量列表后,通过率失真代价(rate distortion cost,RD cost)从候选运动矢量列表中确定最优的MV,将RD cost最小的候选运动矢量作为当前块的运动矢量预测值(motion vector predictor,MVP)。率失真代价由以下公式计算获得:
J=SAD+λR
其中,J表示RD cost,SAD为使用候选运动矢量进行运动估计后得到的预测块的像素值与当前块的像素值之间的绝对误差和(sum of absolute differences,SAD),R表示码率,λ表示拉格朗日乘子。
编码端将确定出的MVP在候选运动矢量列表中的索引传递到解码端。进一步地,可以在MVP为中心的邻域内进行运动搜索获得当前块实际的运动矢量,编码端计算MVP与实际的运动矢量之间的运动矢量差值(motion vector difference,MVD),并将MVD也传递到解码端。解码端解析索引,根据该索引在候选运动矢量列表中找到对应的MVP,解析MVD,将MVD与MVP相加得到当前块实际的运动矢量。
在获取融合(Merge)模式中的候选运动信息列表的过程中,作为备选可以加入候选运动信息列表的运动信息包括当前块的空域相邻或时域相邻的图像块的运动信息,其中空域相邻的图像块和时域相邻的图像块可参照图4,候选运动信息列表中对应于空域的候选运动信息来自于空间相邻的5个块(A0、A1、B0、B1和B2),若空域相邻块不可得或者为帧内预测,则其运动信息不加入候选运动信息列表。当前块的时域的候选运动信息根据参考帧和当前帧的图序计数(picture order count,POC)对参考帧中对应位置块的MV进行缩放后获得,先判断参考帧中位置为T的块是否可得,若不可得则选择位置为C的块。得到上述候选运动信息列表后,通过RD cost从候选运动信息列表中确定最优的运动信息作为当前块的运动信息。编码端将最优的运动信息在候选运动信息列表中位置的索引值(记为merge index)传递到解码端。
熵编码
熵编码单元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传输或检索。
视频编码器20的其它结构变体可用于对视频流进行编码。例如,基于非变换的编码器20可以在某些块或帧没有变换处理单元206的情况下直接量化残差信号。在另一种实现方式中,编码器20可以具有组合成单个单元的量化单元208和反量化单元210。
解码器和解码方法
如图3所示,视频解码器30用于接收例如由编码器20编码的编码图像数据21(例如编码比特流21),得到解码图像331。编码图像数据或比特流包括用于解码所述编码图像数据的信息,例如表示编码视频片(和/或编码区块组或编码区块)的图像块的数据和相关的语法元素。
在图3的示例中,解码器30包括熵解码单元304、反量化单元310、逆变换处理单元312、重建单元314(例如求和器314)、环路滤波器320、解码图像缓冲器(DBP)330、模式应用单元360、帧间预测单元344和帧内预测单元354。帧间预测单元344可以为或包括运动补偿单元。在一些示例中,视频解码器30可执行大体上与参照图2的视频编码器100描述的编码过程相反的解码过程。
如编码器20所述,反量化单元210、逆变换处理单元212、重建单元214、环路滤波器220、解码图像缓冲器DPB230、帧间预测单元344和帧内预测单元354还组成视频编码器20的“内置解码器”。相应地,反量化单元310在功能上可与反量化单元110相同,逆变换处理单元312在功能上可与逆变换处理单元122相同,重建单元314在功能上可与重建单元214相同,环路滤波器320在功能上可与环路滤波器220相同,解码图像缓冲器330在功能上可与解码图像缓冲器230相同。因此,视频编码器20的相应单元和功能的解释相应地适用于视频解码器30的相应单元和功能。
熵解码
熵解码单元304用于解析比特流21(或一般为编码图像数据21)并对编码图像数据21执行熵解码,得到量化系数309和/或解码后的编码参数(图3中未示出)等,例如帧间预测参数(例如参考图像索引和运动矢量)、帧内预测参数(例如帧内预测模式或索引)、变换参数、量化参数、环路滤波器参数和/或其它语法元素等中的任一个或全部。熵解码单元304可用于应用编码器20的熵编码单元270的编码方案对应的解码算法或方案。熵解码单元304还可用于向模式应用单元360提供帧间预测参数、帧内预测参数和/或其它语法元素,以及向解码器30的其它单元提供其它参数。视频解码器30可以接收视频片和/或视频块级的语法元素。此外,或者作为片和相应语法元素的替代,可以接收或使用编码区块组和/或编码区块以及相应语法元素。
反量化
反量化单元310可用于从编码图像数据21(例如通过熵解码单元304解析和/或解码)接收量化参数(quantization parameter,QP)(或一般为与反量化相关的信息)和量化系数,并基于所述量化参数对所述解码的量化系数309进行反量化以获得反量化系数311,所述反量化系数311也可以称为变换系数311。反量化过程可包括使用视频编码器20为视频片中的每个视频块计算的量化参数来确定量化程度,同样也确定需要执行的反量化的程度。
逆变换
逆变换处理单元312可用于接收解量化系数311,也称为变换系数311,并对解量化系数311应用变换以得到像素域中的重建残差块213。重建残差块213也可称为变换块313。变换可以为逆变换,例如逆DCT、逆DST、逆整数变换或概念上类似的逆变换过程。逆变换处理单元312还可以用于从编码图像数据21(例如通过熵解码单元304解析和/或解码)接收变换参数或相应信息,以确定应用于解量化系数311的变换。
重建
重建单元314(例如,求和器314)用于将重建残差块313添加到预测块365,以在像素域中得到重建块315,例如,将重建残差块313的像素点值和预测块365的像素点值相加。
滤波
环路滤波器单元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可以实现为环后滤波器。
解码图像缓冲器
随后将一个图像中的解码视频块321存储在解码图像缓冲器330中,解码图像缓冲器330存储作为参考图像的解码图像331,参考图像用于其它图像和/或分别输出显示的后续运动补偿。
解码器30用于通过输出端312等输出解码图像311,向用户显示或供用户查看。
预测
帧间预测单元344在功能上可与帧间预测单元244(特别是运动补偿单元)相同,帧内预测单元354在功能上可与帧间预测单元254相同,并基于从编码图像数据21(例如通过熵解码单元304解析和/或解码)接收的分割和/或预测参数或相应信息决定划分或分割和执行预测。模式应用单元360可用于根据重建图像、块或相应的像素点(已滤波或未滤波)执行每个块的预测(帧内或帧间预测),得到预测块365。
当将视频片编码为帧内编码(intra coded,I)片时,模式应用单元360中的帧内预测单元354用于根据指示的帧内预测模式和来自当前图像的之前解码块的数据生成用于当前视频片的图像块的预测块365。当视频图像编码为帧间编码(即,B或P)片时,模式应用单元360中的帧间预测单元344(例如运动补偿单元)用于根据运动矢量和从熵解码单元304接收的其它语法元素生成用于当前视频片的视频块的预测块365。对于帧间预测, 可从其中一个参考图像列表中的其中一个参考图像产生这些预测块。视频解码器30可以根据存储在DPB 330中的参考图像,使用默认构建技术来构建参考帧列表0和列表1。除了片(例如视频片)或作为片的替代,相同或类似的过程可应用于编码区块组(例如视频编码区块组)和/或编码区块(例如视频编码区块)的实施例,例如视频可以使用I、P或B编码区块组和/或编码区块进行编码。
模式应用单元360用于通过解析运动矢量和其它语法元素,确定用于当前视频片的视频块的预测信息,并使用预测信息产生用于正在解码的当前视频块的预测块。例如,模式应用单元360使用接收到的一些语法元素确定用于编码视频片的视频块的预测模式(例如帧内预测或帧间预测)、帧间预测片类型(例如B片、P片或GPB片)、用于片的一个或多个参考图像列表的构建信息、用于片的每个帧间编码视频块的运动矢量、用于片的每个帧间编码视频块的帧间预测状态、其它信息,以解码当前视频片内的视频块。除了片(例如视频片)或作为片的替代,相同或类似的过程可应用于编码区块组(例如视频编码区块组)和/或编码区块(例如视频编码区块)的实施例,例如视频可以使用I、P或B编码区块组和/或编码区块进行编码。
在一个实施例中,图3的视频编码器30还可以用于使用片(也称为视频片)分割和/或解码图像,其中图像可以使用一个或多个片(通常为不重叠的)进行分割或解码。每个片可包括一个或多个块(例如CTU)或一个或多个块组(例如H.265/HEVC/VVC标准中的编码区块和VVC标准中的砖。
在一个实施例中,图3所示的视频解码器30还可以用于使用片/编码区块组(也称为视频编码区块组)和/或编码区块(也称为视频编码区块)对图像进行分割和/或解码,其中图像可以使用一个或多个片/编码区块组(通常为不重叠的)进行分割或解码,每个片/编码区块组可包括一个或多个块(例如CTU)或一个或多个编码区块等,其中每个编码区块可以为矩形等形状,可包括一个或多个完整或部分块(例如CTU)。
视频解码器30的其它变型可用于对编码图像数据21进行解码。例如,解码器30可以在没有环路滤波器单元320的情况下产生输出视频流。例如,基于非变换的解码器30可以在某些块或帧没有逆变换处理单元312的情况下直接反量化残差信号。在另一种实现方式中,视频解码器30可以具有组合成单个单元的反量化单元310和逆变换处理单元312。
应理解,在编码器20和解码器30中,可以对当前步骤的处理结果进一步处理,然后输出到下一步骤。例如,在插值滤波、运动矢量推导或环路滤波之后,可以对插值滤波、运动矢量推导或环路滤波的处理结果进行进一步的运算,例如裁剪(clip)或移位(shift)运算。
应该注意的是,可以对当前块的推导运动矢量(包括但不限于仿射模式的控制点运动矢量、仿射、平面、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限制运动矢量的方法。
尽管上述实施例主要描述了视频编解码,但应注意的是,译码系统10、编码器20和解码器30的实施例以及本文描述的其它实施例也可以用于静止图像处理或编解码,即视频编解码中独立于任何先前或连续图像的单个图像的处理或编解码。一般情况下,如果图像处理仅限于单个图像17,帧间预测单元244(编码器)和帧间预测单元344(解码器)可能不可用。视频编码器20和视频解码器30的所有其它功能(也称为工具或技术)同样可用于静态图像处理,例如残差计算204/304、变换206、量化208、反量化210/310、(逆)变换212/312、分割262/362、帧内预测254/354和/或环路滤波220/320、熵编码270和熵解码304。
请参考图5,图5为本申请实施例提供的视频译码设备500的一种示例性框图。视频译码设备500适用于实现本文描述的公开实施例。在一个实施例中,视频译码设备500可以是解码器,例如图1a中的视频解码器30,也可以是编码器,例如图1a中的视频编码器20。
视频译码设备500包括:用于接收数据的入端口510(或输入端口510)和接收单元(receiver unit,Rx)520;用于处理数据的处理器、逻辑单元或中央处理器(central processing unit,CPU)530;例如,这里的处理器530可以是神经网络处理器530;用于传输数据的发送单元(transmitter unit,Tx)540和出端口550(或输出端口550);用于存储数据的存储器560。视频译码设备500还可包括耦合到入端口510、接收单元520、发送单元540和出端口550的光电(optical-to-electrical,OE)组件和电光(electrical-to-optical,EO)组件,用于光信号或电信号的出口或入口。
处理器530通过硬件和软件实现。处理器530可实现为一个或多个处理器芯片、核(例如,多核处理器)、FPGA、ASIC和DSP。处理器530与入端口510、接收单元520、发送单元540、出端口550和存储器560通信。处理器530包括译码模块570(例如,基于神经网络的译码模块570)。译码模块570实施上文所公开的实施例。例如,译码模块570执行、处理、准备或提供各种编码操作。因此,通过译码模块570为视频译码设备500的功能提供了实质性的改进,并且影响了视频译码设备500到不同状态的切换。或者,以存储在存储器560中并由处理器530执行的指令来实现译码模块570。
存储器560包括一个或多个磁盘、磁带机和固态硬盘,可以用作溢出数据存储设备,用于在选择执行程序时存储此类程序,并且存储在程序执行过程中读取的指令和数据。存储器560可以是易失性和/或非易失性的,可以是只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、三态内容寻址存储器(ternary content-addressable memory,TCAM)和/或静态随机存取存储器(static random-access memory,SRAM)。
请参考图6,图6为本申请实施例提供的装置600的一种示例性框图,装置600可用作图1a中的源设备12和目的设备14中的任一个或两个。
装置600中的处理器602可以是中央处理器。或者,处理器602可以是现有的或今后将研发出的能够操控或处理信息的任何其它类型设备或多个设备。虽然可以使用如图所示的处理器602等单个处理器来实施已公开的实现方式,但使用一个以上的处理器速度更快和效率更高。
在一种实现方式中,装置600中的存储器604可以是只读存储器(ROM)设备或随 机存取存储器(RAM)设备。任何其它合适类型的存储设备都可以用作存储器604。存储器604可以包括处理器602通过总线612访问的代码和数据606。存储器604还可包括操作系统608和应用程序610,应用程序610包括允许处理器602执行本文所述方法的至少一个程序。例如,应用程序610可以包括应用1至N,还包括执行本文所述方法的视频译码应用。
装置600还可以包括一个或多个输出设备,例如显示器618。在一个示例中,显示器618可以是将显示器与可用于感测触摸输入的触敏元件组合的触敏显示器。显示器618可以通过总线612耦合到处理器602。
虽然装置600中的总线612在本文中描述为单个总线,但是总线612可以包括多个总线。此外,辅助储存器可以直接耦合到装置600的其它组件或通过网络访问,并且可以包括存储卡等单个集成单元或多个存储卡等多个单元。因此,装置600可以具有各种各样的配置。
由于本申请实施例涉及神经网络的应用,为了便于理解,下面先对本申请实施例所使用到的一些名词或术语进行解释说明,该名词或术语也作为发明内容的一部分。
(1)神经网络
神经网络(neural network,NN)是机器学习模型,神经网络可以是由神经单元组成的,神经单元可以是指以xs和截距1为输入的运算单元,该运算单元的输出可以为:
Figure PCTCN2022109485-appb-000001
其中,s=1、2、……n,n为大于1的自然数,Ws为xs的权重,b为神经单元的偏置。f为神经单元的激活函数(activation functions),用于将非线性特性引入神经网络中,来将神经单元中的输入信号转换为输出信号。该激活函数的输出信号可以作为下一层卷积层的输入。激活函数可以是sigmoid函数。神经网络是将许多个上述单一的神经单元联结在一起形成的网络,即一个神经单元的输出可以是另一个神经单元的输入。每个神经单元的输入可以与前一层的局部接受域相连,来提取局部接受域的特征,局部接受域可以是由若干个神经单元组成的区域。
(2)深度神经网络
深度神经网络(deep neural network,DNN),也称多层神经网络,可以理解为具有很多层隐含层的神经网络,这里的“很多”并没有特别的度量标准。从DNN按不同层的位置划分,DNN内部的神经网络可以分为三类:输入层,隐含层,输出层。一般来说第一层是输入层,最后一层是输出层,中间的层数都是隐含层。层与层之间是全连接的,也就是说,第i层的任意一个神经元一定与第i+1层的任意一个神经元相连。虽然DNN看起来很复杂,但是就每一层的工作来说,其实并不复杂,简单来说就是如下线性关系表达式:
Figure PCTCN2022109485-appb-000002
其中,
Figure PCTCN2022109485-appb-000003
是输入向量,
Figure PCTCN2022109485-appb-000004
是输出向量,
Figure PCTCN2022109485-appb-000005
是偏移向量,W是权重矩阵(也称系数),α()是激活函数。每一层仅仅是对输入向量
Figure PCTCN2022109485-appb-000006
经过如此简单的操作得到输出向量
Figure PCTCN2022109485-appb-000007
由于DNN层数多,则系数W和偏移向量
Figure PCTCN2022109485-appb-000008
的数量也就很多了。这些参数在DNN中的定义如下所述:以系数W为例:假设在一个三层的DNN中,第二层的第4个神经元到第三层的第2个神经元的线性系数定义为
Figure PCTCN2022109485-appb-000009
上标3代表系数W所在的层数,而下标对应的是输出的第三层索引2和输入的第二层索引4。总结就是:第L-1层的第k个神经元到第L层的第j个神经元的系数定义为
Figure PCTCN2022109485-appb-000010
需要注意的是,输入层是没有W参数的。在深度神经 网络中,更多的隐含层让网络更能够刻画现实世界中的复杂情形。理论上而言,参数越多的模型复杂度越高,“容量”也就越大,也就意味着它能完成更复杂的学习任务。训练深度神经网络的也就是学习权重矩阵的过程,其最终目的是得到训练好的深度神经网络的所有层的权重矩阵(由很多层的向量W形成的权重矩阵)。
(3)卷积神经网络
卷积神经网络(convolutional neuron network,CNN)是一种带有卷积结构的深度神经网络,是一种深度学习(deep learning)架构,深度学习架构是指通过机器学习的算法,在不同的抽象层级上进行多个层次的学习。作为一种深度学习架构,CNN是一种前馈(feed-forward)人工神经网络,该前馈人工神经网络中的各个神经元可以对输入其中的图像作出响应。卷积神经网络包含了一个由卷积层和池化层构成的特征抽取器。该特征抽取器可以看作是滤波器,卷积过程可以看作是使用一个可训练的滤波器与一个输入的图像或者卷积特征平面(feature map)做卷积。
卷积层是指卷积神经网络中对输入信号进行卷积处理的神经元层。卷积层可以包括很多个卷积算子,卷积算子也称为核,其在图像处理中的作用相当于一个从输入图像矩阵中提取特定信息的过滤器,卷积算子本质上可以是一个权重矩阵,这个权重矩阵通常被预先定义,在对图像进行卷积操作的过程中,权重矩阵通常在输入图像上沿着水平方向一个像素接着一个像素(或两个像素接着两个像素……这取决于步长stride的取值)的进行处理,从而完成从图像中提取特定特征的工作。该权重矩阵的大小应该与图像的大小相关,需要注意的是,权重矩阵的纵深维度(depth dimension)和输入图像的纵深维度是相同的,在进行卷积运算的过程中,权重矩阵会延伸到输入图像的整个深度。因此,和一个单一的权重矩阵进行卷积会产生一个单一纵深维度的卷积化输出,但是大多数情况下不使用单一权重矩阵,而是应用多个尺寸(行×列)相同的权重矩阵,即多个同型矩阵。每个权重矩阵的输出被堆叠起来形成卷积图像的纵深维度,这里的维度可以理解为由上面所述的“多个”来决定。不同的权重矩阵可以用来提取图像中不同的特征,例如一个权重矩阵用来提取图像边缘信息,另一个权重矩阵用来提取图像的特定颜色,又一个权重矩阵用来对图像中不需要的噪点进行模糊化等。该多个权重矩阵尺寸(行×列)相同,经过该多个尺寸相同的权重矩阵提取后的特征图的尺寸也相同,再将提取到的多个尺寸相同的特征图合并形成卷积运算的输出。这些权重矩阵中的权重值在实际应用中需要经过大量的训练得到,通过训练得到的权重值形成的各个权重矩阵可以用来从输入图像中提取信息,从而使得卷积神经网络进行正确的预测。当卷积神经网络有多个卷积层的时候,初始的卷积层往往提取较多的一般特征,该一般特征也可以称之为低级别的特征;随着卷积神经网络深度的加深,越往后的卷积层提取到的特征越来越复杂,比如高级别的语义之类的特征,语义越高的特征越适用于待解决的问题。
由于常常需要减少训练参数的数量,因此卷积层之后常常需要周期性的引入池化层,可以是一层卷积层后面跟一层池化层,也可以是多层卷积层后面接一层或多层池化层。在图像处理过程中,池化层的唯一目的就是减少图像的空间大小。池化层可以包括平均池化算子和/或最大池化算子,以用于对输入图像进行采样得到较小尺寸的图像。平均池化算子可以在特定范围内对图像中的像素值进行计算产生平均值作为平均池化的结果。最大池化算子可以在特定范围内取该范围内值最大的像素作为最大池化的结果。另外,就像卷积 层中用权重矩阵的大小应该与图像尺寸相关一样,池化层中的运算符也应该与图像的大小相关。通过池化层处理后输出的图像尺寸可以小于输入池化层的图像的尺寸,池化层输出的图像中每个像素点表示输入池化层的图像的对应子区域的平均值或最大值。
在经过卷积层/池化层的处理后,卷积神经网络还不足以输出所需要的输出信息。因为如前所述,卷积层/池化层只会提取特征,并减少输入图像带来的参数。然而为了生成最终的输出信息(所需要的类信息或其他相关信息),卷积神经网络需要利用神经网络层来生成一个或者一组所需要的类的数量的输出。因此,在神经网络层中可以包括多层隐含层,该多层隐含层中所包含的参数可以根据具体的任务类型的相关训练数据进行预先训练得到,例如该任务类型可以包括图像识别,图像分类,图像超分辨率重建等等。
可选的,在神经网络层中的多层隐含层之后,还包括整个卷积神经网络的输出层,该输出层具有类似分类交叉熵的损失函数,具体用于计算预测误差,一旦整个卷积神经网络的前向传播完成,反向传播就会开始更新前面提到的各层的权重值以及偏差,以减少卷积神经网络的损失,及卷积神经网络通过输出层输出的结果和理想结果之间的误差。
(4)循环神经网络
循环神经网络(recurrent neural networks,RNN)是用来处理序列数据的。在传统的神经网络模型中,是从输入层到隐含层再到输出层,层与层之间是全连接的,而对于每一层层内之间的各个节点是无连接的。这种普通的神经网络虽然解决了很多难题,但是却仍然对很多问题却无能无力。例如,你要预测句子的下一个单词是什么,一般需要用到前面的单词,因为一个句子中前后单词并不是独立的。RNN之所以称为循环神经网络,即一个序列当前的输出与前面的输出也有关。具体的表现形式为网络会对前面的信息进行记忆并应用于当前输出的计算中,即隐含层本层之间的节点不再无连接而是有连接的,并且隐含层的输入不仅包括输入层的输出还包括上一时刻隐含层的输出。理论上,RNN能够对任何长度的序列数据进行处理。对于RNN的训练和对传统的CNN或DNN的训练一样。同样使用误差反向传播算法,不过有一点区别:即,如果将RNN进行网络展开,那么其中的参数,如W,是共享的;而如上举例上述的传统神经网络却不是这样。并且在使用梯度下降算法中,每一步的输出不仅依赖当前步的网络,还依赖前面若干步网络的状态。该学习算法称为基于时间的反向传播算法(Back propagation Through Time,BPTT)。
既然已经有了卷积神经网络,为什么还要循环神经网络?原因很简单,在卷积神经网络中,有一个前提假设是:元素之间是相互独立的,输入与输出也是独立的,比如猫和狗。但现实世界中,很多元素都是相互连接的,比如股票随时间的变化,再比如一个人说了:我喜欢旅游,其中最喜欢的地方是云南,以后有机会一定要去。这里填空,人类应该都知道是填“云南”。因为人类会根据上下文的内容进行推断,但如何让机器做到这一步?RNN就应运而生了。RNN旨在让机器像人一样拥有记忆的能力。因此,RNN的输出就需要依赖当前的输入信息和历史的记忆信息。
(5)损失函数
在训练深度神经网络的过程中,因为希望深度神经网络的输出尽可能的接近真正想要预测的值,所以可以通过比较当前网络的预测值和真正想要的目标值,再根据两者之间的差异情况来更新每一层神经网络的权重向量(当然,在第一次更新之前通常会有初始化的过程,即为深度神经网络中的各层预先配置参数),比如,如果网络的预测值高了,就调 整权重向量让它预测低一些,不断的调整,直到深度神经网络能够预测出真正想要的目标值或与真正想要的目标值非常接近的值。因此,就需要预先定义“如何比较预测值和目标值之间的差异”,这便是损失函数(loss function)或目标函数(objective function),它们是用于衡量预测值和目标值的差异的重要方程。其中,以损失函数举例,损失函数的输出值(loss)越高表示差异越大,那么深度神经网络的训练就变成了尽可能缩小这个loss的过程。
(6)反向传播算法
卷积神经网络可以采用误差反向传播(back propagation,BP)算法在训练过程中修正初始的超分辨率模型中参数的大小,使得超分辨率模型的重建误差损失越来越小。具体地,前向传递输入信号直至输出会产生误差损失,通过反向传播误差损失信息来更新初始的超分辨率模型中参数,从而使误差损失收敛。反向传播算法是以误差损失为主导的反向传播运动,旨在得到最优的超分辨率模型的参数,例如权重矩阵。
(7)生成式对抗网络
生成式对抗网络(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,它可以用来生成图片。
图7a为本申请实施例提供的一个应用场景的示意图,如图7a所示,该应用场景是设备获取数据,对获取到的数据进行压缩处理,之后存储压缩数据。该设备可以集成有前述源设备和目的设备的功能。
1、设备获取数据。
2、设备对数据进行压缩处理得到压缩数据。
3、设备存储压缩数据。
应当理解的,设备对数据进行压缩处理是为了节省存储空间。可选地,设备可以将压缩数据存储在相册或云相册。
4、设备对压缩数据进行解压缩以得到数据。
图7b为本申请实施例提供的一个应用场景的示意图,如图7b所示,该应用场景是源设备获取数据,对获取到的数据进行压缩处理得到压缩数据,之后向目的设备发送压缩数 据。
本申请实施例中,源设备可以对获取到的数据进行压缩处理后传输给目的设备,这样可以减少传输带宽。
1、源设备获取数据。
2、源设备对数据进行压缩处理得到压缩数据。
3、源设备向目的设备发送压缩数据。
源设备对数据进行压缩处理后再传输,可以减少传输带宽,提高传输效率。
4、目的设备对压缩数据进行解压缩以得到数据。
请参考图8,图8为本申请实施例提供的编解码方法800的流程图。编解码方法800可由编码器和解码器执行。编解码方法800描述为一系列的步骤或操作,应当理解的是,编解码方法800可以以各种顺序执行和/或同时发生,不限于图8所示的执行顺序。如图8所示,编解码方法800可以包括:
步骤801、编码器获取待编码数据。
示例性地,编码器获取待编码数据x。
步骤802、编码器将待编码数据输入第一编码网络以得到目标参数。
其中,目标参数可以为第二编码网络的全部或部分卷积和非线性激活的参数权重。
可选地,第一编码网络可以包括卷积核生成器(卷积或者全连接组),卷积核生成器用于根据待编码数据生成目标参数。
示例性地,编码器将待编码数据x输入第一编码网络以得到目标参数θ g
步骤803、编码器根据目标参数构建第二编码网络。
示例性地,编码器根据目标参数θ g构建第二编码网络g a(x;θ g)。
步骤804、编码器将待编码数据输入第二编码网络以得到第一特征。
其中,第一特征用于重构待编码数据,第一特征也可以称为内容特征。例如,第一特征可以为待编码数据x的三维特征图。
示例性地,编码器将待编码数据x输入第二编码网络g a(x;θ g)以得到第一特征y。其中,y满足y=g a(x;θ g)。
步骤805、编码器对第一特征进行编码得到编码码流(即待解码码流)。
在一种可能的实现方式中,编码器对第一特征进行编码得到编码码流,可以包括:编码器先对第一特征进行取整以得到第一特征的取整值;然后编码器对第一特征的取整值进行概率估计以得到第一特征的取整值的估计概率分布;接着编码器根据第一特征的取整值的估计概率分布对第一特征的取整值进行熵编码以得到编码码流。其中,第一特征的取整值可以称为第一取值特征或内容取整特征。
示例性地,编码器先对第一特征y进行取整以得到第一特征的取整值
Figure PCTCN2022109485-appb-000011
然后编码器对第一特征的取整值
Figure PCTCN2022109485-appb-000012
进行概率估计以得到第一特征的取整值的估计概率分布
Figure PCTCN2022109485-appb-000013
接着编码器根据第一特征的取整值的估计概率分布
Figure PCTCN2022109485-appb-000014
对第一特征的取整值
Figure PCTCN2022109485-appb-000015
进行熵编码以得到编码码流。
其中,
Figure PCTCN2022109485-appb-000016
满足
Figure PCTCN2022109485-appb-000017
round为取整。
Figure PCTCN2022109485-appb-000018
满足
Figure PCTCN2022109485-appb-000019
为熵估计网络。
可选地,编码器对第一特征的取整值进行概率估计以得到第一特征的取整值的估计概率分布,可以包括:编码器根据第一信息对第一特征的取整值进行概率估计以得到所述第 一特征的取整值的估计概率分布。其中,第一信息包括上下文信息和边信息中的至少一项。
值得一提的是,通过上下文信息和边信息进行估计概率分布,能够提高得到的估计概率分布的准确性,从而减小熵编码过程中的码率,实现减小熵编码开销。
步骤806、编码器向解码器发送编码码流。
步骤807、解码器对编码码流进行解码得到第一特征的取整值。
在一种可能的实现方式中,解码器对编码码流进行解码得到第一特征的取整值,可以包括:解码器先对编码码流中的第一特征的取整值进行概率估计以得到第一特征的取整值的估计概率分布;然后解码器根据第一特征的取整值的估计概率分布对编码码流进行熵解码以得到第一特征的取整值。
步骤808、解码器将第一特征的取整值输入解码网络以得到解码数据。
示例性地,解码器将第一特征的取整值
Figure PCTCN2022109485-appb-000020
输入解码网络
Figure PCTCN2022109485-appb-000021
得到解码数据
Figure PCTCN2022109485-appb-000022
其中,解码数据
Figure PCTCN2022109485-appb-000023
满足
Figure PCTCN2022109485-appb-000024
为解码网络的全部卷积或部分卷积和非线性激活的参数权重。
现有编码方法中编码网络(即第二编码网络)采用固定的参数权重提取待编码数据的内容特征(即第一特征),然后将内容特征编码为码流(即编码码流)发送至解码端,解码端对码流进行解码重构得到解码数据。可以看出,现有技术中编码网络的参数权重与待编码数据不相关。而本申请实施例提供的编码方法中,先将待编码数据输入到第一编码网络,然后第一编码网络根据待编码数据生成第二编码网络的参数权重,然后根据得到的权重动态调整第二编码网络的参数权重,使第二编码网络的参数权重与待编码数据相关,增加了第二编码网络的表达能力,使解码端通过第一特征编码得到码流解码重构出的解码数据与待编码数据更加接近,从而提升了编解码网络的率失真性能。
本申请实施例提供的编解码方法800可适用于图9所示的编解码系统。如图9所示,该编解码系统包括第一编码网络901、第二编码网络902、取整模块903、熵估计网络904、熵编码模块905、熵解码模块906、解码网络907。
如图9所示,待编码数据先输入到第一编码网络901中以得到目标参数,然后通过目标参数调整第二编码网络902的参数(即通过目标参数调整第二编码网络902的全部卷积或部分卷积和非线性激活的参数权重)。
待编码数据输入到第二编码网络902中以得到第一特征。
取整模块903对第一特征进行取整得到第一特征的取整值。
熵估计网络904对第一特征的取整值进行概率估计以得到第一特征的取整值的估计概率分布。
熵编码模块905根据第一特征的取整值的估计概率分布对第一特征的取整值进行熵编码以得到编码码流。
熵解码模块906根据第一特征的取整值的估计概率分布对编码码流进行熵解码以得到第一特征的取整值。
将第一特征的取整值输入解码网络907以得到解码数据。
请参考图10,图10为本申请实施例提供的编解码方法1000的流程图。编解码方法1000可由编码器和解码器执行。编解码方法1000描述为一系列的步骤或操作,应当理解的是,编解码方法1000可以以各种顺序执行和/或同时发生,不限于图10所示的执行顺 序。如图10所示,编解码方法1000可以包括:
步骤1001、编码器获取待编码数据。
步骤1002、编码器将待编码数据输入第二编码网络以得到第一特征。
其中,第一特征用于重构待编码数据。
步骤1003、编码器将待编码数据输入第一编码网络以得到第二特征。
其中,第二特征用于重构目标参数,第二特征也可称为模型特征,目标参数为第二解码网络的全部卷积或部分卷积和非线性激活的参数权重。
在一种可能的实现方式中,编码器也先可以将第一特征从通道维度上分为两部分(第一子特征和第二子特征),一部分用于重构待编码数据(第一子特征),另一部分用于重构目标参数(第二子特征)。然后编码器将第二子特征输入第一编码网络以得到第二特征。
可选地,为了使得第二特征能够以较小的码流压缩,在将第二子特征输入第三编码网络之前还可以对通过卷积和全连接网络对第二子特征进行转换。其中,转换前的第二子特征可称为初始模型特征,转换后的第二子特征可称为模型特征。
步骤1004、编码器对第一特征进行编码得到第一待解码码流。
步骤1005、编码器对第二特征进行编码得到第二待解码码流。
在一种可能的实现方式中,编码器可以对第一特征和第二特征进行编码得到待解码码流。
步骤1006、编码器向解码器发送第一待解码码流和第二待解码码流。
步骤1007、解码器对第一待解码码流进行解码得到第一特征的取整值。
在一种可能的实现方式中,解码器对第一待解码码流进行解码得到第一特征的取整值可以包括:解码器对第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;根据所述待第一特征的取整值的估计概率分布对所述待解码码流进行熵解码以得到所述第一特征的取整值。
在一种可能的实现方式中,上述对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,包括:根据第一信息对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
步骤1008、解码器对第二待解码码流进行解码得到第二特征的取整值。
其中,第二特征的取整值也可称为模型取整特征。
在一种可能的实现方式中,解码器对第二待解码码流进行解码得到第二特征的取整值,包括:解码器对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布;根据所述第二特征的取整值的估计概率分布对所述第二待解码码流进行熵解码以得到所述第二特征的取整值。
在一种可能的实现方式中,上述对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布,包括:根据第一信息对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
步骤1009、解码器将第二特征的取整值输入第一解码网络以得到目标参数。
步骤1010、解码器根据目标参数构建第二解码网络。
步骤1011、解码器将第一特征的取整值输入第二解码网络以得到解码数据。
现有解码方法中解码网络(即第二解码网络)采用固定的参数权重对待编码数据的内容取值特征(即第一特征的取整值)进行解码重构得到解码数据。可以看出,现有技术中解码网络的参数权重与待解码数据不相关。而本申请实施例中将待解码数据的内容特征和模型特征(即第一特征和第二特征)编成待解码码流,然后解码端通过解码待解码码流得到第二特征的取整值,通过将第二特征的取整值输入第一解码网络以得到第二解码网络的参数权重,然后根据该参数权重动态调整第二解码网络的参数权重,使第二解码网络的参数权重与待解码数据相关,提升了第二解码网络的表达能力,使第二解码网络解码重构得到的解码数据与待编码数据更加接近,从而提升了编解码网络的率失真性能。
本申请实施例提供的编解码方法1000可适用于图11所述的编解码系统。如图11所示,该编解码系统包括第一编码网络1101、第二编码网络1102、第一取整模块1103、第二取整模块1104、熵估计网络1105、第一熵编码模块1106、第二熵编码模块1107、第一熵解码模块1108、第二熵解码模块1109、第一解码网络1110、第二解码网络1111。
如图11所示,待编码数据先输入到第二编码网络1102中以得到第一特征,然后待编码数据输入到第一编码网络1101中以得到第二特征。
第一取整模块1103对第一特征进行取整得到第一特征的取整值。
第二取整模块1104对第二特征进行取整得到第二特征的取整值。
熵估计网络1105先对第一特征的取整值进行概率估计以得到第一特征的取整值的估计概率分布,然后对第二特征的取整值进行概率估计以得到第二特征的取整值的估计概率分布。
第一熵编码模块1106根据第一特征的取整值的估计概率分布对第一特征的取整值进行熵编码以得到第一待解码码流。
第二熵编码模块1107根据第二特征的取整值的估计概率分布对第二特征的取整值进行熵编码以得到第二待解码码流。
第一熵解码模块1108根据第一特征的取整值的估计概率分布对第一待解码码流进行熵解码以得到第一特征的取整值。
第二熵解码模块1109根据第二特征的取整值的估计概率分布对第二待解码码流进行熵解码以得到第二特征的取整值。
第二特征的取整值先输入第一解码网络1110中以得到目标参数,然后根据目标参数调整第二解码网络1111的参数(即通过目标参数调整第二解码网络1111的全部卷积或部分卷积和非线性激活的参数权重)。
第一特征的取整值输入到第二解码网络1111中以得到解码数据。
本申请实施例提供的编解码方法1000也可适用于图12所述的编解码系统。如图12所示,该编解码系统包括第一编码网络1201、第二编码网络1202、分通道模块1203、第一取整模块1204、第二取整模块1205、熵估计网络1206、第一熵编码模块1207、第二熵编码模块1208、第一熵解码模块1209、第二熵解码模块1210、第一解码网络1211、第二解码网络1212。
如图12所示,待编码数据先输入到第二编码网络1102中以得到第一特征。
第一特征输入到分通道模块1203中在通道维度上分为第一子特征和第二子特征。
第二子特征输入到第一编码网络1201中以得到第二特征。
第一取整模块1204对第一子特征进行取整得到第一特征的取整值。
第二取整模块1205对第二特征进行取整得到第二特征的取整值。
熵估计网络1206先对第一特征的取整值进行概率估计以得到第一特征的取整值的估计概率分布,然后对第二特征的取整值进行概率估计以得到第二特征的取整值的估计概率分布。
第一熵编码模块1207根据第一特征的取整值的估计概率分布对第一特征的取整值进行熵编码以得到第一待解码码流。
第二熵编码模块1208根据第二特征的取整值的估计概率分布对第二特征的取整值进行熵编码以得到第二待解码码流。
第一熵解码模块1209根据第一特征的取整值的估计概率分布对第一待解码码流进行熵解码以得到第一特征的取整值。
第二熵解码模块1210根据第二特征的取整值的估计概率分布对第二待解码码流进行熵解码以得到第二特征的取整值。
第二特征的取整值先输入第一解码网络1211中以得到目标参数,然后根据目标参数调整第二解码网络1212的参数(即通过目标参数调整第二解码网络1212的全部卷积或部分卷积和非线性激活的参数权重)。
第一特征的取整值输入到第二解码网络1212中以得到解码数据。
请参考图13,图13为本申请实施例提供的编解码方法1300的流程图。编解码方法1300可由编码器和解码器执行。编解码方法1300描述为一系列的步骤或操作,应当理解的是,编解码方法1300可以以各种顺序执行和/或同时发生,不限于图13所示的执行顺序。如图13所示,编解码方法1300可以包括:
步骤1301、编码器获取待编码数据。
步骤1302、编码器将待编码数据输入编码网络以得到第一特征。
步骤1303、编码器对第一特征进行编码得到待解码码流。
步骤1304、编码器向解码器发送待解码码流。
步骤1305、解码器对待解码码流进行解码得到第一特征的取整值。
在一种可能的实现方式中,解码器对待解码码流进行解码得到第一特征的取整值可以包括:解码器对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;根据所述待第一特征的取整值的估计概率分布对所述待解码码流进行熵解码以得到所述第一特征的取整值。
在一种可能的实现方式中,对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,包括:根据第一信息对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
步骤1306、解码器将第一特征的取整值输入第一解码网络以得到目标参数。
可选地,第一解码网络可以包括卷积核生成器(卷积或者全连接组),卷积核生成器用于根据待编码数据的第一特征的取整值生成目标参数。
步骤1307、解码器根据目标参数构建第二解码网络。
步骤1308、解码器将第一特征的取整值输入第二解码网络以得到解码数据。
现有解码方法中解码网络(即第二解码网络)采用固定的参数权重对待编码数据的内容取值特征(即第一特征的取整值)进行解码重构得到解码数据。可以看出,现有技术中解码网络的参数权重与待解码数据不相关。而本申请实施例中通过解码待解码数据的特征(即第一特征)编码成的待解码码流得到第一特征的取整值,通过将第一特征的取整值输入第一解码网络以得到第二解码网络的参数权重,然后根据该参数权重动态调整第二解码网络的参数权重,使第二解码网络的参数权重与待解码数据相关,提升了第二解码网络的表达能力,使第二解码网络解码重构得到的解码数据与待编码数据更加接近,从而提升了编解码网络的率失真性能。
本申请实施例提供的编解码方法1300可适用于图14所述的编解码系统。如图14所示,该编解码系统包括编码网络1401、取整模块1402、熵估计网络1403、熵编码模块1404、熵解码模块1405、第一解码网络1406、第二解码网络1407。
如图14所示,待编码数据先输入到编码网络1401中以得到第一特征。
取整模块1402对第一特征进行取整得到第一特征的取整值。
熵估计网络1403对第一特征的取整值进行概率估计以得到第一特征的取整值的估计概率分布。
熵编码模块1404根据第一特征的取整值的估计概率分布对第一特征的取整值进行熵编码以得到待解码码流。
熵解码模块1405根据第一特征的取整值的估计概率分布对待解码码流进行熵解码以得到第一特征的取整值。
将第一特征的取整值输入第一解码网络1406以得到目标参数,然后根据目标参数调整第二解码网络1406的参数(即通过目标参数调整第二解码网络1407的全部卷积或部分卷积和非线性激活的参数权重)。
将第一特征的取整值输入第二解码网络1407以得到解码数据。
请参考图15,图15为本申请实施例提供的编解码方法的性能的一种示意图,图15中的坐标系示出了在峰值信噪比(Peak Signal to Noise Ratio,PSNR)指标下采用本申请实施例以及相关技术分别对测试集进行编解码的性能。测试集为柯达(Kodak)测试集,Kodak测试集包括24张便携式网络图形(Portable Network Graphics,PNG)格式的图像。该24张图像的分辨率可以为768×512或512×768。图15的坐标系中,横坐标为比特率(bits per pixel,BPP),纵坐标为PSNR。BPP为存储每个像素所用的位数,越小代表压缩码率越小。PSNR是一种评价图像的客观标准,越高代表图像质量越好。
图15所示的坐标系中的线段A表示本申请实施例,线段B表示相关技术。由图15可以看出,在BPP指标相同的情况下本申请实施例的PSNR指标均高于相关技术,在图片压缩质量相同(即PSNR指标)相同的情况下本申请实施例的BPP指标均小于相关技术,由此可知本申请实施例的率失真性能高于相关技术,本申请实施例能够提高数据编解码方法的率失真性能。
本申请实施例提供的编解码方法可应用的场景包括但不限于:电子设备、云服务、视频监控中涉及图像、视频、语音等数据的采集、存储、传输的所有业务。(如电子设备拍照视频语音、相册、云相册、视频监控、视频会议、模型压缩等)。
图16为本申请实施例提供的一个应用场景的示意图,如图16所示,该应用场景中电子设备拍摄得到图像数据(待压缩数据)后,将拍摄得到的图像数据(如RAW、YUV格式、RGB格式的图像数据)输入电子设备的AI编码单元中。电子设备的AI编码单元调用第一编码网络、第二编码网络和熵估计网络将图像数据变换成冗余度更低的输出特征且产生输出特征的估计概率分布。电子设备的算术编码单元调用熵编码模块根据输出特征的估计概率分布将输出特征编码为数据文件。保存文件单元将熵编码模块生成的数据文件保存至电子设备的对应存储位置。电子设备在需要使用该数据文件时,通过加载文件单元从电子设备的对应存储位置加载数据文件,并输入到算术解码单元中,算术解码单元调用熵解码模块解码数据文件得到输出特征,并将输出特征输入到AI解码单元,AI解码单元调用第一解码网络、第二解码网络和第三解码网络对输出特征进行反变换,将输出特征解析为图像数据(如RGB图像数据)即压缩数据。其中,AI编码单元和AI解码单元可以部署在电子设备的神经网络处理器(neuralnetwork processing unit,NPU或图形处理器(graphics processing unit,GPU)中。算术编码单元、保存文件单元、加载文件单元、算术解码单元可以部署在电子设备的CPU中。
图17为本申请实施例提供的另一个应用场景的示意图,如图17所示,该应用场景中电子设备将存储的图片数据(待压缩数据)直接上传或编码(如JPEG编码)后上传至云侧(如服务器),云侧将收到的图片数据直接输入或解码(如JPEG解码)后输入云侧的AI编码单元中云侧的AI编码单元调用第一编码网络、第二编码网络和熵估计网络将图像数据变换成冗余度更低的输出特征且产生输出特征的估计概率分布。云侧的算术编码单元调用熵编码模块根据输出特征的估计概率分布将输出特征编码为数据文件。保存文件单元将熵编码模块生成的数据文件保存至云侧的对应存储位置。电子设备在需要使用该数据文件时向云侧发送下载请求,云侧在收到下载请求后,通过加载文件单元从云侧的对应存储位置加载数据文件,并输入到算术解码单元中,算术解码单元调用熵解码模块解码数据文件得到输出特征,并将输出特征输入到AI解码单元,AI解码单元调用第一解码网络、第二解码网络和第三解码网络对输出特征进行反变换,将输出特征解析为图像数据。云端将该图像数据(压缩数据)直接发送或编码后发送至电子设备。
下面将结合图18和图19介绍用于执行上述编解码方法的编解码装置。
可以理解的是,编解码装置为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例可以根据上述方法示例对编解码装置进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
在采用对应各个功能划分各个功能模块的情况下,图18示出了上述实施例中涉及的编解码装置的一种可能的组成示意图,如图18所示,该装置1800可以包括:收发单元 1801和处理单元1802,该处理单元1802可以实现上述方法实施例中由编码装置、解码装置、编码器或解码器所执行的方法,和/或用于本文所描述的技术的其他过程。
需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
在采用集成的单元的情况下,装置1800可以包括处理单元、存储单元和通信单元。其中,处理单元可以用于对装置1800的动作进行控制管理,例如,可以用于支持装置1800执行上述各个单元执行的步骤。存储单元可以用于支持装置1800执行存储程序代码、和/或数据等。通信单元可以用于支持装置1800与其他设备的通信。
其中,处理单元可以是处理器或控制器。其可以实现或执行结合本申请公开内容所描述的各种示例性地逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理(digital signal processing,DSP)和微处理器的组合等等。存储单元可以是存储器。通信单元具体可以为射频电路、蓝牙芯片、Wi-Fi芯片等与其他电子设备交互的设备。
在一种可能的实现方式中,本申请实施例所涉及的编解码装置可以为具有图19所示结构的装置1900,该装置1900包括处理器1901和收发器1902。图18中的收发单元1801和处理单元1802所实现的相关功能可以由处理器1901来实现。
可选地,该装置1900还可以包括存储器1903,该处理器1901和该存储器1903通过内部连接通路互相通信。图18中的存储单元所实现的相关功能可以由存储器1903来实现。
本申请实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的编解码方法。
本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的编解码方法。
本申请实施例还提供一种编解码装置,这个装置具体可以是芯片、集成电路、组件或模块。具体的,该装置可包括相连的处理器和用于存储指令的存储器,或者该装置包括至少一个处理器,用于从外部存储器获取指令。当装置运行时,处理器可执行指令,以使芯片执行上述各方法实施例中的编解码方法。
图20示出了一种芯片2000的结构示意图。芯片2000包括一个或多个处理器2001以及接口电路2002。可选的,上述芯片2000还可以包含总线2003。
处理器2001可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述编码方法的各步骤可以通过处理器2001中的硬件的集成逻辑电路或者软件形式的指令完成。
可选地,上述的处理器2001可以是通用处理器、数字信号处理(digital signal proce ssing,DSP)器、集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
接口电路2002可以用于数据、指令或者信息的发送或者接收,处理器2001可以利用接口电路2002接收的数据、指令或者其他信息,进行加工,可以将加工完成信息通过接 口电路2002发送出去。
可选的,芯片还包括存储器,存储器可以包括只读存储器和随机存取存储器,并向处理器提供操作指令和数据。存储器的一部分还可以包括非易失性随机存取存储器(non-vo latile random access memory,NVRAM)。
可选的,存储器存储了可执行软件模块或者数据结构,处理器可以通过调用存储器存储的操作指令(该操作指令可存储在操作系统中),执行相应的操作。
可选的,芯片可以使用在本申请实施例涉及的电子设备或DOP中。可选的,接口电路2002可用于输出处理器2001的执行结果。关于本申请的一个或多个实施例提供的编码方法可参考前述各个实施例,这里不再赘述。
需要说明的,处理器2001、接口电路2002各自对应的功能既可以通过硬件设计实现,也可以通过软件设计来实现,还可以通过软硬件结合的方式来实现,这里不作限制。
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其他的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其他的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
上述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计 算机,服务器,或者网络设备等)执行本申请各个实施例上述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。

Claims (34)

  1. 一种编码方法,其特征在于,所述方法包括:
    获取待编码数据;
    将所述待编码数据输入第一编码网络以得到目标参数;
    根据所述目标参数构建第二编码网络;
    将所述待编码数据输入所述第二编码网络以得到第一特征;
    对所述第一特征进行编码以得到编码码流。
  2. 根据权利要求1所述的方法,其特征在于,所述目标参数为所述第二编码网络的全部卷积或部分卷积和非线性激活的参数权重。
  3. 根据权利要求1或2所述的方法,其特征在于,所述对所述第一特征进行编码以得到编码码流,包括:
    对所述第一特征进行取整以得到第一特征的取整值;
    对所述第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;
    根据所述第一特征的取整值的估计概率分布对所述第一特征的取整值进行熵编码以得所述编码码流。
  4. 根据权利要求3所述的方法,其特征在于,所述对所述第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,包括:
    根据第一信息对所述第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
  5. 一种解码方法,其特征在于,所述方法包括:
    获取待解码码流;
    对所述待解码码流进行解码以得到第一特征的取整值和第二特征的取整值,所述第一特征的取整值用于获得解码数据,所述第二特征的取整值用于获得目标参数;
    将所述第二特征的取整值输入第一解码网络以得到所述目标参数;
    根据所述目标参数构建第二解码网络;
    将所述第一特征的取整值输入所述第二解码网络以得到解码数据。
  6. 根据权利要求5所述的方法,其特征在于,所述目标参数为所述第二解码网络的全部卷积或部分卷积和非线性激活的参数权重。
  7. 根据权利要求5或6所述的方法,其特征在于,所述待解码码流包括第一待解码码流和第二待解码码流,所述对所述待解码码流进行解码以得到第一特征的取整值和第二特征的取整值,包括:
    对所述第一待解码码流进行解码以得到所述第一特征的取整值;
    对所述第二待解码码流进行解码以得到所述第二特征的取整值。
  8. 根据权利要求7所述的方法,其特征在于,所述对所述第一待解码码流进行解码以得到所述第一特征的取整值,包括:
    对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;
    根据所述第一特征的取整值的估计概率分布对所述第一待解码码流进行熵解码以得到所述第一特征的取整值。
  9. 根据权利要求8所述的方法,其特征在于,所述对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,包括:
    根据第一信息对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
  10. 根据权利要求7至9中任一项所述的方法,其特征在于,所述对所述第二待解码码流进行解码以得到所述第二特征的取整值,包括:
    对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布;
    根据所述第二特征的取整值的估计概率分布对所述第二待解码码流进行熵解码以得到所述第二特征的取整值。
  11. 根据权利要求10所述的方法,其特征在于,所述对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布,包括:
    根据第一信息对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
  12. 一种解码方法,其特征在于,所述方法包括:
    获取待解码码流;
    对所述待解码码流进行解码以得到第一特征的取整值,所述第一特征的取整值用于获得解码数据和目标参数;
    将所述第一特征的取整值输入第一解码网络以得到目标参数;
    根据所述目标参数构建第二解码网络;
    将所述第一特征的取整值输入到所述第二解码网络以得到解码数据。
  13. 根据权利要求12所述的方法,其特征在于,所述目标参数为所述第二解码网络的全部卷积或部分卷积和非线性激活的参数权重。
  14. 根据权利要求12或13所述的方法,其特征在于,所述对所述待解码码流进行解码以得到所述第一特征的取整值,包括:
    对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;
    根据所述待第一特征的取整值的估计概率分布对所述待解码码流进行熵解码以得到所述第一特征的取整值。
  15. 根据权利要求14所述的方法,其特征在于,所述对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,包括:
    根据第一信息对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
  16. 一种编码装置,其特征在于,包括处理电路,所述处理电路用于:
    获取待编码数据;
    将所述待编码数据输入第一编码网络以得到目标参数;
    根据所述目标参数构建第二编码网络;
    将所述待编码数据输入所述第二编码网络以得到第一特征;
    对所述第一特征进行编码以得到编码码流。
  17. 根据权利要求16所述的装置,其特征在于,所述目标参数为所述第二编码网络的全部卷积或部分卷积和非线性激活的参数权重。
  18. 根据权利要求16或17所述的装置,其特征在于,所述处理电路具体用于:
    对所述第一特征进行取整以得到第一特征的取整值;
    对所述第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;
    根据所述第一特征的取整值的估计概率分布对所述第一特征的取整值进行熵编码以得所述编码码流。
  19. 根据权利要求18所述的装置,其特征在于,所述处理电路具体用于:
    根据第一信息对所述第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
  20. 一种解码装置,其特征在于,包括处理电路,所述处理电路用于:
    获取待解码码流;
    对所述待解码码流进行解码以得到第一特征的取整值和第二特征的取整值,所述第一特征的取整值用于获得解码数据,所述第二特征的取整值用于获得目标参数;
    将所述第二特征的取整值输入第一解码网络以得到所述目标参数;
    根据所述目标参数构建第二解码网络;
    将所述第一特征的取整值输入所述第二解码网络以得到解码数据。
  21. 根据权利要求20所述的装置,其特征在于,所述目标参数为所述第二解码网络的全部卷积或部分卷积和非线性激活的参数权重。
  22. 根据权利要求20或21所述的装置,其特征在于,所述待解码码流包括第一待解码码流和第二待解码码流,所述处理电路具体用于:
    对所述第一待解码码流进行解码以得到所述第一特征的取整值;
    对所述第二待解码码流进行解码以得到所述第二特征的取整值。
  23. 根据权利要求22所述的装置,其特征在于,所述处理电路具体用于:
    对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;
    根据所述第一特征的取整值的估计概率分布对所述第一待解码码流进行熵解码以得到所述第一特征的取整值。
  24. 根据权利要求23所述的装置,其特征在于,所述处理电路具体用于:
    根据第一信息对所述第一待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
  25. 根据权利要求22至24中任一项所述的装置,其特征在于,所述处理电路具体用于:
    对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布;
    根据所述第二特征的取整值的估计概率分布对所述第二待解码码流进行熵解码以得到所述第二特征的取整值。
  26. 根据权利要求25所述的装置,其特征在于,所述处理电路具体用于:
    根据第一信息对所述第二待解码码流中的第二特征的取整值进行概率估计以得到所述第二特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
  27. 一种解码装置,其特征在于,包括处理电路,所述处理电路用于:
    获取待解码码流;
    对所述待解码码流进行解码以得到第一特征的取整值,所述第一特征的取整值用于获得解码数据和目标参数;
    将所述第一特征的取整值输入第一解码网络以得到目标参数;
    根据所述目标参数构建第二解码网络;
    将所述第一特征的取整值输入到所述第二解码网络以得到解码数据。
  28. 根据权利要求27所述的装置,其特征在于,所述目标参数为所述第二解码网络的全部卷积或部分卷积和非线性激活的参数权重。
  29. 根据权利要求或27或28所述的装置,其特征在于,所述处理电路具体用于:
    对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布;
    根据所述待第一特征的取整值的估计概率分布对所述待解码码流进行熵解码以得到所述第一特征的取整值。
  30. 根据权利要求29所述的装置,其特征在于,所述处理电路具体用于:
    根据第一信息对所述待解码码流中的第一特征的取整值进行概率估计以得到所述第一特征的取整值的估计概率分布,所述第一信息包括上下文信息和边信息中的至少一项。
  31. 一种编码器,其特征在于,包括:
    一个或多个处理器;
    非瞬时性计算机可读存储介质,耦合到所述处理器并存储由所述处理器执行的程序,其中所述程序在由所述处理器执行时,使得所述编码器执行根据权利要求1至4中任一项所述的方法。
  32. 一种解码器,其特征在于,包括:
    一个或多个处理器;
    非瞬时性计算机可读存储介质,耦合到所述处理器并存储由所述处理器执行的程序,其中所述程序在由所述处理器执行时,使得所述编码器执行根据权利要求5至11或12至15中任一项所述的方法。
  33. 一种计算机可读存储介质,其特征在于,包括计算机程序,所述计算机程序在计算机上被执行时,使得所述计算机执行权利要求1至4、5至11或12至15中任一项所述的方法。
  34. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序代码, 当所述计算机程序代码在计算机上运行时,使得计算机执行权利要求1至4、5至11或12至15中任一项所述的方法。
PCT/CN2022/109485 2021-08-05 2022-08-01 编解码方法和装置 WO2023011420A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
BR112024002242A BR112024002242A2 (pt) 2021-08-05 2022-08-01 Método e aparelho de codificação e decodificação, codificador, decodificador, meio de armazenamento legível por computador, e produto de programa de computador
EP22852132.4A EP4373081A1 (en) 2021-08-05 2022-08-01 Encoding method and apparatus, and decoding method and apparatus
KR1020247006856A KR20240039178A (ko) 2021-08-05 2022-08-01 인코딩 및 디코딩 방법 그리고 장치

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110898667.8 2021-08-05
CN202110898667.8A CN115883831A (zh) 2021-08-05 2021-08-05 编解码方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/433,054 Continuation US20240205435A1 (en) 2021-08-05 2024-02-05 Encoding and decoding method and apparatus

Publications (1)

Publication Number Publication Date
WO2023011420A1 true WO2023011420A1 (zh) 2023-02-09

Family

ID=85154401

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/109485 WO2023011420A1 (zh) 2021-08-05 2022-08-01 编解码方法和装置

Country Status (5)

Country Link
EP (1) EP4373081A1 (zh)
KR (1) KR20240039178A (zh)
CN (1) CN115883831A (zh)
BR (1) BR112024002242A2 (zh)
WO (1) WO2023011420A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117014610A (zh) * 2023-10-07 2023-11-07 华侨大学 基于多任务学习的h.266vvc屏幕内容帧内cu快速划分方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110401836A (zh) * 2018-04-25 2019-11-01 杭州海康威视数字技术股份有限公司 一种图像解码、编码方法、装置及其设备
CN110870310A (zh) * 2018-09-04 2020-03-06 深圳市大疆创新科技有限公司 图像编码方法和装置
CN111641826A (zh) * 2019-03-01 2020-09-08 杭州海康威视数字技术股份有限公司 对数据进行编码、解码的方法、装置与系统
WO2021063559A1 (en) * 2019-09-30 2021-04-08 Interdigital Vc Holdings France, Sas Systems and methods for encoding a deep neural network
JP2021072540A (ja) * 2019-10-30 2021-05-06 キヤノン株式会社 画像符号化装置、復号装置、伝送システム、及びその制御方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110401836A (zh) * 2018-04-25 2019-11-01 杭州海康威视数字技术股份有限公司 一种图像解码、编码方法、装置及其设备
CN110870310A (zh) * 2018-09-04 2020-03-06 深圳市大疆创新科技有限公司 图像编码方法和装置
CN111641826A (zh) * 2019-03-01 2020-09-08 杭州海康威视数字技术股份有限公司 对数据进行编码、解码的方法、装置与系统
WO2021063559A1 (en) * 2019-09-30 2021-04-08 Interdigital Vc Holdings France, Sas Systems and methods for encoding a deep neural network
JP2021072540A (ja) * 2019-10-30 2021-05-06 キヤノン株式会社 画像符号化装置、復号装置、伝送システム、及びその制御方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117014610A (zh) * 2023-10-07 2023-11-07 华侨大学 基于多任务学习的h.266vvc屏幕内容帧内cu快速划分方法及装置
CN117014610B (zh) * 2023-10-07 2023-12-29 华侨大学 基于多任务学习的h.266vvc屏幕内容帧内cu快速划分方法及装置

Also Published As

Publication number Publication date
KR20240039178A (ko) 2024-03-26
BR112024002242A2 (pt) 2024-04-30
CN115883831A (zh) 2023-03-31
EP4373081A1 (en) 2024-05-22

Similar Documents

Publication Publication Date Title
WO2020181997A1 (en) An encoder, a decoder and corresponding methods for inter prediction
WO2022068716A1 (zh) 熵编/解码方法及装置
WO2021109978A1 (zh) 视频编码的方法、视频解码的方法及相应装置
AU2020261145B2 (en) Picture prediction method and apparatus, and computer-readable storage medium
WO2020228560A1 (zh) 候选运动矢量列表获取方法、装置及编解码器
WO2022063265A1 (zh) 帧间预测方法及装置
WO2020244579A1 (zh) Mpm列表构建方法、色度块的帧内预测模式获取方法及装置
WO2020232845A1 (zh) 一种帧间预测的方法和装置
CN114125446A (zh) 图像编码方法、解码方法和装置
AU2024201357A1 (en) Picture prediction method and apparatus, and computer-readable storage medium
WO2022111233A1 (zh) 帧内预测模式的译码方法和装置
US20230388490A1 (en) Encoding method, decoding method, and device
WO2020253681A1 (zh) 融合候选运动信息列表的构建方法、装置及编解码器
WO2023011420A1 (zh) 编解码方法和装置
WO2021008524A1 (zh) 图像编码方法、解码方法、装置和存储介质
WO2020259567A1 (zh) 视频编码器、视频解码器及相应方法
US20230239500A1 (en) Intra Prediction Method and Apparatus
WO2023020320A1 (zh) 熵编解码方法和装置
WO2021045657A9 (en) Motion vector range derivation for enhanced interpolation filter
WO2020114393A1 (zh) 变换方法、反变换方法以及视频编码器和视频解码器
US20240205435A1 (en) Encoding and decoding method and apparatus
WO2023160470A1 (zh) 编解码方法和装置
CN118042136A (zh) 编解码方法和装置
CN116647683A (zh) 量化处理方法和装置
CN116134817A (zh) 使用稀疏光流表示的运动补偿

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: 22852132

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2024506874

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 2022852132

Country of ref document: EP

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112024002242

Country of ref document: BR

ENP Entry into the national phase

Ref document number: 2022852132

Country of ref document: EP

Effective date: 20240213

ENP Entry into the national phase

Ref document number: 20247006856

Country of ref document: KR

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 1020247006856

Country of ref document: KR

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 112024002242

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20240202