Coding method and decoding method, and apparatus
By adjusting the coding parameters according to the full padding information of the coding unit, the problem of uneven quality between stripes after image padding is solved, and the balance and consistency of image quality are achieved.
Patent Information
- Application Number
- PCT/CN2024/080069
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-13
- Filing Date
- 2024-03-05
- Publication Date
- 2024-09-19
AI Technical Summary
After image padding, there are differences in the subjective quality of different strips, resulting in uneven image quality after padding.
By determining the coding information based on the fully padded information of the coding unit, the number of coded bits of the fully padded coding unit is adjusted to increase its compression performance, thereby reducing the number of coded bits of the incompletely padded coding unit and ensuring consistent reconstruction quality for all stripes.
The subjective quality of the filled image is balanced, the quality difference between strips is avoided, and the overall quality of image reconstruction is improved.
Smart Images

Figure CN2024080069_19092024_PF_FP_ABST
Abstract
Description
Coding and decoding method and device
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 13, 2023, with application number 202310290271.4 and application name “Encoding and Decoding Method and Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of media technology, and in particular to encoding and decoding methods and devices. Background Art
[0003] Media devices use display interfaces when transmitting media content. Display interfaces can compress media content through encoding to reduce bandwidth usage. Upon receiving the compressed media content, the receiver must decode it to restore the original content.
[0004] In compression scenarios, the input image can be divided into multiple stripes, and each stripe is then encoded. The input image resolution and stripe division are often determined by product requirements, so the image resolution may not necessarily meet the required number of stripes. In order for the encoder and decoder to continue to work properly under this input condition, the input image needs to be padded before encoding so that it can be divided into the required integer number of stripes. The padded image is then encoded and transmitted, and the bitstream is decoded by the decoder to obtain a reconstructed image. Finally, the reconstructed image is cropped to remove the padded area and restore the original resolution.
[0005] In the related art, the subjective qualities of different strips in an image after image padding may be different, resulting in uneven subjective quality of the padded image.
[0006] Therefore, how to balance the subjective quality of the image after image padding is one of the problems that those skilled in the art need to solve urgently.
[0007] Summary of the Invention
[0008] The embodiments of the present application provide a coding and decoding method and apparatus that can balance the subjective quality of an image after image padding. To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0009] In a first aspect, an embodiment of the present application provides a coding method, comprising: performing image padding on an image to be coded to obtain a padded image; then obtaining a coding unit based on the padded image; then determining coding information for the coding unit based on full padded information for the coding unit; and then encoding the coding unit based on the coding information to generate a bitstream. The full padded information indicates whether all samples in the coding unit are image padded samples, and the coding information includes at least one of a number of padding bits and a coding code length.
[0010] In the related art, when encoding and decoding a padded image, if the padded content in a strip is too much and simple, the number of coding bits occupied by the completely padded coding units in the strip is relatively small, and the number of coding bits used for the non-completely padded coding units in the strip will be more abundant than other strips with no padded content or less padded content, resulting in a difference in the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, causing uneven subjective quality of the padded image.
[0011] In the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full filling information of the coding unit, and then the coding unit is encoded to generate a code stream using the coding information. In this way, the fully filled coding unit in the strip can be determined by the full filling information, and then the coding parameters of the fully filled coding unit can be adjusted to increase its coding bit number, thereby reducing the coding bit number of the non-fully filled coding unit in the strip, thereby reducing the difference between the reconstruction quality of the non-filled content in the strip and the reconstruction quality of other strips, avoiding uneven subjective quality of the padded image, and thus making the subjective quality of the padded image balanced. That is, by adjusting the compression performance of the fully filled coding unit, the subjective quality of the padded image is made uniform.
[0012] In a possible implementation, the encoding unit may be encoded to generate a code stream to be filled, and bits are filled in the code stream to be filled according to the number of filling bits to obtain the code stream.
[0013] It can be seen that in the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full padding information of the coding unit, and then the coding unit can be encoded using the coding information to generate a bitstream. In this way, the fully padded coding unit in the strip can be determined using the full padding information, and then bits can be padded in the initial bitstream (i.e., the bitstream to be padded) generated from the fully padded coding unit to increase its number of coded bits, thereby reducing the number of coded bits for the non-fully padded coding units in the strip, thereby reducing the difference between the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, avoiding uneven subjective quality of the padded image, and thus making the subjective quality of the padded image balanced.
[0014] In a possible implementation, the coding unit may be fixed-length coded according to the coding code length to generate the code stream.
[0015] As can be seen, in the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full padding information of the coding unit, and then the coding unit can be encoded using the coding information to generate a bitstream. In this way, the fully padded coding units in the strip can be determined using the full padding information, and then the coding units can be fixed-length encoded based on the encoding code length to generate a bitstream, thereby increasing the number of encoded bits, thereby reducing the number of encoded bits for the non-fully padded coding units in the strip. This reduces the difference between the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, avoiding uneven subjective quality of the padded image, and thus making the subjective quality of the padded image balanced.
[0016] In a possible implementation, the above-mentioned number of filling bits can be determined based on the actual number of bits of the above-mentioned coding unit and the first preset number of bits when the above-mentioned coding unit is a target coding unit. The above-mentioned target coding unit is a coding unit in which all samples are image filling samples, and the above-mentioned actual number of bits is the bits of the code stream to be filled corresponding to the above-mentioned coding unit.
[0017] Optionally, the number of padding bits BitsGap may satisfy: BitsGap=Max(X0-BCU, 0).
[0018] Among them, BCU is the bit of the code stream to be filled corresponding to the coding unit (that is, the actual number of coding bits obtained after encoding the current coding block), and X0 is the first preset number of bits (that is, the total number of bits of the bit stream corresponding to the coding unit when the full filling flag is 1).
[0019] It can be seen that in the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full padding information of the coding unit, and then the coding unit is encoded to generate a code stream using the coding information. In this way, the fully padded coding unit in the strip can be determined using the full padding information, and then the number of padding bits can be determined based on the actual number of bits of the coding unit and the first preset number of bits. Thereafter, bits are padded according to the number of padding bits in the initial code stream generated by the fully padded coding unit (i.e., the code stream to be padded), so that the number of coding bits is increased, thereby reducing the number of coding bits of the non-fully padded coding unit in the strip, thereby reducing the difference between the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, avoiding uneven subjective quality of the padded image, and thus making the subjective quality of the padded image balanced.
[0020] In a possible implementation, the encoding code length can be determined based on the header information overhead of the encoding unit, the second preset number of bits and the number of samples of the encoding unit when the encoding unit is a target encoding unit, and the target encoding unit is an encoding unit in which all samples are image padding samples.
[0021] Optionally, the encoding code length Bpppad may satisfy: Bpppad = (X1-X2) / Cusize.
[0022] Among them, X1 is the second preset number of bits (that is, the total number of bits of the bit stream corresponding to the fully filled coding unit), X2 is the header information overhead of the current coding unit, and Cusize is the number of samples in the coding unit.
[0023] It can be seen that in the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full padding information of the coding unit, and then the coding unit is encoded to generate a bitstream using the coding information. In this way, the fully padded coding unit in the strip can be determined using the full padding information, and then the encoding code length is determined using the header information overhead of the coding unit, the second preset number of bits, and the number of samples in the coding unit. Then, the coding unit is fixed-length encoded based on the encoding code length to generate a bitstream, thereby increasing its encoding bit count, thereby reducing the encoding bit count of the non-fully padded coding unit in the strip, thereby reducing the difference between the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, avoiding uneven subjective quality of the padded image, and thus making the subjective quality of the padded image balanced.
[0024] In a possible implementation, the full padding information is used to further indicate whether the coding unit is located in a target stripe of the padded image, where the target stripe is horizontal to the padded stripe of the image.
[0025] In a possible implementation, the target coding unit is a coding unit in which all samples are image padding samples and are located within a target slice of the padded image.
[0026] In a possible implementation, the image to be encoded may be divided into multiple strips, and then N columns of samples are padded at the right edge of the last column of the strips of the image to be encoded, where N is a positive integer.
[0027] It can be understood that, compared with performing image padding on each strip, performing image padding only on the last column of strips of the image can avoid an increase in hardware implementation cost and power consumption of image padding.
[0028] In a second aspect, an embodiment of the present application further provides a decoding method, the method comprising: obtaining a code stream. Decoding the code stream to obtain a reconstructed block. Generating a reconstructed image based on the reconstructed block. The code stream is a code stream generated by the coding unit according to the coding information of the coding unit, the coding information is determined based on the full padding information of the coding unit, the full padding information is used to indicate whether all samples in the coding unit are image padding samples, and the coding information includes at least one of the number of padding bits or the coding code length.
[0029] In the related art, when encoding and decoding a padded image, if the padded content in a strip is too much and simple, the number of coding bits occupied by the completely padded coding units in the strip is relatively small, and the number of coding bits used for the non-completely padded coding units in the strip will be more abundant than other strips with no padded content or less padded content, resulting in a difference in the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, causing uneven subjective quality of the padded image.
[0030] In the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full padding information of the coding unit, and then the coding unit is encoded using the coding information to generate a bitstream. In this way, the fully padded coding units in the strip can be determined based on the full padding information, and then the coding parameters of the fully padded coding units can be adjusted to increase their number of coded bits, thereby reducing the number of coded bits of the non-fully padded coding units in the strip. This reduces the difference between the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, avoids uneven subjective quality of the padded image, and thus makes the subjective quality of the padded image balanced.
[0031] In a possible implementation, when the code stream is a code stream of a target coding unit, the code stream may be decoded according to the encoding code length to obtain the reconstructed block, and the target coding unit is a coding unit in which all samples are image padding samples.
[0032] In a possible implementation, the full padding information is used to further indicate whether the coding unit is located within a target stripe of the padded image, where the target stripe is a stripe of the image padded horizontally.
[0033] In a possible implementation, the target coding unit is a coding unit in which all samples are image padding samples and are located within a target slice of the padded image.
[0034] In a possible implementation, the image-filled area in the reconstructed image may be cropped.
[0035] In a third aspect, an embodiment of the present application further provides a coding device, comprising: an image padding unit, a division unit, a determination unit, and a coding unit. The image padding unit is configured to perform image padding on an image to be coded to obtain a padded image. The division unit is configured to obtain a coding unit based on the padded image. The determination unit is configured to determine the coding information of the coding unit based on the full padding information of the coding unit, wherein the full padding information is used to indicate whether all samples in the coding unit are image padded samples, and the coding information includes at least one of the number of padding bits or the coding code length. The coding unit is configured to encode the coding unit based on the coding information to generate a bitstream.
[0036] In a possible implementation, the encoding unit is specifically configured to: encode the encoding unit to generate a code stream to be filled; and fill the code stream to be filled with bits according to the number of filling bits to obtain the code stream.
[0037] In a possible implementation, the encoding unit is specifically configured to: perform fixed-length encoding on the encoding unit according to the encoding code length to generate the code stream.
[0038] In a possible implementation, the determination unit is specifically used to: when the coding unit is a target coding unit, determine the number of filling bits based on the actual number of bits of the coding unit and the first preset number of bits, the target coding unit is a coding unit in which all samples are image filling samples, and the actual number of bits is the number of bits of the code stream to be filled corresponding to the coding unit.
[0039] In a possible implementation, the above-mentioned determination unit is specifically used to: when the above-mentioned coding unit is a target coding unit, determine the above-mentioned encoding code length based on the header information overhead of the above-mentioned coding unit, the second preset number of bits and the number of samples of the above-mentioned coding unit, and the above-mentioned target coding unit is a coding unit whose samples are all image padding samples.
[0040] In a possible implementation, the full padding information is used to further indicate whether the coding unit is located in a target stripe of the padded image, where the target stripe is horizontal to the padded stripe of the image.
[0041] In a possible implementation, the target coding unit is a coding unit in which all samples are image padding samples and are located within a target slice of the padded image.
[0042] In a fourth aspect, an embodiment of the present application further provides a decoding device, comprising: a receiving unit, a decoding unit, and a reconstruction unit. The receiving unit is configured to obtain a code stream, wherein the code stream is generated by the encoding unit according to the encoding information of the encoding unit, wherein the encoding information is determined according to the full padding information of the encoding unit, wherein the full padding information is used to indicate whether all samples in the encoding unit are image padding samples, and the encoding information includes at least one of the number of padding bits or the encoding code length. The decoding unit is configured to decode the code stream to obtain a reconstructed block. The reconstruction unit is configured to generate a reconstructed image based on the reconstructed block.
[0043] In a possible implementation, the decoding unit is specifically configured to: when the bitstream is a bitstream of a target coding unit, decode the bitstream according to the encoding code length to obtain the reconstructed block, and the target coding unit is a coding unit in which all samples are image padding samples.
[0044] In a possible implementation, the full padding information is used to further indicate whether the coding unit is located within a target stripe of the padded image, where the target stripe is a stripe of the image padded horizontally.
[0045] In a possible implementation, the target coding unit is a coding unit in which all samples are image padding samples and are located within a target slice of the padded image.
[0046] In a possible implementation manner, the reconstruction unit is further configured to: crop the image-filled area in the reconstructed image.
[0047] In a fifth aspect, an embodiment of the present application further provides a coding device, which includes: at least one processor, which, when the at least one processor executes program code or instructions, implements the method described in the above first aspect or any possible implementation thereof.
[0048] Optionally, the apparatus may further include at least one memory configured to store the program code or instruction.
[0049] In a sixth aspect, an embodiment of the present application further provides a decoding device, which includes: at least one processor, which, when the at least one processor executes program code or instructions, implements the method described in the above second aspect or any possible implementation thereof.
[0050] Optionally, the apparatus may further include at least one memory configured to store the program code or instruction.
[0051] In a seventh aspect, embodiments of the present application further provide a chip comprising: an input interface, an output interface, and at least one processor. Optionally, the chip further comprises a memory. The at least one processor is configured to execute code in the memory. When the at least one processor executes the code, the chip implements the method described in the first aspect or any possible implementation thereof.
[0052] Optionally, the chip may also be an integrated circuit.
[0053] In an eighth aspect, an embodiment of the present application further provides a computer-readable storage medium for storing a computer program, which includes methods for implementing the above-mentioned first aspect or any possible implementation thereof.
[0054] In a ninth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to implement the method described in the first aspect or any possible implementation thereof.
[0055] The encoding and decoding device, computer storage medium, computer program product and chip provided in this embodiment are all used to execute the encoding and decoding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the encoding and decoding method provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0057] FIG1a is an exemplary block diagram of a decoding system provided in an embodiment of the present application;
[0058] FIG1b is an exemplary block diagram of a video decoding system provided in an embodiment of the present application;
[0059] FIG2 is an exemplary block diagram of a video encoder provided in an embodiment of the present application;
[0060] FIG3 is an exemplary block diagram of a video decoder provided in an embodiment of the present application;
[0061] FIG4 is an exemplary schematic diagram of candidate image blocks provided in an embodiment of the present application;
[0062] FIG5 is an exemplary block diagram of a video decoding device provided in an embodiment of the present application;
[0063] FIG6 is an exemplary block diagram of a device provided in an embodiment of the present application;
[0064] FIG7 is a schematic diagram of the structure of a coding system provided in an embodiment of the present application;
[0065] FIG8 is a schematic diagram of the structure of another encoding system provided in an embodiment of the present application;
[0066] FIG9 is a schematic diagram of an encoding method provided in an embodiment of the present application;
[0067] FIG10 is a schematic diagram of an image filling process provided in an embodiment of the present application;
[0068] FIG11 is a schematic structural diagram of a decoding system provided in an embodiment of the present application;
[0069] FIG12 is a schematic diagram of a decoding method provided in an embodiment of the present application;
[0070] FIG13 is a schematic diagram of an encoding device provided in an embodiment of the present application;
[0071] FIG14 is a schematic diagram of a decoding device provided in an embodiment of the present application;
[0072] FIG15 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0073] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the embodiments of this application.
[0074] The term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0075] The terms "first" and "second" and so on in the description and drawings of the embodiments of this application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0076] Furthermore, the terms "including," "having," and any variations thereof, mentioned in the description of the embodiments of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not limited to the listed steps or units but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to the process, method, product, or apparatus.
[0077] It should be noted that in the description of the embodiments of this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.
[0078] In the description of the embodiments of the present application, unless otherwise specified, “plurality” means two or more.
[0079] First, the terms involved in the embodiments of the present application are explained.
[0080] Image padding: The input image can be divided into strips of equal length and width. If the current image width is not an integer multiple of the strip width or the current image height is not an integer multiple of the strip height, image padding is required. The reconstructed or decoded image is cropped before output, ultimately outputting an image at its original resolution.
[0081] Fixed-length coding: A type of source coding in which the codeword length is fixed. In fixed-length coding, the codeword length of each codeword is equal.
[0082] Header information overhead: the bit overhead of the current coding unit excluding the encoded residual data.
[0083] Interface compression: Media devices use display interfaces when transmitting images and videos, and encode the image and video content through the display interface into a binary stream.
[0084] Bitstream: A binary stream generated by encoding image and video content.
[0085] Slice: The input image can be divided into one or more slices. Each slice is divided into one or more coding units for encoding.
[0086] Bitstream: A binary stream generated by encoding image or video content.
[0087] Bit rate control: The process of adjusting the output bit rate during the encoding process. It is based on the analysis of information such as the current image content and the bitstream buffer margin, and adjusts the output bit rate by changing the encoding quantization parameters, encoding mode, etc.
[0088] Quantization Parameter (QP): During the encoding process, the residual values generated by the prediction operation or the coefficients generated by the transform operation are quantized and written to the bitstream. During the decoding process, the syntax elements are dequantized to obtain the residual values or coefficients. The QP is the parameter used in this quantization process. Generally, a larger QP value indicates a greater degree of quantization. Adjusting the QP value directly affects the length of the encoded bitstream and the quality of the decoded image.
[0089] 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 generally includes processing (e.g., compressing) the original data to reduce the amount of data required to represent the original data (thereby more efficiently storing and / or transmitting). Data decoding is performed on the destination side (or commonly referred to as the decoder side), and generally includes inverse processing relative to the encoder side to reconstruct the original data. The "encoding and decoding" of the data involved in the embodiments of the present application should be understood as the "encoding" or "decoding" of the data. The encoding part and the decoding part are also collectively referred to as encoding and decoding (encoding and decoding, CODEC).
[0090] In the case of lossless data encoding, the original data can be reconstructed, that is, the reconstructed original data has the same quality as the original data (assuming there is no transmission loss or other data loss during storage or transmission). In the case of lossy data encoding, further compression is performed through quantization, etc. to reduce the amount of data required to represent the original data, but the decoder side cannot fully reconstruct the original data, that is, the quality of the reconstructed original data is lower or worse than the quality of the original data.
[0091] The embodiments of the present application can be applied to video data and other data with compression / decompression requirements. The following uses the encoding of video data (referred to as video encoding) as an example to illustrate the embodiments of the present application. Other types of data (such as image data, audio data, integer data, and other data with compression / decompression requirements) can refer to the following description, and the embodiments of the present application will not be repeated here. It should be noted that, compared to video encoding, the encoding process of data such as audio data and integer data does not require data to be divided into blocks, but the data can be directly encoded.
[0092] Video coding generally refers to processing a sequence of images to form a video or video sequence. In the field of video coding, the terms "picture", "frame" or "image" can be used as synonyms.
[0093] Several video coding standards fall under the category of "lossy hybrid video codecs" (i.e., 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 typically divided into a set of non-overlapping blocks, which are typically coded at the block level. In other words, the encoder typically processes, i.e., encodes, the video at the block (video block) level, for example, by generating a prediction block through spatial (intra-frame) and temporal (inter-frame) prediction; subtracting the prediction block from the current block (currently processed / to-be-processed block) to obtain a residual block; transforming and quantizing the residual block in the transform domain to reduce the amount of data to be transmitted (compressed), while the decoder applies the inverse of the encoder's processing to the coded or compressed block to reconstruct the current block for representation. Furthermore, the encoder needs to repeat the decoder's processing steps so that the encoder and decoder generate the same predictions (e.g., intra-frame predictions and inter-frame predictions) and / or reconstructed pixels for processing, i.e., encoding, the subsequent block.
[0094] In the following embodiment of the decoding system 10 , the encoder 20 and the decoder 30 are described with reference to FIG. 1 a to FIG. 3 .
[0095] FIG1a is an exemplary block diagram of a decoding system 10 provided in an embodiment of the present application, such as a video decoding system 10 (or simply, decoding system 10) that can utilize the techniques of the embodiments of the present application. The video encoder 20 (or simply, encoder 20) and video decoder 30 (or simply, decoder 30) in the video decoding system 10 represent devices that can be used to perform various techniques according to the various examples described in the embodiments of the present application.
[0096] As shown in FIG. 1 a , a decoding system 10 includes a source device 12 for providing encoded image data 21 such as an encoded image to a destination device 14 for decoding the encoded image data 21 .
[0097] The source device 12 includes an encoder 20 , and optionally, may include an image source 16 , a preprocessor (or preprocessing unit) 18 such as an image preprocessor, and a communication interface (or communication unit) 22 .
[0098] Image source 16 may include or may 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 for generating computer-animated images, or any type of device for acquiring and / or providing real-world images, computer-generated images, such as screen content, virtual reality (VR) images, and / or any combination thereof (e.g., augmented reality (AR) images). The image source may be any type of memory or storage that stores any of the aforementioned images.
[0099] In order to distinguish the processing performed by the pre-processor (or pre-processing unit) 18 , the image (or image data) 17 may also be referred to as a raw image (or raw image data) 17 .
[0100] The preprocessor 18 is configured to receive raw image data 17 and preprocess the raw image data 17 to obtain a preprocessed image (or preprocessed image data) 19. For example, the preprocessing performed by the preprocessor 18 may include cropping, color format conversion (e.g., from RGB to YCb Cr), color grading, or denoising. It will be appreciated that the preprocessor 18 may be an optional component.
[0101] The video encoder (or encoder) 20 is used to receive the pre-processed image data 19 and provide encoded image data 21 (which will be further described below with reference to FIG. 2 and the like).
[0102] The communication interface 22 in the source device 12 can be used to receive the encoded image data 21 and send the encoded image data 21 (or any other processed version) to another device such as the destination device 14 or any other device through the communication channel 13 for storage or direct reconstruction.
[0103] The destination device 14 includes a decoder 30 and, optionally, may include a communication interface (or communication unit) 28 , a post-processor (or post-processing unit) 32 , and a display device 34 .
[0104] The communication interface 28 in the destination device 14 is used to receive the encoded 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 encoded image data storage device, and provide the encoded image data 21 to the decoder 30.
[0105] The communication interface 22 and the communication interface 28 can be used to send or receive encoded image data (or encoded data) 21 through a direct communication link between the source device 12 and the destination device 14, such as a direct wired or wireless connection, or through any type of network, such as a wired network, a wireless network or any combination thereof, any type of private network and public network or any combination thereof.
[0106] For example, the communication interface 22 may be used to encapsulate the encoded image data 21 into a suitable format such as a message, and / or process the encoded image data using any type of transmission coding or processing for transmission over a communication link or network.
[0107] The communication interface 28 corresponds to the communication interface 22 , and can be used, for example, to receive 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 .
[0108] Both the communication interface 22 and the communication interface 28 can be configured as a unidirectional communication interface as indicated by the arrow pointing from the source device 12 to the corresponding communication channel 13 of the destination device 14 in Figure 1a, or a bidirectional communication interface, and can be used to send and receive messages, etc. to establish a connection, confirm and exchange any other information related to the communication link and / or data transmission such as encoded image data transmission, etc.
[0109] The video decoder (or decoder) 30 is used to receive the 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 and the like).
[0110] The post-processor 32 is configured to post-process the decoded image data 31 (also referred to as reconstructed image data) such as the decoded image to obtain post-processed image data 33 such as the post-processed image. The post-processing performed by the 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 generating the decoded image data 31 for display on a display device 34 or the like.
[0111] The display device 34 is configured to receive the post-processed image data 33 and display the image to a user or viewer. The display device 34 may be or include any type of display for displaying the reconstructed image, such as an integrated or external display screen or monitor. For example, the display screen may include a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a plasma display, a projector, a micro-LED display, a liquid crystal on silicon (LCoS) display, a digital light processor (DLP), or any other type of display screen.
[0112] The decoding system 10 also includes a training engine 25, which is used to train the encoder 20 (especially the entropy coding unit 270 in the encoder 20) or the decoder 30 (especially the entropy decoding unit 304 in the decoder 30) to perform entropy coding on the coding unit to be encoded according to the estimated probability distribution. For a detailed description of the training engine 25, please refer to the following method test example.
[0113] Although FIG1a shows source device 12 and destination device 14 as separate devices, device embodiments may also include both source device 12 and destination device 14 or the functions of both source device 12 and destination device 14, that is, both source device 12 or the corresponding functions and destination device 14 or the corresponding functions. In these embodiments, source device 12 or the corresponding functions and destination device 14 or the corresponding functions may be implemented using the same hardware and / or software or through separate hardware and / or software or any combination thereof.
[0114] According to the description, the existence and (accurate) division of different units or functions in the source device 12 and / or the destination device 14 shown in FIG. 1 a may vary depending on actual devices and applications, which is obvious to those skilled in the art.
[0115] Please refer to Figure 1b, which is an exemplary block diagram of a video decoding system 40 provided in an embodiment of the present application. The encoder 20 (e.g., video encoder 20) or the decoder 30 (e.g., video decoder 30), or both, can be implemented by processing circuitry in the video decoding system 40 shown in Figure 1b, such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, video encoding-specific processors, or any combination thereof. Please refer to Figures 2 and 3, Figure 2 is an exemplary block diagram of a video encoder provided in an embodiment of the present application, and Figure 3 is an exemplary block diagram of a video decoder provided in an embodiment of the present application. The encoder 20 can be implemented by processing circuitry 46 to include the various modules discussed with reference to the encoder 20 in Figure 2 and / or any other encoder systems or subsystems described herein. The decoder 30 can be implemented by processing circuitry 46 to include the various modules discussed with reference to the decoder 30 in Figure 3 and / or any other decoder systems or subsystems described herein. The processing circuitry 46 can be used to perform the various operations discussed below. As shown in Figure 5, if part of the technology is implemented in software, the device can store the software instructions in a suitable non-transitory computer-readable storage medium and use one or more processors to execute the instructions in hardware, thereby performing the technology of the embodiment of the present application. One of the video encoder 20 and the video decoder 30 can be integrated into a single device as part of a combined codec (encoder / decoder, CODEC), as shown in Figure 1b.
[0116] The source device 12 and the destination device 14 may include any of a variety of devices, including any type of handheld or fixed device, such as a notebook computer or laptop, a mobile phone, a smart phone, a tablet or a tablet computer, a camera, a desktop computer, a set-top box, a television, a display device, a digital media player, a video game console, a video streaming device (e.g., a content service server or a content distribution server), a broadcast receiving device, a broadcast transmitting device, and a monitoring device, etc., and may not use or use any type of operating system. The source device 12 and the destination device 14 may also be devices in a cloud computing scenario, such as a virtual machine in a cloud computing scenario. In some cases, the source device 12 and the destination device 14 may be equipped with components for wireless communication. Therefore, the source device 12 and the destination device 14 may be wireless communication devices.
[0117] The source device 12 and the destination device 14 may be installed with virtual scene applications (APPs) such as virtual reality (VR), augmented reality (AR), or mixed reality (MR), and may run the VR, AR, or MR applications based on user operations (e.g., click, touch, slide, shake, voice control, etc.). The source device 12 and the destination device 14 may capture images / videos of any objects in the environment through cameras and / or sensors, and then display virtual objects on a display device based on the captured images / videos. The virtual objects may be virtual objects in the VR, AR, or MR scenes (i.e., objects in the virtual environment).
[0118] It should be noted that in the embodiment of the present application, the virtual scene application in the source device 12 and the destination device 14 can be an application built into the source device 12 and the destination device 14 themselves, or it can be an application provided by a third-party service provider and installed by the user. There is no specific limitation on this.
[0119] In addition, the source device 12 and the destination device 14 may be installed with a real-time video transmission application, such as a live broadcast application. The source device 12 and the destination device 14 may capture images / videos through cameras and then display the captured images / videos on a display device.
[0120] In some cases, the video decoding system 10 shown in FIG1a is merely exemplary, and the techniques provided in embodiments of the present application may be applicable to video encoding settings (e.g., video encoding or video decoding) that do not necessarily include any data communication between an encoding device and a decoding device. In other examples, data is retrieved from a local memory, sent over a network, and so on. A video encoding device may encode data and store the data in a memory, and / or a video decoding device may retrieve data from a memory and decode the data. In some examples, encoding and decoding are performed by devices that do not communicate with each other but simply encode data to a memory and / or retrieve and decode data from a memory.
[0121] Please refer to Figure 1b, which is an exemplary block diagram of a video decoding system 40 provided in an embodiment of the present application. As shown in Figure 1b, the video decoding system 40 may include an imaging device 41, a video encoder 20, a video decoder 30 (and / or a video encoder / decoder implemented by a processing circuit 46), an antenna 42, one or more processors 43, one or more memory storage devices 44 and / or a display device 45.
[0122] 1b, imaging device 41, antenna 42, processing circuit 46, video encoder 20, video decoder 30, processor 43, memory 44, and / or display device 45 are capable of communicating with one another. In different embodiments, video decoding system 40 may include only video encoder 20 or only video decoder 30.
[0123] In some instances, antenna 42 can be used to transmit or receive an encoded bitstream of video data. Additionally, in some instances, display device 45 can be used to present the video data. Processing circuitry 46 can include application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, and the like. Video decoding system 40 can also include an optional processor 43, which can similarly include application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, and the like. Furthermore, memory storage 44 can be any type of memory, such as volatile memory (e.g., static random access memory (SRAM), dynamic random access memory (DRAM), etc.) or non-volatile memory (e.g., flash memory, etc.). In a non-limiting example, memory storage 44 can be implemented as cache memory. In other instances, processing circuitry 46 can include memory (e.g., cache memory, etc.) for implementing an image buffer, etc.
[0124] In some examples, video encoder 20 implemented by logic circuitry may include an image buffer (e.g., implemented by processing circuitry 46 or memory storage 44) and a graphics processing unit (e.g., implemented by processing circuitry 46). The graphics processing unit may be communicatively coupled to the image buffer. The 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 systems or subsystems described herein. Logic circuitry may be used to perform the various operations discussed herein.
[0125] In some examples, the video decoder 30 may be implemented by processing circuitry 46 in a similar manner to implement the various modules discussed with reference to the video decoder 30 of FIG. 3 and / or any other decoder systems or subsystems described herein. In some examples, the logic circuit implementation of the video decoder 30 may include an image buffer (implemented by processing circuitry 46 or memory storage 44) and a graphics processing unit (e.g., implemented by processing circuitry 46). The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include the video decoder 30 implemented by processing circuitry 46 to implement the various modules discussed with reference to FIG. 3 and / or any other decoder systems or subsystems described herein.
[0126] In some examples, antenna 42 may be used to receive an encoded bitstream of video data. As discussed, the encoded bitstream may include data related to the 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, optional indicators (as discussed), and / or data defining encoding partitions). Video decoding system 40 may also include video decoder 30 coupled to antenna 42 and configured to decode the encoded bitstream. Display device 45 is configured to present the video frames.
[0127] It should be understood that for the examples described herein with reference to video encoder 20, video decoder 30 can be configured to perform the reverse process. With respect to signaling syntax elements, video decoder 30 can be configured to receive and parse such syntax elements and decode the associated video data accordingly. In some examples, video encoder 20 can entropy encode the syntax elements into an encoded video bitstream. In such examples, video decoder 30 can parse such syntax elements and decode the associated video data accordingly.
[0128] For ease of description, the embodiments of the present application are described with reference to the universal video coding (VVC) reference software or the high-efficiency video coding (HEVC) developed by the joint collaboration team on video coding (JCT-VC) of the ITU-T video coding experts group (VCEG) and the ISO / IEC motion picture experts group (MPEG). Those skilled in the art will understand that the embodiments of the present application are not limited to HEVC or VVC.
[0129] Encoders and encoding methods
[0130] As shown in FIG2 , the video encoder 20 includes an input terminal (or input interface) 201, a residual calculation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a loop filter 220, a decoded picture buffer (DPB) 230, a mode selection unit 260, an entropy coding unit 270, and an output terminal (or output interface) 272. The mode selection unit 260 may include an inter-frame prediction unit 244, an intra-frame prediction unit 254, and a segmentation unit 262. The inter-frame prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown). The video encoder 20 shown in FIG2 may also be referred to as a hybrid video encoder or a video encoder based on a hybrid video codec.
[0131] 2 , the inter-frame prediction unit is a trained target model (also known as a neural network) that processes an input image, image region, or image block to generate a prediction value for the input image block. For example, the neural network for inter-frame prediction receives an input image, image region, or image block and generates a prediction value for the input image, image region, or image block.
[0132] 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 filter 220, the decoded picture buffer (DPB) 230, the inter-frame prediction unit 244, and the intra-frame prediction unit 254 constitute the backward signal path of the encoder, where the backward signal path of the encoder 20 corresponds to the signal path of the decoder (see decoder 30 in Figure 3). The inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the loop filter 220, the decoded picture buffer 230, the inter-frame prediction unit 244, and the intra-frame prediction unit 254 also constitute the "internal decoder" of the video encoder 20.
[0133] Images and image segmentation (images and blocks)
[0134] Encoder 20 is operable to receive, via input 201 or the like, an image (or image data) 17, for example, an image from a sequence of images forming a video or video sequence. The received image or image data may also be a pre-processed image (or pre-processed image data) 19. For simplicity, the following description uses image 17. Image 17 may also be referred to as a current image or image to be encoded (particularly when distinguishing the current image from other images in video encoding, such as previously encoded and / or decoded images in the same video sequence, i.e., a video sequence that also includes the current image).
[0135] A (digital) image is, or can be considered to be, a two-dimensional array or matrix of pixels with intensity values. The pixels in the array are also referred to as pixels (or pels, short for picture elements). The number of pixels in the array or image in the horizontal and vertical directions (or axes) determines the image size and / or resolution. To represent color, three color components are typically used, meaning that an image can be represented as or include three pixel arrays. In the RBG format or color space, an image includes corresponding arrays of red, green, and blue pixels. However, in video coding, each pixel is typically represented in a luma / chroma format or color space, such as YCbCr, which includes a luma component indicated by Y (sometimes also indicated by L) and two chroma components, indicated by Cb and Cr. The luma component Y represents the brightness or grayscale level intensity (for example, in grayscale images, both are the same), while the two chroma components (abbreviated as chroma) Cb and Cr represent the chroma or color information components. Accordingly, an image in YCbCr format includes a luma pixel array of luma pixel values (Y) and two chroma pixel arrays of chroma values (Cb and Cr). An image in RGB format can be converted or transformed into YCbCr format, and vice versa, a process also known as color conversion or transformation. If the image is black and white, the image may include only a luma pixel array. Accordingly, the image may be, for example, a luma pixel array in monochrome format or a luma pixel array and two corresponding chroma pixel arrays in 4:2:0, 4:2:2, and 4:4:4 color formats.
[0136] In one embodiment, an embodiment of the video encoder 20 may include an image segmentation unit (not shown in FIG. 2 ) for segmenting the image 17 into a plurality of (typically non-overlapping) image blocks 203. These blocks may also be referred to as root blocks, macroblocks (H.264 / AVC) or coding tree blocks (CTBs), or coding tree units (CTUs) in the H.265 / HEVC and VVC standards. The segmentation unit may be used to use the same block size for all images in a video sequence and a corresponding grid of defined block sizes, or to vary the block size between images or subsets or groups of images, and to segment each image into corresponding blocks.
[0137] In other embodiments, the video encoder may be configured to directly receive a block 203 of the image 17, for example, one, several or all blocks constituting the image 17. The image block 203 may also be referred to as a current image block or a coding unit to be encoded.
[0138] Like image 17, image block 203 is also or can be considered to be a two-dimensional array or matrix of pixels having intensity values (pixel values), but image block 203 is smaller than image 17. In other words, block 203 may include one pixel array (e.g., a luminance array in the case of monochrome image 17, or a luminance array or chrominance array in the case of a color image), or three pixel arrays (e.g., one luminance array and two chrominance arrays in the case of a color image 17), or any other number and / or type of arrays depending on the color format used. The number of pixels in the horizontal and vertical directions (or axes) of block 203 defines the size of block 203. Accordingly, a block may be an M×N (M columns×N rows) pixel array, or an M×N transform coefficient array, etc.
[0139] In one embodiment, the video encoder 20 shown in FIG. 2 is configured to encode the image 17 block by block, for example, performing encoding and prediction on each block 203 .
[0140] In one embodiment, the video encoder 20 shown in FIG2 may also be configured to partition and / or encode an image using slices (also referred to as video slices), wherein an image may be partitioned or encoded using one or more slices (typically non-overlapping). Each slice may include one or more blocks (e.g., coding tree units (CTUs)) or one or more groups of blocks, such as tiles in the H.265 / HEVC / VVC standard and bricks in the VVC standard.
[0141] In one embodiment, the video encoder 20 shown in Figure 2 can also be used to segment and / or encode an image using slices / coding block groups (also called video coding block groups) and / or coding blocks (also called video coding blocks), where the image can be segmented or encoded using one or more slices / coding block groups (usually non-overlapping), each slice / coding block group may include one or more blocks (e.g., CTUs) or one or more coding blocks, etc., where each coding block can be in a shape such as a rectangle and may include one or more complete or partial blocks (e.g., CTUs).
[0142] Residual calculation
[0143] The residual calculation unit 204 is used to calculate the residual block 205 (the prediction block 265 is described in detail later) based on the image block (or original block) 203 and the prediction block 265 in the following manner: for example, the pixel value of the prediction block 265 is subtracted from the pixel value of the image block 203 pixel by pixel (pixel by pixel) to obtain the residual block 205 in the pixel domain.
[0144] Transform
[0145] The transform processing unit 206 is configured to perform a discrete cosine transform (DCT) or a discrete sine transform (DST) on the pixel 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.
[0146] The transform processing unit 206 may be used to apply an integerized approximation of the DCT / DST, such as that specified for H.265 / HEVC. This integerized approximation is typically scaled by a factor compared to the orthogonal DCT transform. To maintain the norm of the residual block after both the forward and inverse transforms, additional scaling factors are used as part of the transform process. The scaling factors are typically selected based on certain constraints, such as whether the scaling factor is a power of two for the shift operation, the bit depth of the transform coefficients, and a trade-off between accuracy and implementation cost. For example, a specific scaling factor may be specified 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, a corresponding scaling factor may be specified for the forward transform at the encoder 20 side by the transform processing unit 206.
[0147] In one embodiment, the video encoder 20 (correspondingly, the transform processing unit 206) may be configured to output transform parameters such as one or more transform types, for example, directly output or output after being encoded or compressed by the entropy coding unit 270, such that the video decoder 30 may receive and use the transform parameters for decoding.
[0148] Quantification
[0149] The quantization unit 208 is configured to quantize the transform coefficients 207 by, for example, scalar quantization or vector quantization to obtain quantized transform coefficients 209 . The quantized transform coefficients 209 may also be referred to as quantized residual coefficients 209 .
[0150] The quantization process may reduce the bit depth associated with some or all of the transform coefficients 207. For example, during quantization, an n-bit transform coefficient may be rounded down to an m-bit transform coefficient, where n is greater than m. The degree of quantization may be modified by adjusting a quantization parameter (QP). For example, for scalar quantization, varying degrees of scaling may be applied to achieve finer or coarser quantization. A smaller quantization step size corresponds to finer quantization, while a larger quantization step size corresponds to coarser quantization. The appropriate quantization step size may be indicated by a quantization parameter (QP). For example, the quantization parameter may be an index into a predefined set of appropriate quantization step sizes. For example, a smaller quantization parameter may correspond to fine quantization (a smaller quantization step size), while a larger quantization parameter may correspond to coarse quantization (a larger quantization step size), or vice versa. Quantization may include dividing by the quantization step size, while the corresponding or inverse dequantization performed by the inverse quantization unit 210, etc., may include multiplying by the quantization step size. Embodiments according to some standards, such as HEVC, may be used to determine the quantization step size using the quantization parameter. Generally, the quantization step size may be calculated based on the quantization parameter using a fixed-point approximation of an equation involving division. Additional scaling factors can be introduced for quantization and dequantization to restore the norm of the residual block that may have been modified by the scaling used in the fixed-point approximation of the equations for the quantization step size and quantization parameter. In one exemplary implementation, the scaling of the inverse transform and dequantization can be combined. Alternatively, a custom quantization table can be used and indicated from the encoder to the decoder in the bitstream, etc. Quantization is a lossy operation, where larger quantization step sizes result in greater losses.
[0151] In one embodiment, the video encoder 20 (correspondingly, the quantization unit 208) may be configured to output a quantization parameter (QP), for example, directly or after being encoded or compressed by the entropy coding unit 270, such that the video decoder 30 may receive and use the quantization parameter for decoding.
[0152] Dequantization
[0153] The inverse quantization unit 210 is configured to perform inverse quantization performed by the quantization unit 208 on the quantized coefficients to obtain dequantized coefficients 211. For example, the inverse quantization scheme performed by the quantization unit 208 may be performed according to or using the same quantization step size as the quantization unit 208. The dequantized coefficients 211 may also be referred to as dequantized residual coefficients 211, and correspond to the transform coefficients 207. However, due to the loss caused by quantization, the dequantized coefficients 211 are generally not identical to the transform coefficients.
[0154] Inverse transform
[0155] The inverse transform processing unit 212 is configured to perform the inverse transform of the transform performed by the transform processing unit 206, such as an inverse discrete cosine transform (DCT) or an inverse discrete sine transform (DST), to obtain a reconstructed residual block 213 (or corresponding dequantized coefficients 213) in the pixel domain. The reconstructed residual block 213 may also be referred to as a transform block 213.
[0156] reconstruction
[0157] The reconstruction unit 214 (e.g., the summer 214) is used to add the transform block 213 (i.e., the reconstructed residual block 213) to the prediction block 265 to obtain the reconstructed block 215 in the pixel domain, for example, by adding the pixel point values of the reconstructed residual block 213 and the pixel point values of the prediction block 265.
[0158] Filtering
[0159] The loop filter unit 220 (or simply "loop filter" 220) is used to filter the reconstructed block 215 to obtain a filter block 221, or generally to filter the reconstructed pixels to obtain filtered pixel values. For example, the loop filter unit is used to smoothly perform pixel conversion or improve video quality. The loop filter unit 220 may include one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or one or more other filters, such as an adaptive loop filter (ALF), a noise suppression filter (NSF), or any combination thereof. For example, the loop filter unit 220 may include a deblocking filter, an SAO filter, and an ALF filter. The order of the filtering process can be a deblocking filter, an SAO filter, and an ALF filter. For another example, a process called luma mapping with chroma scaling (LMCS) (i.e., an adaptive in-loop reshaper) is added. This process is performed before deblocking. For another example, the deblocking filtering process can also be applied to internal sub-block edges, such as affine sub-block edges, ATMVP sub-block edges, sub-block transform (SBT) edges, and intra sub-partition (ISP) edges. Although the loop filter unit 220 is shown as a loop filter in FIG2 , in other configurations, the loop filter unit 220 can be implemented as a post-loop filter. The filter block 221 can also be referred to as a filter reconstruction block 221.
[0160] In one embodiment, the video encoder 20 (correspondingly, the loop filter unit 220) may be configured to output loop filter parameters (e.g., SAO filter parameters, ALF filter parameters, or LMCS parameters), for example, directly or after being entropy-encoded by the entropy coding unit 270, such that the decoder 30 may receive and use the same or different loop filter parameters for decoding.
[0161] Decoded Image Buffer
[0162] The 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 by any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. The decoded picture buffer 230 may be used to store one or more filter blocks 221. The decoded picture buffer 230 may also be used to store other previously filtered blocks of the same current picture or a different picture, such as a previously reconstructed picture, such as a previously reconstructed and filtered block 221, and may provide a complete previously reconstructed, i.e., decoded picture (and corresponding reference blocks and pixels) and / or a partially reconstructed current picture (and corresponding reference blocks and pixels), for example, for inter-frame prediction. The decoded image buffer 230 may also be used to store one or more unfiltered reconstructed blocks 215, or generally to store unfiltered reconstructed pixels, for example, reconstructed blocks 215 that have not been filtered by the loop filtering unit 220, or reconstructed blocks or reconstructed pixels that have not undergone any other processing.
[0163] Mode selection (segmentation and prediction)
[0164] The mode selection unit 260 includes a segmentation unit 262, an inter-frame prediction unit 244, and an intra-frame prediction unit 254, which are configured to receive or obtain original image data, such as an original block 203 (current block 203 of the current image 17) and reconstructed image data, such as filtered and / or unfiltered reconstructed pixels or reconstructed blocks of the same (current) image and / or one or more previously decoded images, from the decoded image buffer 230 or other buffer (e.g., a column buffer, not shown in FIG. 2). 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.
[0165] The mode selection unit 260 may be used to determine or select a partitioning for the current block (including no partitioning) and prediction mode (eg, intra-frame or inter-frame prediction mode), generate a corresponding prediction block 265 , and calculate the residual block 205 and reconstruct the reconstruction block 215 .
[0166] In one embodiment, the mode selection unit 260 may be configured to select a segmentation and prediction mode (e.g., from prediction modes supported or available by the mode selection unit 260) that provides the best match or minimum residual (minimum residual means better compression during transmission or storage), or provides minimum signaling overhead (minimum signaling overhead means better compression during transmission or storage), or simultaneously considers or balances both. The mode selection unit 260 may be configured to determine the segmentation and prediction mode based on rate distortion optimization (RDO), i.e., select the prediction mode that provides minimum rate distortion optimization. Terms such as "best," "lowest," and "optimal" herein do not necessarily refer to "best," "lowest," or "optimal" overall, but may also refer to situations where termination or selection criteria are met, e.g., values exceeding or falling below a threshold or other limit may result in a "suboptimal selection" but reduce complexity and processing time.
[0167] In other words, the partitioning unit 262 may be configured to partition an image in a video sequence into a sequence of coding tree units (CTUs), the CTU 203 being further partitioned into smaller block portions or sub-blocks (again forming blocks), e.g., by iteratively using quad-tree partitioning (QT), binary-tree partitioning (BT), or triple-tree partitioning (TT), or any combination thereof, and for, e.g., performing prediction on each of the block portions or sub-blocks, wherein the mode selection comprises selecting a tree structure for partitioning the block 203 and selecting a prediction mode to be applied to each of the block portions or sub-blocks.
[0168] The segmentation (eg, performed by segmentation unit 262) and prediction processes (eg, performed by inter-prediction unit 244 and intra-prediction unit 254) performed by video encoder 20 are described in detail below.
[0169] segmentation
[0170] The partitioning unit 262 can partition (or divide) an image block (or CTU) 203 into smaller parts, such as square or rectangular blocks. For an image with three pixel arrays, a CTU consists of N×N luminance pixel blocks and two corresponding chrominance pixel blocks. The maximum allowed size of a luminance block in a CTU is specified as 128×128 in the developing Universal Video Coding (VVC) standard, but may be specified to a value other than 128×128, such as 256×256, in the future. The CTUs of an image can be grouped / collected into slices / coding block groups, coding blocks, or bricks. A coding block covers a rectangular area of an image and can be divided into one or more bricks. A brick consists of multiple CTU rows within a coding block. A coding block that is not partitioned into multiple bricks can be called a brick. However, a brick is a true subset of a coding block and is therefore not called a coding block. VVC supports two coding block group modes: raster scan slice / coding block group mode and rectangular slice mode. In raster scan CBG mode, a slice / CBG contains a sequence of CBs from a raster scan of the CBs of an image. In rectangular slice mode, a slice contains multiple bricks of an image that together form a rectangular region of the image. The bricks within a rectangular slice are arranged in the slice's brick raster scan order. These smaller blocks (also called sub-blocks) can be further split into smaller parts. This is also known as tree partitioning or hierarchical tree partitioning, where a root block at, for example, root tree level 0 (hierarchy level 0, depth 0) can be recursively split into two or more blocks at the next lower tree level, such as nodes at tree level 1 (hierarchy level 1, depth 1). These blocks can be further split into two or more blocks at the next lower level, such as nodes at tree level 2 (hierarchy level 2, depth 2), and so on, until the partitioning is completed (because the end criteria are met, such as reaching the maximum tree depth or minimum block size). Blocks that are not further split are also called leaf blocks or leaf nodes of the tree. A tree divided into two parts is called a binary tree (BT), a tree divided into three parts is called a ternary tree (TT), and a tree divided into four parts is called a quadtree (QT).
[0171] For example, a coding tree unit (CTU) may be or include a CTB for luma pixels, two corresponding CTBs for chroma pixels of an image with a three-pixel array, or a CTB for pixels of a monochrome image, or a CTB for pixels of an image encoded using three independent color planes and syntax structures for encoding pixels. Accordingly, a coding tree block (CTB) may be an N×N block of pixels, where N may be set to a value such that the components are divided into CTBs, which is known as partitioning. A coding unit (CU) may be or include a coding block of luma pixels, two corresponding coding blocks for chroma pixels of an image with a three-pixel array, or a coding block of pixels of a monochrome image, or a coding block of pixels of an image encoded using three independent color planes and syntax structures for encoding pixels. Accordingly, a coding block (CB) may be an M×N block of pixels, where M and N may be set to a value such that the CTB is divided into coding blocks, which is known as partitioning.
[0172] For example, in an embodiment, according to HEVC, a coding tree unit (CTU) can be divided into multiple CUs using a quadtree structure represented as a coding tree. A decision is made at the leaf-CU level whether to use inter-frame (temporal) prediction or intra-frame (spatial) prediction to encode an image region. Each leaf-CU can be further divided into one, two, or four PUs according to the PU partition type. The same prediction process is used within a PU, and relevant information is transmitted to the decoder in units of PUs. After applying the prediction process according to the PU partition type to obtain a residual block, the leaf-CU can be divided into transform units (TUs) according to other quadtree structures similar to the coding tree for the CU.
[0173] For example, in an embodiment, according to the latest video coding standard currently under development (called Versatile Video Coding (VVC), a combined quadtree of nested multi-type trees (such as binary trees and ternary trees) is used to divide the segment structure for partitioning the coding tree unit. In the coding tree structure within the coding tree unit, the CU can be square or rectangular. For example, the coding tree unit (CTU) is first partitioned by the quadtree structure. The quadtree leaf nodes are further partitioned by the multi-type tree structure. The multi-type tree structure has four partition types: vertical binary tree partition (SPLIT_BT_VER), horizontal binary tree partition (SPLIT_BT_HOR), vertical ternary tree partition The tree nodes of the multi-type tree are called coding units (CUs), unless the CU is too large for the maximum transform length, in which case such segmentation is used for prediction and transform processing without any other splitting. In most cases, this means that the block sizes of CUs, PUs, and TUs in the coding block structure of the quadtree nested multi-type tree are the same. This exception occurs when the maximum supported transform length is less than the width or height of the color components of the CU. VVC has developed a unique signaling mechanism for the split partitioning information in the coding structure with quadtree nested multi-type trees. In the signaling mechanism, the coding The tree unit (CTU) as the root of the quadtree is first split by the quadtree structure. Then each quadtree leaf node (when large enough) is further split into a multi-type tree structure. In the multi-type tree structure, the first flag (mtt_split_cu_flag) is used to indicate whether the node is further split. When the node is further split, the second flag (mtt_split_cu_vertical_flag) is used to indicate the division direction, and the third flag (mtt_split_cu_binary_flag) is used to indicate whether the division is a binary tree division or a ternary tree division. According to mtt_split_c The values of u_vertical_flag and mtt_split_cu_binary_flag allow the decoder to derive the multi-type tree split mode (MttSplitMode) of the CU based on predefined rules or tables. It should be noted that for certain designs, such as the 64×64 luma block and 32×32 chroma pipeline design in the VVC hardware decoder, TT splitting is not allowed when the width or height of the luma coding block is greater than 64. TT splitting is also not allowed when the width or height of the chroma coding block is greater than 32. The pipeline design divides the image into multiple virtual pipeline data units (VPDUs), each of which is defined as a non-overlapping unit in the image. In the hardware decoder, consecutive VPDUs are processed simultaneously in multiple pipeline stages. In most pipeline stages, the VPDU size is roughly proportional to the buffer size, so it is desirable to keep the VPDU small.In most hardware decoders, the VPDU size can be set to the maximum transform block (TB) size. However, in VVC, the ternary tree (TT) and binary tree (BT) partitioning may increase the VPDU size.
[0174] In addition, it should be noted that when a part of the tree node block exceeds the bottom or the right boundary of the image, the tree node block is forcibly divided until all pixels of each coding CU are located within the image boundary.
[0175] For example, the intra sub-partitions (ISP) tool may vertically or horizontally divide the luma intra prediction block into two or four sub-partitions according to the block size.
[0176] In one example, mode select unit 260 of video encoder 20 may be used to perform any combination of the segmentation techniques described above.
[0177] As described above, the video encoder 20 is configured to determine or select the best or optimal prediction mode from a (predetermined) set of prediction modes. The set of prediction modes may include, for example, intra-frame prediction modes and / or inter-frame prediction modes.
[0178] Intra-frame prediction
[0179] The intra prediction mode set may include 35 different intra prediction modes, for example, non-directional modes like DC (or mean) mode and planar mode, or directional modes as defined in HEVC, or may include 67 different intra prediction modes, for example, non-directional modes like DC (or mean) mode and planar mode, or directional modes as defined in VVC. For example, several traditional angle intra prediction modes are adaptively replaced by wide-angle intra prediction modes for non-square blocks defined in VVC. For another example, in order to avoid the division operation of DC prediction, only the longer side is used to calculate the average value of the non-square block. In addition, the intra prediction result of the planar mode can also be modified using the position dependent intra prediction combination (PDPC) method.
[0180] The intra prediction unit 254 is configured to generate an intra prediction block 265 using reconstructed pixels of adjacent blocks of the same current image according to an intra prediction mode in the intra prediction mode set.
[0181] The intra-frame prediction unit 254 (or generally the mode selection unit 260) is also used to output intra-frame prediction parameters (or generally information indicating the selected intra-frame prediction mode for the block) in the form of syntax elements 266 to the entropy coding unit 270 for inclusion in the encoded image data 21, so that the video decoder 30 can perform operations, such as receiving and using the prediction parameters for decoding.
[0182] The intra prediction modes in HEVC include DC prediction mode, plane prediction mode and 33 angular prediction modes, with a total of 35 candidate prediction modes. The current block can use the pixels of the reconstructed image blocks on the left and above as references for intra prediction. The image blocks in the surrounding area of the current block used for intra prediction of the current block are called reference blocks, and the pixels in the reference blocks are called reference pixels. Among the 35 candidate prediction modes, the DC prediction mode is applicable to areas with flat textures in the current block. All pixels in this area use the average value of the reference pixels in the reference block as prediction; the plane prediction mode is applicable to image blocks with smoothly changing textures. The current block that meets this condition uses the reference pixels in the reference block for bilinear interpolation as the prediction of all pixels in the current block; the angular prediction mode uses the characteristic that the texture of the current block is highly correlated with the texture of the adjacent reconstructed image blocks, and copies the values of the reference pixels in the corresponding reference block along a certain angle as the prediction of all pixels in the current block.
[0183] The HEVC encoder selects an optimal intra-frame prediction mode for the current block from 35 candidate prediction modes and writes this optimal intra-frame prediction mode into the video bitstream. To improve the coding efficiency of intra-frame prediction, the encoder / decoder derives three most probable modes from the optimal intra-frame prediction modes of the reconstructed image blocks in the surrounding area using intra-frame prediction. If the optimal intra-frame prediction mode selected for the current block is one of these three most probable modes, a first index is encoded to indicate that the selected optimal intra-frame prediction mode is one of these three most probable modes; if the selected optimal intra-frame prediction mode is not one of these three most probable modes, a second index is encoded to indicate that the selected optimal intra-frame prediction mode is one of the other 32 modes (other than the aforementioned three most probable modes among the 35 candidate prediction modes). The HEVC standard uses a 5-bit fixed-length code as the aforementioned second index.
[0184] The HEVC encoder derives the three most probable modes by selecting the optimal intra-frame prediction mode of the image block to the left and the image block above the current block and adding them to a set. If these two optimal intra-frame prediction modes are the same, only one is retained in the set. If these two optimal intra-frame prediction modes are the same and both are angular prediction modes, two angular prediction modes adjacent to the angular direction are selected and added to the set. Otherwise, the planar prediction mode, the DC mode, and the vertical prediction mode are selected and added to the set in sequence until the number of modes in the set reaches three.
[0185] After the HEVC decoder performs entropy decoding on the bitstream, it obtains the mode information of the current block, which includes an indicator indicating whether the optimal intra-frame prediction mode of the current block is among the three most probable modes, and the index of the optimal intra-frame prediction mode of the current block among the three most probable modes or the index of the optimal intra-frame prediction mode of the current block among the other 32 modes.
[0186] Inter-frame prediction
[0187] In a possible implementation, the set of inter-frame prediction modes depends on the available reference image (i.e., at least a portion of the previously decoded image stored in DBP230 as mentioned above) and other inter-frame prediction parameters, for example, on whether the entire reference image is used or only a part of the reference image is used, such as a search window area around the area of the current block, to search for the best matching reference block, and / or on whether pixel interpolation such as half-pixel, quarter-pixel and / or 1 / 16 interpolation is performed.
[0188] In addition to the above prediction modes, skip mode and / or direct mode may also be employed.
[0189] For example, in extended merge prediction, the merge candidate list of this mode consists of the following five candidate types in order: spatial MVP from spatially neighboring CUs, temporal MVP from collocated CUs, history-based MVP from the FIFO table, pairwise average MVP, and zero MV. Decoder-side motion vector refinement (DMVR) based on bilateral matching can be used to increase the accuracy of the MV in merge mode. Merge mode with MVD (MMVD) is derived from merge mode with motion vector difference. The MMVD flag is sent immediately after the skip flag and merge flag to specify whether the CU uses MMVD mode. A CU-level adaptive motion vector resolution (AMVR) scheme can be used. AMVR supports encoding the CU's MVD with different precisions. The MVD of the current CU is adaptively selected based on the prediction mode of the current CU. When the CU is encoded in merge mode, the combined inter / intra prediction (CIIP) mode can be applied to the current CU. The CIIP prediction is obtained by weighted averaging the inter and intra prediction signals. For affine motion compensation prediction, the affine motion field of the block is described by the motion information of 2 control points (4 parameters) or 3 control points (6 parameters) motion vectors. Subblock-based temporal motion vector prediction (SbTMVP) is similar to the temporal motion vector prediction (TMVP) in HEVC, but it predicts the motion vector of the sub-CU within the current CU. Bidirectional optical flow (BDOF), formerly known as BIO, is a simplified version that reduces calculations, especially in terms of the number of multiplications and the size of the multipliers. In the triangle partitioning mode, the CU is evenly divided into two triangular parts using diagonal partitioning and anti-diagonal partitioning. In addition, the bidirectional prediction mode is extended based on the simple average to support the weighted average of the two prediction signals.
[0190] The inter-frame prediction unit 244 may include a motion estimation (ME) unit and a motion compensation (MC) unit (both not shown in FIG. 2 ). The motion estimation unit may be configured to receive or obtain an image block 203 (the current image block 203 of the current image 17 ) and a decoded image 231 , or at least one or more previously reconstructed blocks, e.g., reconstructed blocks of one or more other / different previously decoded images 231 , to perform motion estimation. For example, a video sequence may include the current image and the previously decoded image 231 , or in other words, the current image and the previously decoded image 231 may be part of or form a sequence of images forming the video sequence.
[0191] For example, the encoder 20 may be configured to select a reference block from a plurality of reference blocks of the same or different images among a plurality of other images, and provide the reference image (or reference image index) and / or the offset (spatial offset) between the position (x, y coordinates) of the reference block and the position of the current block as an inter-frame prediction parameter to the motion estimation unit. This offset is also referred to as a motion vector (MV).
[0192] The motion compensation unit is configured to obtain, for example, receive, inter-frame prediction parameters and perform inter-frame prediction based on or using the inter-frame prediction parameters to obtain an inter-frame prediction block 246. The motion compensation performed by the motion compensation unit may include extracting or generating a prediction block based on a motion / block vector determined by motion estimation, and may also include performing interpolation with sub-pixel accuracy. Interpolation filtering can generate pixel points of other pixels from pixel points of known pixels, thereby potentially increasing the number of candidate prediction blocks that can be used to encode the image block. Upon receiving a motion vector corresponding to a PU of the current image block, the motion compensation unit may locate the prediction block pointed to by the motion vector in one of the reference picture lists.
[0193] The motion compensation unit may also generate syntax elements associated with blocks and video slices for use by video decoder 30 when decoding image blocks of a video slice. In addition to, or in lieu of, slices and corresponding syntax elements, coding block groups and / or coding blocks and corresponding syntax elements may be generated or used.
[0194] In the process of obtaining a candidate motion vector list in an advanced motion vector prediction (AMVP) mode, motion vectors (MVs) that can be added to the candidate motion vector list as alternatives include MVs of spatially and temporally adjacent image blocks of a current block, wherein the MVs of spatially adjacent image blocks can further include the MV of a left candidate image block located to the left of the current block and the MV of an upper candidate image block located above the current block. For example, please refer to FIG. 4 , which is an exemplary schematic diagram of candidate image blocks provided in an embodiment of the present application. As shown in FIG. 4 , the set of left candidate image blocks includes {A0, A1}, the set of upper candidate image blocks includes {B0, B1, B2}, and the set of temporally adjacent candidate image blocks includes {C, T}. All three sets can be added to the candidate motion vector list as alternatives. However, according to existing coding standards, the maximum length of the candidate motion vector list for AMVP is 2. Therefore, it is necessary to determine the MVs of up to two image blocks to be added to the candidate motion vector list from the three sets according to a prescribed order. The order may be to give priority to the set of candidate image blocks {A0, A1} to the left of the current block (consider A0 first, and then consider A1 if A0 is not available), then consider the set of candidate image blocks {B0, B1, B2} above the current block (consider B0 first, and then consider B1 if B0 is not available, and then consider B2 if B1 is not available), and finally consider the set of candidate image blocks {C, T} that are adjacent to the current block in the time domain (consider T first, and then consider C if T is not available).
[0195] After obtaining the candidate motion vector list, the optimal MV is determined from the candidate motion vector list using the rate distortion cost (RD cost). The candidate motion vector with the smallest RD cost is used as the motion vector predictor (MVP) for the current block. The rate distortion cost is calculated using the following formula: J = SAD + λR
[0196] Wherein, J represents RD cost, SAD is the sum of absolute differences (SAD) between the pixel values of the predicted block obtained after motion estimation using the candidate motion vector and the pixel values of the current block, R represents the bit rate, and λ represents the Lagrange multiplier.
[0197] The encoder passes the index of the determined MVP in the candidate motion vector list to the decoder. Furthermore, a motion search can be performed within a neighborhood centered on the MVP to obtain the actual motion vector of the current block. The encoder calculates the motion vector difference (MVD) between the MVP and the actual motion vector and also passes the MVD to the decoder. The decoder parses the index, finds the corresponding MVP in the candidate motion vector list based on the index, parses the MVD, and adds the MVD to the MVP to obtain the actual motion vector of the current block.
[0198] When obtaining the candidate motion information list in Merge mode, the motion information that can be added to the candidate motion information list includes the motion information of spatially or temporally adjacent image blocks to the current block. For spatially and temporally adjacent image blocks, refer to Figure 4. The spatially adjacent candidate motion information in the candidate motion information list comes from five spatially adjacent blocks (A0, A1, B0, B1, and B2). If the spatially adjacent blocks are unavailable or are intra-predicted, their motion information is not added to the candidate motion information list. The temporal candidate motion information for the current block is obtained by scaling the MV of the corresponding block in the reference frame based on the picture order count (POC) of the reference frame and the current frame. The block at position T in the reference frame is first determined to be available. If not, the block at position C is selected. After obtaining the candidate motion information list, the optimal motion information from the candidate motion information list is determined using the RD cost as the motion information for the current block. The encoder transmits the index of the optimal motion information in the candidate motion information list (denoted as the merge index) to the decoder.
[0199] Entropy Coding
[0200] The entropy coding unit 270 is configured to apply an entropy coding algorithm or scheme (e.g., a variable length coding (VLC) scheme, a context adaptive VLC (CALVC) scheme, 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) coding, or other entropy coding methods or techniques) to the quantized residual coefficients 209, inter-frame prediction parameters, intra-frame prediction parameters, loop filter parameters, and / or other syntax elements, resulting in coded image data 21 that can be output via an output terminal 272 in the form of a coded bitstream 21, etc., so that the video decoder 30, etc. can receive and use the parameters for decoding. The coded bitstream 21 can be transmitted to the video decoder 30 or stored in a memory for later transmission or retrieval by the video decoder 30.
[0201] Other structural variations of the video encoder 20 may be used to encode the video stream. For example, a non-transform-based encoder 20 may directly quantize the residual signal without a transform processing unit 206 for certain blocks or frames. In another implementation, the encoder 20 may have the quantization unit 208 and the inverse quantization unit 210 combined into a single unit.
[0202] Decoder and decoding method
[0203] As shown in FIG3 , a video decoder 30 is configured to receive coded image data 21 (e.g., a coded bitstream 21) coded by, for example, an encoder 20, and obtain a decoded image 331. The coded image data or bitstream includes information for decoding the coded image data, such as data representing image blocks of a coded video slice (and / or coding block group or coding block) and related syntax elements.
[0204] 3 , decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transform processing unit 312, a reconstruction unit 314 (e.g., summer 314), a loop filter 320, a decoded picture buffer (DBP) 330, a mode application unit 360, an inter-prediction unit 344, and an intra-prediction unit 354. Inter-prediction unit 344 may be or include a motion compensation unit. In some examples, video decoder 30 may perform a decoding process that is generally the reverse of the encoding process described with reference to video encoder 100 of FIG. 2 .
[0205] As described with respect to encoder 20, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, loop filter 220, decoded picture buffer DPB 230, inter-prediction unit 344, and intra-prediction unit 354 also constitute the "built-in decoder" of video encoder 20. Accordingly, inverse quantization unit 310 may be functionally identical to inverse quantization unit 110, inverse transform processing unit 312 may be functionally identical to inverse transform processing unit 122, reconstruction unit 314 may be functionally identical to reconstruction unit 214, loop filter 320 may be functionally identical to loop filter 220, and decoded picture buffer 330 may be functionally identical to decoded picture buffer 230. Therefore, the explanations of the corresponding units and functions of video encoder 20 apply accordingly to the corresponding units and functions of video decoder 30.
[0206] Entropy decoding
[0207] The entropy decoding unit 304 is configured to parse the bitstream 21 (or generally, the encoded image data 21) and perform entropy decoding on the encoded image data 21 to obtain quantization coefficients 309 and / or decoded coding parameters (not shown in FIG. 3 ), such as any or all of inter-frame prediction parameters (e.g., reference image indices and motion vectors), intra-frame prediction parameters (e.g., intra-frame prediction modes or indices), transform parameters, quantization parameters, loop filter parameters, and / or other syntax elements. The entropy decoding unit 304 may be configured to apply a decoding algorithm or scheme corresponding to the coding scheme of the entropy coding unit 270 of the encoder 20. The entropy decoding unit 304 may also be configured to provide inter-frame prediction parameters, intra-frame prediction parameters, and / or other syntax elements to the mode application unit 360, as well as to provide other parameters to other units of the decoder 30. The video decoder 30 may receive syntax elements at the video slice and / or video block level. In addition to, or in lieu of, slices and corresponding syntax elements, coding block groups and / or coding blocks and corresponding syntax elements may also be received or used.
[0208] Dequantization
[0209] The inverse quantization unit 310 may be configured to receive a quantization parameter (QP) (or generally information related to inverse quantization) and quantization coefficients from the encoded image data 21 (e.g., parsed and / or decoded by the entropy decoding unit 304), and inverse quantize the decoded quantization coefficients 309 based on the quantization parameter to obtain inverse quantization coefficients 311, which may also be referred to as transform coefficients 311. The inverse quantization process may include using the quantization parameter calculated by the video encoder 20 for each video block in the video slice to determine a degree of quantization, and thus a degree of inverse quantization to be performed.
[0210] Inverse transform
[0211] The inverse transform processing unit 312 may be configured to receive the 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 (e.g., parsed and / or decoded by the entropy decoding unit 304) to determine the transform to be applied to the dequantized coefficients 311.
[0212] reconstruction
[0213] The reconstruction unit 314 (eg, summer 314 ) is configured to add the reconstructed residual block 313 to the prediction block 365 to obtain the reconstructed block 315 in the pixel domain, eg, by adding the pixel values of the reconstructed residual block 313 and the pixel values of the prediction block 365 .
[0214] Filtering
[0215] The loop filter unit 320 (in or after the encoding loop) is used to filter the reconstructed block 315 to obtain a filter block 321, thereby smoothly performing pixel conversion or improving video quality. The loop filter unit 320 may include one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or one or more other filters, such as an adaptive loop filter (ALF), a noise suppression filter (NSF), or any combination. For example, the loop filter unit 220 may include a deblocking filter, an SAO filter, and an ALF filter. The order of the filtering process can be a deblocking filter, an SAO filter, and an ALF filter. For another example, a process called luma mapping with chroma scaling (LMCS) (i.e., an adaptive in-loop reshaper) is added. This process is performed before deblocking. For another example, the deblocking filtering process can also be applied to internal sub-block edges, such as affine sub-block edges, ATMVP sub-block edges, sub-block transform (SBT) edges, and intra sub-partition (ISP) edges. Although the loop filter unit 320 is shown as a loop filter in Figure 3, in other configurations, the loop filter unit 320 can be implemented as a post-loop filter.
[0216] Decoded Image Buffer
[0217] The decoded video blocks 321 of one picture are then stored in a decoded picture buffer 330 which stores the decoded picture 331 as a reference picture for subsequent motion compensation of other pictures and / or for respective output displays.
[0218] The decoder 30 is used to output the decoded image 311 through the output terminal 312, etc., for display to the user or for the user to view.
[0219] predict
[0220] The inter-frame prediction unit 344 may be functionally identical to the inter-frame prediction unit 244 (particularly the motion compensation unit), and the intra-frame prediction unit 354 may be functionally identical to the inter-frame prediction unit 254 and may determine the partitioning or segmentation and perform prediction based on the segmentation and / or prediction parameters or corresponding information received from the coded image data 21 (e.g., parsed and / or decoded by the entropy decoding unit 304). The mode application unit 360 may be configured to perform prediction (intra-frame or inter-frame prediction) for each block based on the reconstructed image, block, or corresponding pixel point (filtered or unfiltered), resulting in a prediction block 365.
[0221] When the video slice is encoded as an intra-coded (I) slice, the intra-prediction unit 354 in the mode application unit 360 is configured to generate a prediction block 365 for the image block of the current video slice based on the indicated intra-prediction mode and data from previously decoded blocks of the current image. When the video image is encoded as an inter-coded (i.e., B or P) slice, the inter-prediction unit 344 (e.g., a motion compensation unit) in the mode application unit 360 is configured to generate a prediction block 365 for the video block of the current video slice based on the motion vector and other syntax elements received from the entropy decoding unit 304. For inter-prediction, these prediction blocks can be generated from one of the reference pictures in one of the reference picture lists. The video decoder 30 can construct reference frame list 0 and list 1 using a default construction technique based on the reference pictures stored in the DPB 330. The same or similar processes may be applied to embodiments of coding block groups (e.g., video coding block groups) and / or coding blocks (e.g., video coding blocks) in addition to or instead of slices (e.g., video slices), e.g., video may be encoded using I, P, or B coding block groups and / or coding blocks.
[0222] Mode application unit 360 is configured to determine prediction information for video blocks of a current video slice by parsing motion vectors and other syntax elements, and to use the prediction information to generate a prediction block for the current video block being decoded. For example, mode application unit 360 uses received syntax elements to determine a prediction mode (e.g., intra prediction or inter prediction) used to encode the video blocks of the video slice, an inter-prediction slice type (e.g., a B slice, a P slice, or a GPB slice), construction information for one or more reference picture lists for the slice, a motion vector for each inter-coded video block in the slice, an inter-prediction state for each inter-coded video block in the slice, and other information to decode the video blocks within the current video slice. In addition to or in lieu of slices (e.g., video slices), the same or similar processes may be applied to embodiments of coding block groups (e.g., video coding block groups) and / or coding blocks (e.g., video coding blocks), for example, video may be encoded using I, P, or B coding block groups and / or coding blocks.
[0223] In one embodiment, the video encoder 30 of FIG3 may also be configured to partition and / or decode an image using slices (also referred to as video slices), where an image may be partitioned or decoded using one or more (typically non-overlapping) slices. Each slice may include one or more blocks (e.g., CTUs) or one or more groups of blocks (e.g., coding blocks in the H.265 / HEVC / VVC standard and bricks in the VVC standard).
[0224] In one embodiment, the video decoder 30 shown in Figure 3 can also be used to segment and / or decode an image using slices / coding block groups (also called video coding block groups) and / or coding blocks (also called video coding blocks), where the image can be segmented or decoded using one or more slices / coding block groups (usually non-overlapping), each slice / coding block group may include one or more blocks (e.g., CTUs) or one or more coding blocks, etc., where each coding block can be in a shape such as a rectangle and may include one or more complete or partial blocks (e.g., CTUs).
[0225] Other variations of the video decoder 30 may be used to decode the encoded image data 21. For example, the decoder 30 may generate an output video stream without the loop filter unit 320. For example, a non-transform-based decoder 30 may directly inverse quantize the residual signal without the inverse transform processing unit 312 for certain blocks or frames. In another implementation, the video decoder 30 may have the inverse quantization unit 310 and the inverse transform processing unit 312 combined into a single unit.
[0226] It should be understood that the processing result of the current step can be further processed in the encoder 20 and the decoder 30 and then output to the next step. For example, after interpolation filtering, motion vector derivation, or loop filtering, the processing result of interpolation filtering, motion vector derivation, or loop filtering can be further operated on, such as clipping or shifting operations.
[0227] It should be noted that further operations can be performed on the derived motion vector of the current block (including but not limited to the control point motion vector of the affine mode, the sub-block motion vector of the affine, planar, ATMVP mode, the temporal motion vector, etc.). For example, the value of the motion vector is limited to a predefined range based on the representation bit 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 bitDepth is set to 16, the range is -32768 to 32767; if bitDepth is set to 18, the range is -131072 to 131071. For example, the value of the derived motion vector (e.g., the MV of four 4×4 sub-blocks in an 8×8 block) is limited so that the maximum difference between the integer parts of the four 4×4 sub-block MVs does not exceed N pixels, for example, not more than 1 pixel. Two methods of limiting the motion vector based on bitDepth are provided here.
[0228] Although the above embodiments primarily describe video coding, it should be noted that embodiments of the decoding system 10, encoder 20, and decoder 30, as well as other embodiments described herein, may also be used for still image processing or coding, i.e., processing or coding a single image in a video codec that is independent of any previous or subsequent images. In general, if image processing is limited to a single image 17, the inter-frame prediction unit 244 (encoder) and the inter-frame prediction unit 344 (decoder) may not be available. All other functionalities (also referred to as tools or techniques) of the video encoder 20 and video decoder 30, such as residual calculation 204 / 304, transform 206, quantization 208, inverse quantization 210 / 310, (inverse) transform 212 / 312, segmentation 262 / 362, intra-frame prediction 254 / 354, and / or loop filtering 220 / 320, entropy coding 270, and entropy decoding 304, may also be used for still image processing.
[0229] Please refer to Figure 5, which is an exemplary block diagram of a video decoding device 500 provided in an embodiment of the present application. Video decoding device 500 is suitable for implementing the disclosed embodiments described herein. In one embodiment, video decoding device 500 can be a decoder, such as the video decoder 30 in Figure 1a, or an encoder, such as the video encoder 20 in Figure 1a.
[0230] Video decoding device 500 includes: an input port 510 (or input port 510) and a receiver unit (Rx) 520 for receiving data; a processor, logic unit, or central processing unit (CPU) 530 for processing data; for example, processor 530 may be a neural network processor 530; a transmitter unit (Tx) 540 and an output port 550 (or output port 550) for transmitting data; and a memory 560 for storing data. Video decoding device 500 may also include optical-to-electrical (OE) components and electrical-to-optical (EO) components coupled to input port 510, receiver unit 520, transmitter unit 540, and output port 550 for outputting or transmitting optical or electrical signals.
[0231] The processor 530 is implemented in hardware and software. The processor 530 can be implemented as one or more processor chips, cores (e.g., multi-core processors), FPGAs, ASICs, and DSPs. The processor 530 communicates with the input port 510, the receiving unit 520, the transmitting unit 540, the output port 550, and the memory 560. The processor 530 includes a decoding module 570 (e.g., a neural network-based decoding module 570). The decoding module 570 implements the embodiments disclosed above. For example, the decoding module 570 performs, processes, prepares, or provides various encoding operations. Therefore, the decoding module 570 provides substantial improvements to the functionality of the video decoding device 500 and affects the switching of the video decoding device 500 to different states. Alternatively, the decoding module 570 is implemented by instructions stored in the memory 560 and executed by the processor 530.
[0232] Memory 560 includes one or more disks, tape drives, and solid-state drives and can be used as overflow data storage for storing programs when such programs are selected for execution, and for storing instructions and data read during program execution. Memory 560 can be volatile and / or non-volatile and can be read-only memory (ROM), random access memory (RAM), ternary content-addressable memory (TCAM), and / or static random-access memory (SRAM).
[0233] Please refer to FIG. 6 , which 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 .
[0234] The processor 602 in the apparatus 600 may be a central processing unit. Alternatively, the processor 602 may be any other type of device or devices, now available or developed in the future, capable of manipulating or processing information. While the disclosed implementations may be implemented using a single processor, such as the processor 602 shown, using more than one processor may provide greater speed and efficiency.
[0235] In one implementation, the memory 604 in the 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 the memory 604. The memory 604 may include code and data 606 that are accessed by the processor 602 via a bus 612. The memory 604 may also include an operating system 608 and application programs 610, which include at least one program that allows the processor 602 to perform the methods described herein. For example, the application programs 610 may include applications 1 through N, as well as a video decoding application that performs the methods described herein.
[0236] The apparatus 600 may also include one or more output devices, such as a display 618. In one example, the display 618 may be a touch-sensitive display that combines a display with touch-sensitive elements that can be used to sense touch input. The display 618 may be coupled to the processor 602 via the bus 612.
[0237] Although bus 612 in device 600 is described herein as a single bus, bus 612 may include multiple buses. Furthermore, secondary storage may be directly coupled to other components of device 600 or accessed via a network, and may include a single integrated unit such as a memory card or multiple units such as multiple memory cards. Thus, device 600 may have a variety of configurations.
[0238] In compression scenarios, the input image can be divided into multiple stripes, and each stripe is then encoded. The input image resolution and stripe division are often determined by product requirements, so the image resolution may not necessarily meet the required number of stripes. In order for the encoder and decoder to continue to work properly under this input condition, the input image needs to be padded before encoding so that it can be divided into the required integer number of stripes. The padded image is then encoded and transmitted, and the bitstream is decoded by the decoder to obtain a reconstructed image. Finally, the reconstructed image is cropped to remove the padded area and restore the original resolution.
[0239] In the related art, the subjective qualities of different strips in the padded image may be different, which may cause uneven subjective quality of the padded image.
[0240] To this end, an embodiment of the present application provides a coding method that can balance the subjective quality of a padded image. The coding method is applicable to a coding system, and FIG7 shows a possible form of the coding system.
[0241] As shown in FIG7 , the encoding system includes: an image filling module 701 , a partitioning module 702 , a prediction module 703 , a quantization module 704 , an entropy encoding module 705 and a bit rate control module 706 .
[0242] The image to be encoded input into the encoding system is padded, and the padded image is divided into coding units (also called coding blocks or image blocks). After input into the encoder, it passes through coding modules such as prediction, quantization, and entropy coding, and finally outputs the bit stream (bit stream) corresponding to the coding unit. The bit streams of all coding units are concatenated to obtain the bit stream corresponding to the entire image.
[0243] The image padding module 701 is used to perform image padding on the input image to be encoded.
[0244] The division module 702 is configured to divide the padded image into coding units.
[0245] The prediction module 703 is used to predict the coding unit.
[0246] The quantization module 704 is configured to quantize the coding unit according to the quantization parameter.
[0247] The entropy coding module 705 is configured to perform entropy coding on the coding unit. In addition, the entropy coding module 705 can also obtain the number of coding bits according to the coding unit.
[0248] In a possible implementation, the entropy coding module 705 may perform fixed-length coding on the fully padded coding unit according to the set code length Bpppad.
[0249] The bit rate control module 706 is configured to adjust the output bit rate. For example, the bit rate control module 706 may adjust the output bit rate according to the number of coding bits, the number of padding bits, and the image content.
[0250] As shown in FIG8 , the encoding system may further include an adjustment unit 707 .
[0251] The adjusting unit 707 is configured to adjust the compression performance of the coding unit. For example, the adjusting unit 707 may adjust the compression performance of the coding unit by using a bit padding number.
[0252] FIG9 shows an encoding method provided by an embodiment of the present application. As shown in FIG9 , the method includes:
[0253] S901: Perform image padding on the image to be encoded to obtain a padded image.
[0254] In one possible implementation, the image to be encoded can be first divided into multiple strips. Then, N columns of samples are padded at the right edge of the last column of the strip to be encoded to obtain a padded image. N is a positive integer. A sample can be understood as an image pixel, and a strip is composed of multiple samples.
[0255] It can be understood that, compared with performing image padding on each strip, performing image padding only on the last column of strips of the image can reduce the hardware implementation cost and power consumption of image padding.
[0256] In one possible implementation, N columns of samples may be padded at the right edge of the last column of the image to be encoded, and M columns of samples may be padded at the bottom edge of the last row of the image to obtain a padded image. Here, N and M are both positive integers.
[0257] Exemplarily, as shown in FIG10 , the image to be encoded can be first divided into 12 strips. Assuming that the total number of columns that need to be filled horizontally for an image is N and the total number of columns that need to be filled vertically is M, then N columns of samples can be filled at the right boundary of the last column of the image strip to obtain a padded image, and the filling method is to copy the nearest valid sample column on the left. Among them, in addition to the above-mentioned copying of the nearest valid sample column, the filling method can also be the default value (agreed value) filling, or it can be copying the valid sample column at other positions. Then, M columns of samples are filled at the lower boundary of the last row of the image strip, and the filling method is the default value filling. Among them, in addition to the above-mentioned filling of the default value, the filling method can also be to copy the valid sample row above.
[0258] S902: Obtain a coding unit according to the padded image.
[0259] The specific implementation method of obtaining the coding unit based on the padded image can be any method that can be thought of by those skilled in the art, and the embodiments of the present application are not limited thereto. For example, each strip obtained by dividing the padded image can be divided into one or more coding units for encoding.
[0260] S903: Determine the coding information of the coding unit according to the full padding information of the coding unit.
[0261] The full padding information is used to indicate whether all samples in the coding unit are image padding samples, and the coding information includes at least one of the number of padding bits or the encoding code length. The image padding samples are samples obtained by image padding.
[0262] In a possible implementation, the full padding information is used to further indicate whether the coding unit is located in a target stripe of the padded image, where the target stripe is horizontal to the padded stripe of the image.
[0263] In a possible implementation, the full padding information may be represented by a full padding flag bit PadFlag.
[0264] For example, if all samples in the current coding unit are obtained by padding, the complete padding flag of the current coding unit is 1; otherwise, the complete padding flag of the current coding unit is 0.
[0265] That is, if the complete filling flag of the coding unit is 1, it indicates that all samples in the coding unit are image filling samples; if the complete filling flag of the coding unit is 0, it indicates that not all samples in the coding unit are image filling samples.
[0266] For another example, if all samples in the current coding unit are obtained by padding and the current coding unit is located in a slice that performs horizontal padding, the complete padding flag of the current coding unit is 1; otherwise, the complete padding flag of the current coding unit is 0.
[0267] That is, the complete filling flag of the coding unit is 1, indicating that all samples in the coding unit are image filling samples and the coding unit is located in a horizontal image filling strip; the complete filling flag of the coding unit is 0, indicating that not all samples in the coding unit are image filling samples and / or the coding unit is not located in a horizontal image filling strip.
[0268] In a possible implementation, the above-mentioned number of filling bits can be determined based on the actual number of bits of the above-mentioned coding unit and the first preset number of bits when the above-mentioned coding unit is a target coding unit. The above-mentioned target coding unit is a coding unit in which all samples are image filling samples, and the above-mentioned actual number of bits is the bits of the code stream to be filled corresponding to the above-mentioned coding unit.
[0269] Exemplarily, when the full padding information of the coding unit indicates whether all samples in the coding unit are image padding samples (i.e., the full padding flag of the coding unit is 1), the number of padding bits can be determined based on the actual number of bits of the coding unit and the first preset number of bits.
[0270] Optionally, the number of padding bits BitsGap may satisfy: BitsGap=Max(X0-BCU, 0).
[0271] Where BCU is the number of bits in the codestream to be filled corresponding to the coding unit (i.e., the actual number of coded bits obtained after encoding the current coding block), and X0 is the first preset number of bits (i.e., the total number of bits in the bitstream corresponding to the coding unit when the fully filled flag is 1). The value of X0 can be obtained by multiplying the original number of bits in the input coding unit by the target compression ratio, or it can be adjusted based on the header information overhead and coding margin.
[0272] It can be seen that in the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full padding information of the coding unit, and then the coding unit is encoded to generate a code stream using the coding information. In this way, the fully padded coding unit in the strip can be determined using the full padding information, and then the number of padding bits can be determined based on the actual number of bits of the coding unit and the first preset number of bits. Thereafter, bits are padded according to the number of padding bits in the initial code stream generated by the fully padded coding unit (i.e., the code stream to be padded), so that the number of coding bits is increased, thereby reducing the number of coding bits of the non-fully padded coding unit in the strip, thereby reducing the difference between the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, avoiding uneven subjective quality of the padded image, and thus making the subjective quality of the padded image balanced.
[0273] It is worth mentioning that, when the above coding unit is a non-target coding unit, the number of padding bits can be determined to be 0, that is, the code stream of the non-target coding unit is not padded. The number of padding bits can also be determined in other ways, which are not limited in this embodiment of the present application.
[0274] In a possible implementation, the encoding code length can be determined based on the header information overhead of the encoding unit, the second preset number of bits and the number of samples of the encoding unit when the encoding unit is a target encoding unit, and the target encoding unit is an encoding unit in which all samples are image padding samples.
[0275] Exemplarily, when the full padding information of the coding unit indicates whether all samples in the above coding unit are image padding samples (that is, the full padding flag of the coding unit is 1), the above encoding code length can be determined based on the header information overhead of the above coding unit, the second preset number of bits and the number of samples in the above coding unit.
[0276] Optionally, the encoding code length Bpppad may satisfy: Bpppad = (X1-X2) / Cusize.
[0277] Among them, X1 is the second preset number of bits (that is, the total number of bits of the bit stream corresponding to the fully filled coding unit), X2 is the header information overhead of the current coding unit, and Cusize is the number of samples in the coding unit.
[0278] It can be seen that in the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full padding information of the coding unit, and then the coding unit is encoded to generate a bitstream using the coding information. In this way, the fully padded coding unit in the strip can be determined using the full padding information, and then the encoding code length is determined using the header information overhead of the coding unit, the second preset number of bits, and the number of samples in the coding unit. Then, the coding unit is fixed-length encoded based on the encoding code length to generate a bitstream, thereby increasing its encoding bit count, thereby reducing the encoding bit count of the non-fully padded coding unit in the strip, thereby reducing the difference between the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, avoiding uneven subjective quality of the padded image, and thus making the subjective quality of the padded image balanced.
[0279] In a possible implementation, the target coding unit is a coding unit in which all samples are image padding samples and are located within a target slice of the padded image.
[0280] It is worth mentioning that, when the above-mentioned coding unit is a non-target coding unit, the coding code length may not be determined. The coding code length may also be determined in other ways, which are not limited in the embodiments of the present application.
[0281] S904: Encode the encoding unit according to the encoding information to generate a bit stream.
[0282] In a possible implementation, the encoding unit may be encoded to generate a code stream to be filled, and bits are filled in the code stream to be filled according to the number of filling bits to obtain the code stream.
[0283] For example, if the full padding information of a coding unit indicates whether all samples in the coding unit are image padding samples (i.e., the full padding flag of the coding unit is 1), after the coding unit is encoded to obtain the to-be-padded bitstream, additional padding bits BitsGap may be added to the to-be-padded bitstream. The padded bits may be BitsGap 0s, BitsGap 1s, or other bit contents, which are not limited in this embodiment of the present application.
[0284] It can be seen that in the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full padding information of the coding unit, and then the coding unit can be encoded using the coding information to generate a bitstream. In this way, the fully padded coding unit in the strip can be determined using the full padding information, and then bits can be padded in the initial bitstream (i.e., the bitstream to be padded) generated from the fully padded coding unit to increase its number of coded bits, thereby reducing the number of coded bits for the non-fully padded coding units in the strip, thereby reducing the difference between the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, avoiding uneven subjective quality of the padded image, and thus making the subjective quality of the padded image balanced.
[0285] It is worth mentioning that when the above-mentioned coding unit is a non-target coding unit (that is, the complete filling flag of the coding unit is 0), additional bits may not be filled in the code stream generated by encoding the coding unit, or other methods may be used to additionally fill in bits. This embodiment of the present application does not limit this.
[0286] In a possible implementation, the coding unit may be fixed-length coded according to the coding code length to generate the code stream.
[0287] Exemplarily, if the full padding information of the coding unit indicates whether all samples in the coding unit are image padding samples (i.e., the full padding flag of the coding unit is 1), the coding unit can be fixed-length encoded according to the above-mentioned encoding code length Bpppad.
[0288] As can be seen, in the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full padding information of the coding unit, and then the coding unit can be encoded using the coding information to generate a bitstream. In this way, the fully padded coding units in the strip can be determined using the full padding information, and then the coding units can be fixed-length encoded based on the encoding code length to generate a bitstream, thereby increasing the number of encoded bits, thereby reducing the number of encoded bits for the non-fully padded coding units in the strip. This reduces the difference between the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, avoiding uneven subjective quality of the padded image, and thus making the subjective quality of the padded image balanced.
[0289] It is worth mentioning that when the above-mentioned coding unit is a non-target coding unit (that is, the complete filling flag of the coding unit is 0), fixed-length coding can be used, or other coding methods may be used to encode it. The embodiments of the present application do not limit this.
[0290] In the related art, when encoding and decoding a padded image, if the padded content in a strip is too much and simple, the number of coding bits occupied by the completely padded coding units in the strip is relatively small, and the number of coding bits used for the non-completely padded coding units in the strip will be more abundant than other strips with no padded content or less padded content, resulting in a difference in the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, causing uneven subjective quality of the padded image.
[0291] In the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full padding information of the coding unit, and then the coding unit is encoded using the coding information to generate a bitstream. In this way, the fully padded coding units in the strip can be determined based on the full padding information, and then the coding parameters of the fully padded coding units can be adjusted to increase their number of coded bits, thereby reducing the number of coded bits of the non-fully padded coding units in the strip. This reduces the difference between the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, avoids uneven subjective quality of the padded image, and thus makes the subjective quality of the padded image balanced.
[0292] The embodiment of the present application provides a decoding method that can balance the subjective quality of a padded image. The decoding method is applicable to a decoding system, and FIG11 shows a possible form of the decoding system.
[0293] As shown in FIG11 , the decoding system includes: an entropy decoding module 1101 , an inverse quantization module 1102 , a prediction module 1103 , an image cropping module 1104 and a bit rate control module 1105 .
[0294] After the bit stream corresponding to each coding unit is input into the decoder of the decoding system, it goes through the decoding process, such as entropy decoding, inverse quantization, prediction, etc. Among them, the fully padded coding unit needs to be decoded according to the above-mentioned encoding code length Bpppad. The reconstructed image corresponding to the coding unit is obtained. The reconstructed image needs to be cropped before output, and the original resolution image is finally output. Among them, cropping is to crop the padded area in the reconstructed image.
[0295] The entropy decoding module 1101 is used to perform entropy coding on the bit stream (bit stream) corresponding to the coding unit. In addition, the image complexity can also be obtained according to the bit stream (bit stream) corresponding to the coding unit.
[0296] The inverse quantization module 1102 is configured to inverse quantize the bit stream corresponding to the coding unit according to the quantization parameter.
[0297] The prediction module 1103 is configured to predict the bit stream corresponding to the coding unit.
[0298] The image cropping module 1104 is used to crop the padded area in the reconstructed image.
[0299] The bit rate control module 1105 is used to adjust the output bit rate according to the number of coding bits and / or image complexity.
[0300] FIG12 shows a decoding method provided by an embodiment of the present application. As shown in FIG12 , the method includes:
[0301] S1201: Obtain code stream.
[0302] The above-mentioned code stream is a code stream generated by the coding unit according to the coding information of the above-mentioned coding unit, the above-mentioned coding information is determined according to the full padding information of the above-mentioned coding unit, the above-mentioned full padding information is used to indicate whether all samples in the above-mentioned coding unit are image padding samples, and the above-mentioned coding information includes at least one of the number of padding bits or the encoding code length.
[0303] In a possible implementation, the full padding information is used to further indicate whether the coding unit is located within a target stripe of the padded image, where the target stripe is a stripe of the image padded horizontally.
[0304] S1202: Decode the code stream to obtain a reconstructed block.
[0305] In a possible implementation, when the code stream is a code stream of a target coding unit, the code stream may be decoded according to the encoding code length to obtain the reconstructed block, and the target coding unit is a coding unit in which all samples are image padding samples.
[0306] In a possible implementation, the target coding unit is a coding unit in which all samples are image padding samples and are located within a target slice of the padded image.
[0307] S1203: Generate a reconstructed image according to the reconstructed block.
[0308] In the related art, when encoding and decoding a padded image, if the padded content in a strip is too much and simple, the number of coding bits occupied by the completely padded coding units in the strip is relatively small, and the number of coding bits used for the non-completely padded coding units in the strip will be more abundant than other strips with no padded content or less padded content, resulting in a difference in the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, causing uneven subjective quality of the padded image.
[0309] In the method provided in the embodiment of the present application, the coding information of the coding unit can be determined based on the full padding information of the coding unit, and then the coding unit is encoded using the coding information to generate a bitstream. In this way, the fully padded coding units in the strip can be determined based on the full padding information, and then the coding parameters of the fully padded coding units can be adjusted to increase their number of coded bits, thereby reducing the number of coded bits of the non-fully padded coding units in the strip. This reduces the difference between the reconstruction quality of the non-padded content in the strip and the reconstruction quality of other strips, avoids uneven subjective quality of the padded image, and thus makes the subjective quality of the padded image balanced.
[0310] The following will introduce an encoding device for executing the above encoding method in conjunction with FIG13 .
[0311] It is understandable that, in order to implement the above functions, the encoding device includes hardware and / or software modules that perform the corresponding functions. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0312] In the embodiment of the present application, the encoding device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can 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. In actual implementation, other division methods can be used.
[0313] In the case of dividing the functional modules according to the corresponding functions, Figure 13 shows a possible composition diagram of the encoding device involved in the above embodiment. As shown in Figure 13, the encoding device 1300 may include: an image filling unit 1301, a division unit 1302, a determination unit 1303 and an encoding unit 1304.
[0314] The image padding unit 1301 is configured to perform image padding on the image to be encoded to obtain a padded image.
[0315] The division unit 1302 is configured to obtain coding units according to the padded image.
[0316] The above-mentioned determination unit 1303 is used to determine the encoding information of the above-mentioned encoding unit based on the full padding information of the above-mentioned encoding unit, and the above-mentioned full padding information is used to indicate whether all samples in the above-mentioned encoding unit are image padding samples, and the above-mentioned encoding information includes at least one of the number of padding bits or the encoding code length.
[0317] The encoding unit 1304 is configured to encode the encoding unit according to the encoding information to generate a bit stream.
[0318] In a possible implementation, the encoding unit 1304 is specifically configured to: encode the encoding unit to generate a code stream to be filled; and fill the code stream to be filled with bits according to the number of filling bits to obtain the code stream.
[0319] In a possible implementation, the encoding unit 1304 is specifically configured to perform fixed-length encoding on the encoding unit according to the encoding code length to generate the code stream.
[0320] In a possible implementation, the determination unit 1303 is specifically configured to: when the coding unit is a target coding unit, determine the number of padding bits based on the actual number of bits of the coding unit and the first preset number of bits, the target coding unit being a coding unit in which all samples are image padding samples, and the actual number of bits being the number of bits of the code stream to be filled corresponding to the coding unit.
[0321] In a possible implementation, the determination unit 1303 is specifically used to determine the encoding code length based on the header information overhead, the second preset number of bits, and the number of samples of the encoding unit when the encoding unit is a target encoding unit, and the target encoding unit is an encoding unit in which all samples are image padding samples.
[0322] In a possible implementation, the full padding information is used to further indicate whether the coding unit is located in a target stripe of the padded image, where the target stripe is horizontal to the padded stripe of the image.
[0323] In a possible implementation, the target coding unit is a coding unit in which all samples are image padding samples and are located within a target slice of the padded image.
[0324] The decoding device for executing the above decoding method will be introduced below with reference to FIG14 .
[0325] It is understandable that, in order to implement the above functions, the decoding device includes hardware and / or software modules that perform the corresponding functions. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0326] In the embodiments of the present application, the decoding device can be divided into functional modules according to the above-mentioned method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into a processing module. The above-mentioned integrated modules can 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 functional division. In actual implementation, other division methods may be used.
[0327] In the case of dividing the functional modules according to the corresponding functions, Figure 14 shows a possible composition diagram of the decoding device involved in the above embodiment. As shown in Figure 14, the decoding device 1400 may include: a receiving unit 1401, a decoding unit 1402 and a reconstruction unit 1403.
[0328] The receiving unit 1401 is configured to obtain a code stream, where the code stream is generated by the coding unit according to the coding information of the coding unit. The coding information is determined based on the full padding information of the coding unit. The full padding information is used to indicate whether all samples in the coding unit are image padding samples. The coding information includes at least one of the number of padding bits or the encoding code length.
[0329] The decoding unit 1402 is configured to decode the code stream to obtain a reconstructed block.
[0330] The reconstruction unit 1403 is configured to generate a reconstructed image according to the reconstructed block.
[0331] In a possible implementation, the decoding unit 1402 is specifically configured to: when the bitstream is a bitstream of a target coding unit, decode the bitstream according to the encoding code length to obtain the reconstructed block, and the target coding unit is a coding unit in which all samples are image padding samples.
[0332] In a possible implementation, the full padding information is used to further indicate whether the coding unit is located within a target stripe of the padded image, where the target stripe is a stripe of the image padded horizontally.
[0333] In a possible implementation, the target coding unit is a coding unit in which all samples are image padding samples and are located within a target slice of the padded image.
[0334] In a possible implementation, the reconstruction unit 1403 is further configured to: crop the image-filled area in the reconstructed image.
[0335] An embodiment of the present application also provides an encoding device, which includes: at least one processor, when the at least one processor executes program code or instructions, implements the above-mentioned related method steps to implement the encoding method in the above-mentioned embodiment.
[0336] Optionally, the apparatus may further include at least one memory configured to store the program code or instruction.
[0337] An embodiment of the present application also provides a decoding device, which includes: at least one processor, when the at least one processor executes program code or instructions, implements the above-mentioned related method steps to implement the decoding method in the above embodiment.
[0338] Optionally, the apparatus may further include at least one memory configured to store the program code or instruction.
[0339] An embodiment of the present application also provides a computer storage medium, which stores computer instructions. When the computer instructions are executed on an encoding device, the encoding device executes the above-mentioned related method steps to implement the encoding and decoding method in the above-mentioned embodiment.
[0340] The embodiment of the present application further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the encoding and decoding method in the above-mentioned embodiment.
[0341] The present application also provides a coding and decoding device, which can be a chip, integrated circuit, component, or module. Specifically, the device may include a connected processor and a memory for storing instructions, or the device may include at least one processor for retrieving instructions from an external memory. When the device is running, the processor may execute the instructions to cause the chip to perform the coding and decoding methods described in the above method embodiments.
[0342] 15 shows a schematic structural diagram of a chip 1500. The chip 1500 includes one or more processors 1501 and an interface circuit 1502. Optionally, the chip 1500 may further include a bus 1503.
[0343] The processor 1501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above encoding and decoding method can be completed by a hardware integrated logic circuit in the processor 1501 or by software instructions.
[0344] Optionally, the processor 1501 may be a general-purpose processor, a digital signal processing (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The methods and steps disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor.
[0345] The interface circuit 1502 can be used to send or receive data, instructions or information. The processor 1501 can use the data, instructions or other information received by the interface circuit 1502 to process it, and can send the processing completion information through the interface circuit 1502.
[0346] Optionally, the chip also includes a memory, which may include a read-only memory and a random access memory, and provides operating instructions and data to the processor. Part of the memory may also include a non-volatile random access memory (NVRAM).
[0347] Optionally, the memory stores an executable software module or a data structure, and the processor can perform corresponding operations by calling an operation instruction stored in the memory (the operation instruction may be stored in an operating system).
[0348] Optionally, the chip can be used in the encoding device or DOP involved in the embodiments of the present application. Optionally, the interface circuit 1502 can be used to output the execution result of the processor 1501. Regarding the encoding and decoding methods provided in one or more embodiments of the present application, reference can be made to the aforementioned embodiments and will not be repeated here.
[0349] It should be noted that the corresponding functions of the processor 1501 and the interface circuit 1502 can be implemented through hardware design, software design, or a combination of hardware and software, and there is no limitation here.
[0350] Among them, the device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0351] It should be understood that in various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0352] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of this application.
[0353] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0354] In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0355] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0356] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0357] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, 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, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above methods of each embodiment of the embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0358] The above description is merely a specific implementation of the embodiments of the present application, but the scope of protection of the embodiments of the present application is not limited thereto. Any person skilled in the art can easily conceive of changes or substitutions within the technical scope disclosed in the embodiments of the present application, and such changes or substitutions should be included in the scope of protection of the embodiments of the present application. Therefore, the scope of protection of the embodiments of the present application should be based on the scope of protection of the claims.
Claims
1. A coding method, characterized in that: include: Performing image padding on the image to be encoded to obtain a padded image; Obtaining a coding unit according to the padded image; Determining encoding information of the encoding unit according to full padding information of the encoding unit, wherein the full padding information is used to indicate whether all samples in the encoding unit are image padding samples, and the encoding information includes at least one of a number of padding bits or an encoding code length; The encoding unit is encoded according to the encoding information to generate a code stream.
2. The method according to claim 1, characterized in that The coding information includes a number of padding bits, and encoding the coding unit according to the coding information to generate a bit stream includes: Encoding the encoding unit to generate a code stream to be filled; The code stream is filled with bits according to the number of filling bits to obtain the code stream.
3. The method according to claim 1 or 2, characterized in that: The encoding information includes an encoding code length, and encoding the encoding unit according to the encoding information to generate a code stream includes: The coding unit is fixed-length encoded according to the encoding code length to generate the code stream.
4. The method according to any one of claims 1 to 3, characterized in that The coding information includes the number of padding bits, and the determining the coding information of the coding unit according to the full padding information of the coding unit includes: When the coding unit is a target coding unit, the number of padding bits is determined according to the actual number of bits of the coding unit and a first preset number of bits, the target coding unit is a coding unit in which all samples are image padding samples, and the actual number of bits is the number of bits of the code stream to be filled corresponding to the coding unit.
5. The method according to any one of claims 1 to 4, characterized in that The encoding information includes an encoding code length, and the determining the encoding information of the encoding unit according to the full padding information of the encoding unit includes: When the coding unit is a target coding unit, the coding code length is determined according to the header information overhead of the coding unit, the second preset bit number and the number of samples of the coding unit, and the target coding unit is a coding unit whose samples are all image padding samples.
6. The method according to claim 4 or 5, characterized in that: The full padding information is used to further indicate whether the coding unit is located in a target stripe of the padding image, where the target stripe is horizontal to the padded stripe of the image.
7. The method according to claim 6, characterized in that The target coding unit is a coding unit in which all samples are image padding samples and are located in a target slice of the padding image.
8. A decoding method, characterized in that: The method comprises: Acquire a bitstream, where the bitstream is a bitstream generated by a coding unit according to coding information of the coding unit, where the coding information is determined according to full padding information of the coding unit, where the full padding information is used to indicate whether all samples in the coding unit are image padding samples, and the coding information includes at least one of a number of padding bits or a coding code length; Decoding the code stream to obtain a reconstructed block; A reconstructed image is generated according to the reconstructed block.
9. The method according to claim 8, characterized in that The encoding information includes an encoding code length, and the decoding of the code stream to obtain a reconstructed block includes: In the case where the bitstream is a bitstream of a target coding unit, the bitstream is decoded according to the encoding code length to obtain the reconstructed block, and the target coding unit is a coding unit in which all samples are image padding samples.
10. The method according to claim 9, characterized in that The full padding information is used to further indicate whether the coding unit is located in a target stripe of the padded image, where the target stripe is a stripe of the image padded horizontally.
11. The method according to claim 10, characterized in that The target coding unit is a coding unit in which all samples are image padding samples and are located in a target slice of the padding image.
12. The method according to any one of claims 8 to 11, characterized in that The method further comprises: The image-filled area in the reconstructed image is cropped.
13. A coding device, characterized in that: The device comprises: an image filling unit, a dividing unit, a determining unit and an encoding unit; The image padding unit is used to perform image padding on the image to be encoded to obtain a padded image; The dividing unit is used to obtain a coding unit according to the padded image; The determining unit is used to determine the encoding information of the encoding unit according to the full padding information of the encoding unit, wherein the full padding information is used to indicate whether all samples in the encoding unit are image padding samples, and the encoding information includes the number of padding bits or the encoding code length. At least one; The encoding unit is used to encode the encoding unit according to the encoding information to generate a code stream.
14. The device according to claim 13, characterized in that The coding information includes the number of padding bits, and the coding unit is specifically used for: Encoding the encoding unit to generate a code stream to be filled; The code stream is filled with bits according to the number of filling bits to obtain the code stream.
15. The device according to claim 13 or 14, characterized in that The coding information includes a coding code length, and the coding unit is specifically used for: The coding unit is fixed-length encoded according to the encoding code length to generate the code stream.
16. The device according to any one of claims 13 to 15, characterized in that The coding information includes the number of padding bits, and the determining unit is specifically configured to: When the coding unit is a target coding unit, the number of padding bits is determined according to the actual number of bits of the coding unit and a first preset number of bits, the target coding unit is a coding unit in which all samples are image padding samples, and the actual number of bits is the number of bits of the code stream to be filled corresponding to the coding unit.
17. The device according to any one of claims 13 to 16, characterized in that The coding information includes a coding code length, and the determining unit is specifically used for: When the coding unit is a target coding unit, the coding code length is determined according to the header information overhead of the coding unit, the second preset bit number and the number of samples of the coding unit, and the target coding unit is a coding unit whose samples are all image padding samples.
18. The device according to claim 16 or 17, characterized in that The full padding information is used to further indicate whether the coding unit is located in a target stripe of the padding image, where the target stripe is horizontal to the padded stripe of the image.
19. The device according to claim 18, characterized in that The target coding unit is a coding unit in which all samples are image padding samples and are located in a target slice of the padding image.
20. A decoding device, characterized in that: The device comprises: a receiving unit, a decoding unit and a reconstruction unit; The receiving unit is used to obtain a code stream, where the code stream is a code stream generated by a coding unit according to coding information of the coding unit, where the coding information is determined according to full padding information of the coding unit, where the full padding information is used to indicate whether all samples in the coding unit are image padding samples, and the coding information includes at least one of a number of padding bits or a coding code length; The decoding unit is used to decode the code stream to obtain a reconstructed block; The reconstruction unit is used to generate a reconstructed image according to the reconstruction block.
21. The device according to claim 20, characterized in that The coding information includes the coding code length, and the decoding unit is specifically used for: In the case where the bitstream is a bitstream of a target coding unit, the bitstream is decoded according to the encoding code length to obtain the reconstructed block, and the target coding unit is a coding unit in which all samples are image padding samples.
22. The device according to claim 21, characterized in that The full padding information is used to further indicate whether the coding unit is located in a target stripe of the padded image, where the target stripe is a stripe of the image padded horizontally.
23. The device according to claim 22, characterized in that The target coding unit is a coding unit in which all samples are image padding samples and are located in a target slice of the padding image.
24. The device according to any one of claims 20 to 23, characterized in that The reconstruction unit is further configured to: The image-filled area in the reconstructed image is cropped.
25. A coding device, comprising at least one processor and a memory, characterized in that: The at least one processor executes a program or instruction stored in the memory so that the decoding device implements the method according to any one of claims 1 to 7.
26. A decoding device, comprising at least one processor and a memory, characterized in that: The at least one processor executes a program or instruction stored in the memory so that the encoding device implements the method according to any one of claims 8 to 12.
27. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is executed on a computer or a processor, the computer or the processor is enabled to implement the method of any one of claims 1 to 7 or any one of claims 8 to 12.
28. A computer program product, comprising instructions, characterized in that: When the instructions are executed on a computer or a processor, the computer or the processor is enabled to implement the method of any one of claims 1 to 7 or any one of claims 8 to 12.
Citation Information
Patent Citations
Coding and decoding method and device
CN118646900A
Image encoding and decoding apparatus and method
CN102668565A
Dynamic image encoding apparatus and operation method thereof
CN105379284A
Arithmetic codec byte padding signaling for video coding
CN114402602A
Image decoding method, image coding method, image decoding apparatus, image coding apparatus, and image coding and decoding apparatus
US20120320970A1
