Encoding method and apparatus, and decoding method and apparatus
By mapping and quantizing the exposure and ISO parameters of multiple RAW images, the problem of high computational complexity of RAW image encoding schemes is solved, and higher encoding accuracy and compression efficiency are achieved.
Patent Information
- Application Number
- PCT/CN2024/142930
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-27
- Filing Date
- 2024-12-26
- Publication Date
- 2025-10-02
AI Technical Summary
The existing RAW image encoding scheme has high computational complexity, which affects product deployment and encoding quality. In addition, it is difficult for hybrid video encoders to directly encode RAW images to obtain ideal compression rate and encoding quality.
By acquiring multiple frames of digital film RAW images and shooting information, the RAW component images are mapped and quantized using parameters such as exposure and ISO, and the pixel values and quantization parameters are adjusted to improve encoding accuracy and compression efficiency.
Improves the encoding accuracy and compression efficiency of RAW images, balances the relative bit rates between different frame types, and improves the encoding quality of underexposed and overexposed areas.
Smart Images

Figure CN2024142930_02102025_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 27, 2024, with application number 202410372499.2 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] Digital negative (RAW) images are the raw data obtained after the camera sensor converts light signals into digital signals. They usually generate multiple frames of original RAW images, which are then fused by the image signal processor (ISP) process to generate user-side images.
[0004] Unlike natural images, RAW images contain significant amounts of noise, requiring de-mosaicing and denoising processes within the ISP pipeline to produce images that conform to human visual characteristics. Directly encoding RAW images using a hybrid video encoder is difficult to achieve ideal compression rates and encoding quality, and further research is needed.
[0005] The existing RAW image encoding scheme has high computational complexity, which affects product deployment and encoding quality. Summary of the Invention
[0006] The embodiments of the present application provide a coding and decoding method and apparatus for improving the coding accuracy of RAW images. To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides an encoding method, comprising: obtaining multiple frames of digital film RAW images and shooting information, the shooting information including exposure values for the multiple frames of RAW images; obtaining multiple frames of RAW component images based on the multiple frames of RAW images; mapping the multiple frames of RAW component images according to mapping parameters, wherein the mapping parameters are related to the exposure values for the multiple frames of RAW images; encoding the mapped multiple frames of RAW component images to obtain a code stream; and encoding the mapping parameters into the code stream.
[0008] The method provided in the embodiments of this application updates the pixel values of the RWA component image by mapping the RAW component image to the exposure value of the RAW image. This allows the updated pixel values of the RWA component image to conform to the encoding curve, thereby improving the encoding accuracy of the value region of interest in the RAW image and balancing the relative bit rates between different frame types. This improves the encoding accuracy of the RAW image.
[0009] In a possible implementation, the shooting information further includes the sensitivity (ISO) of the multiple RAW images.
[0010] In a possible implementation, frame-level quantization parameters of the multiple RAW images may be obtained according to the ISOs of the multiple RAW images; and the multiple RAW component images may be encoded according to the frame-level quantization parameters to obtain a bitstream.
[0011] The method provided in the embodiment of the present application can also determine the frame-level quantization parameter of the RAW image according to the ISO of the RAW image, so as to make the ISO of the RAW image and the frame-level quantization parameter of the RAW image consistent with each other, thereby improving the compression efficiency of the RAW image.
[0012] In one possible implementation, block-level quantization parameters for image blocks in the multiple RAW component images can be obtained based on the frame-level quantization parameters and reference frame information, where the reference frame information indicates overexposed and underexposed image blocks in a base frame. The multiple RAW component images are encoded based on the block-level quantization parameters to generate a bitstream.
[0013] In a possible implementation, the reference frame is a RAW image with an exposure value of an intermediate value among the multiple RAW images.
[0014] In a possible implementation, the overexposed image block is an image block having a brightness value greater than or equal to a first brightness threshold.
[0015] In a possible implementation, the underexposed image block is an image block having a brightness value less than or equal to a second brightness threshold.
[0016] The method provided in the embodiment of the present application can also determine the block-level quantization parameters of the image block through the reference frame, and encode the image block through the block-level quantization parameters to improve the encoding quality of the underexposed and overexposed areas in the RAW image.
[0017] In one possible implementation, when the target image block corresponds to the overexposed image block of the above-mentioned reference frame, the block-level quantization parameter of the target image block can be determined according to the above-mentioned frame-level quantization parameter and the overexposure adjustment parameter, and the above-mentioned target image block is any image block in the above-mentioned first RAW component image of the multiple frames.
[0018] The method provided in the embodiment of the present application can determine the underexposed area in the RAW image block and adjust the quantization parameters of the underexposed area to improve the encoding quality of the underexposed area in the RAW image.
[0019] In a possible implementation, when the target image block corresponds to the underexposed image block of the reference frame, the block-level quantization parameter of the target image block may be determined according to the frame-level quantization parameter and the underexposure adjustment parameter.
[0020] The method provided in the embodiment of the present application can determine the overexposed area in the RAW image block and adjust the quantization parameters of the overexposed area to improve the encoding quality of the overexposed area in the RAW image.
[0021] In a possible implementation, the frame-level quantization parameters of the multiple RAW images or the block-level quantization parameters of the image blocks in the multiple RAW component images may be encoded into the bitstream.
[0022] The method provided in the embodiment of the present application can encode the block-level quantization parameter of the image block into the above-mentioned code stream, so that the decoding end can decode the code stream through the block-level quantization parameter.
[0023] In the second aspect, an embodiment of the present application provides an encoding method, which includes: obtaining multiple frames of RAW images and shooting information, the above-mentioned shooting information includes the ISO of the above-mentioned multiple frames of RAW images; obtaining multiple frames of RAW component images based on the above-mentioned multiple frames of RAW images; determining the frame-level quantization parameters of the above-mentioned multiple frames of RAW images based on the ISO of the above-mentioned multiple frames of RAW images; encoding the above-mentioned multiple frames of RAW component images according to the above-mentioned frame-level quantization parameters to obtain a code stream.
[0024] In one possible implementation, block-level quantization parameters for image blocks in the multiple RAW component images can be determined based on the frame-level quantization parameters and reference frame information, where the reference frame information indicates overexposed and underexposed image blocks in a base frame. The multiple RAW component images are encoded based on the block-level quantization parameters to generate a bitstream.
[0025] In a possible implementation, the reference frame is a RAW image with an exposure value of an intermediate value among the multiple RAW images.
[0026] In a possible implementation, the overexposed image block is an image block having a brightness value greater than or equal to an overexposed brightness threshold.
[0027] In a possible implementation, the underexposed image block is an image block having a brightness value greater than or equal to an underexposed brightness threshold.
[0028] In one possible implementation, when the target image block corresponds to the overexposed image block of the above-mentioned reference frame, the block-level quantization parameter of the target image block can be determined according to the above-mentioned frame-level quantization parameter and the overexposure adjustment parameter, and the above-mentioned target image block is any image block in the above-mentioned first RAW component image of the multiple frames.
[0029] In a possible implementation, when the target image block corresponds to the underexposed image block of the reference frame, the block-level quantization parameter of the target image block may be determined according to the frame-level quantization parameter and the underexposure adjustment parameter.
[0030] In a possible implementation, the multi-frame RAW component images may be mapped according to mapping parameters; the mapped multi-frame RAW component images may be encoded according to the frame-level quantization parameters to obtain a bitstream; and the mapping parameters may be encoded into the bitstream.
[0031] In a possible implementation, the mapping parameters may be determined according to the exposure amounts of the multiple RAW image frames.
[0032] In a third aspect, an embodiment of the present application provides a decoding method, which includes: decoding a code stream to obtain multiple frames of RAW component images; decoding the code stream to obtain mapping parameters; inverse mapping the multiple frames of RAW component images according to the above mapping parameters; and obtaining multiple frames of RAW images based on the inverse mapped multiple frames of RAW component images.
[0033] In a possible implementation, frame-level quantization parameters of the multiple RAW images may be obtained; and a code stream may be decoded according to the frame-level quantization parameters to obtain multiple RAW component images.
[0034] In a possible implementation, block-level quantization parameters of image blocks in the multiple-frame RAW component images may be obtained; and a code stream may be decoded according to the block-level quantization parameters to obtain the multiple-frame RAW component images.
[0035] In a fourth aspect, an embodiment of the present application provides a decoding method, which includes: obtaining frame-level quantization parameters of multiple-frame RAW images or block-level quantization parameters of image blocks in multiple-frame RAW component images; decoding the code stream according to the above-mentioned frame-level quantization parameters or the above-mentioned block-level quantization parameters to obtain multiple-frame RAW component images; and obtaining multiple-frame RAW images according to the above-mentioned multiple-frame RAW component images.
[0036] In a possible implementation, the code stream may be decoded to obtain mapping parameters; the multi-frame RAW component images may be inversely mapped according to the mapping parameters; and the multi-frame RAW images may be obtained according to the inversely mapped multi-frame RAW component images.
[0037] In a fifth aspect, an embodiment of the present application provides an encoding device, comprising: an acquisition unit, a splitting unit, a mapping unit, and an encoding unit. The acquisition unit is configured to acquire multiple RAW images and shooting information, wherein the shooting information includes the exposure values of the multiple RAW images; the splitting unit is configured to obtain multiple RAW component images based on the multiple RAW images; the mapping unit is configured to map the multiple RAW component images based on mapping parameters, wherein the mapping parameters are related to the exposure values of the multiple RAW images; the encoding unit is configured to encode the mapped multiple RAW component images to obtain a code stream; and the encoding unit is further configured to encode the mapping parameters into the code stream.
[0038] In a possible implementation, the shooting information further includes the ISOs of the multiple RAW images.
[0039] In a possible implementation, the encoding unit is specifically configured to: obtain frame-level quantization parameters of the multiple RAW images according to the ISO of the multiple RAW images; and encode the multiple RAW component images according to the frame-level quantization parameters to obtain a code stream.
[0040] In a possible implementation, the encoding unit is specifically used to: obtain block-level quantization parameters of the image blocks in the multi-frame RAW component image based on the frame-level quantization parameters and reference frame information, the reference frame information is used to indicate the overexposed image blocks and underexposed image blocks of the reference frame; encode the multi-frame RAW component image according to the block-level quantization parameters to obtain a code stream.
[0041] In a possible implementation, the encoding unit is specifically used to: when the target image block corresponds to the overexposed image block of the reference frame, determine the block-level quantization parameter of the target image block according to the frame-level quantization parameter and the overexposure adjustment parameter, and the target image block is any image block in the first RAW component image of the multiple frames.
[0042] In a possible implementation, the encoding unit is specifically configured to determine a block-level quantization parameter of the target image block according to the frame-level quantization parameter and the underexposure adjustment parameter when the target image block corresponds to an underexposed image block of the reference frame.
[0043] In a possible implementation, the encoding unit is further configured to encode the frame-level quantization parameters of the multiple RAW images or the block-level quantization parameters of the image blocks in the multiple RAW component images into the bitstream.
[0044] In a sixth aspect, an embodiment of the present application provides an encoding device, which includes: an acquisition unit, a splitting unit, a determination unit and an encoding unit; the acquisition unit is used to acquire multiple frames of RAW images and shooting information, and the shooting information includes the ISO of the multiple frames of RAW images; the splitting unit is used to obtain multiple frames of RAW component images based on the multiple frames of RAW images; the determination unit is used to determine the frame-level quantization parameters of the multiple frames of RAW images based on the ISO of the multiple frames of RAW images; the encoding unit is used to encode the multiple frames of RAW component images according to the frame-level quantization parameters to obtain a code stream.
[0045] In a possible implementation, the encoding unit is specifically used to: obtain block-level quantization parameters of the image blocks in the multi-frame RAW component image based on the frame-level quantization parameters and reference frame information, the reference frame information is used to indicate the overexposed image blocks and underexposed image blocks of the reference frame; encode the multi-frame RAW component image according to the block-level quantization parameters to obtain a code stream.
[0046] In a possible implementation, the encoding unit is specifically used to: when the target image block corresponds to the overexposed image block of the reference frame, determine the block-level quantization parameter of the target image block according to the frame-level quantization parameter and the overexposure adjustment parameter, and the target image block is any image block in the first RAW component image of the multiple frames.
[0047] In a possible implementation, the encoding unit is specifically configured to obtain a block-level quantization parameter of the target image block according to the frame-level quantization parameter and the underexposure adjustment parameter when the target image block corresponds to the underexposed image block of the reference frame.
[0048] In a possible implementation, the encoding unit is specifically used to: map the multi-frame RAW component images according to the mapping parameters; encode the mapped multi-frame RAW component images according to the frame-level quantization parameters to obtain a code stream; and encode the mapping parameters into the code stream.
[0049] In a possible implementation, the shooting information further includes the exposure values of the multiple RAW frames.
[0050] In a possible implementation, the determining unit is further configured to obtain the mapping parameters according to the exposure values of the multiple RAW image frames.
[0051] In the seventh aspect, an embodiment of the present application provides a decoding device, which includes: a decoding unit, an inverse mapping unit and a combination unit; the above-mentioned decoding unit is used to decode the code stream to obtain multiple frames of RAW component images; the above-mentioned decoding unit is also used to decode the code stream to obtain mapping parameters; the above-mentioned inverse mapping unit is used to inversely map the above-mentioned multiple frames of RAW component images according to the above-mentioned mapping parameters; the above-mentioned combination unit is used to obtain multiple frames of RAW images based on the above-mentioned multiple frames of RAW component images after inverse mapping.
[0052] In a possible implementation, the decoding unit is specifically configured to: obtain frame-level quantization parameters of the multiple RAW images; and decode the code stream according to the frame-level quantization parameters to obtain multiple RAW component images.
[0053] In a possible implementation, the decoding unit is specifically configured to: obtain block-level quantization parameters of image blocks in the multi-frame RAW component images; and decode the code stream according to the block-level quantization parameters to obtain the multi-frame RAW component images.
[0054] In an eighth aspect, an embodiment of the present application provides a decoding device, which includes: an acquisition unit, a decoding unit and a combination unit; the acquisition unit is used to obtain frame-level quantization parameters of multiple-frame RAW images or block-level quantization parameters of image blocks in multiple-frame RAW component images; the decoding unit is used to decode the code stream according to the frame-level quantization parameters or the block-level quantization parameters to obtain multiple-frame RAW component images; the combination unit is used to obtain multiple-frame RAW images according to the multiple-frame RAW component images.
[0055] In a possible implementation, the combination unit is specifically configured to: decode the code stream to obtain mapping parameters; perform inverse mapping on the multiple RAW component images according to the mapping parameters; and obtain multiple RAW images according to the inversely mapped multiple RAW component images.
[0056] In the ninth aspect, an embodiment of the present application further provides an encoding 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.
[0057] Optionally, the apparatus may further include at least one memory configured to store the program code or instruction.
[0058] In the tenth 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.
[0059] In an eleventh aspect, an embodiment of the present application further provides a code stream storage method, the method comprising: acquiring and storing a code stream obtained by the method described in the first aspect or any possible implementation thereof.
[0060] In a twelfth aspect, an embodiment of the present application further provides a bitstream storage device, which is used to obtain and store the bitstream obtained by the method described in the first aspect or any possible implementation thereof.
[0061] In a thirteenth aspect, an embodiment of the present application further provides a code stream transmission method, the method comprising: acquiring and transmitting a code stream obtained by the method described in the first aspect or any possible implementation thereof.
[0062] In a fourteenth aspect, an embodiment of the present application further provides a code stream transmission device, which is used to obtain and transmit the code stream obtained by the method described in the first aspect or any possible implementation thereof.
[0063] In a fifteenth aspect, the embodiment of the present application further provides a computer-readable storage medium, on which is stored the code stream obtained by the method described in the first aspect or any possible implementation thereof.
[0064] In a sixteenth aspect, an embodiment of the present application further provides 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.
[0065] Optionally, the chip may also be an integrated circuit.
[0066] In the seventeenth 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.
[0067] In the eighteenth 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.
[0068] 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
[0069] 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.
[0070] FIG1a is an exemplary block diagram of a decoding system provided in an embodiment of the present application;
[0071] FIG1b is an exemplary block diagram of a video decoding system provided in an embodiment of the present application;
[0072] FIG2 is an exemplary block diagram of a video encoder provided in an embodiment of the present application;
[0073] FIG3 is an exemplary block diagram of a video decoder provided in an embodiment of the present application;
[0074] FIG4 is an exemplary block diagram of a video decoding device provided in an embodiment of the present application;
[0075] FIG5 is an exemplary block diagram of a device provided in an embodiment of the present application;
[0076] FIG6 is a schematic diagram of a neural network-based image compression method provided in an embodiment of the present application;
[0077] FIG7 is a schematic diagram of an end-to-end image coding framework provided in an embodiment of the present application;
[0078] FIG8 is a schematic diagram of the structure of a neural network provided in an embodiment of the present application;
[0079] FIG9 is a schematic structural diagram of a video communication system provided in an embodiment of the present application;
[0080] FIG10 is a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application;
[0081] FIG11 is a schematic diagram of a flow chart of a decoding method provided in an embodiment of the present application;
[0082] FIG12 is a schematic diagram of a flow chart of another encoding method provided in an embodiment of the present application;
[0083] FIG13 is a schematic flow chart of another decoding method provided in an embodiment of the present application;
[0084] FIG14 is a schematic structural diagram of an encoding device provided in an embodiment of the present application;
[0085] FIG15 is a schematic structural diagram of another encoding device provided in an embodiment of the present application;
[0086] FIG16 is a schematic structural diagram of a decoding device provided in an embodiment of the present application;
[0087] FIG17 is a schematic structural diagram of another decoding device provided in an embodiment of the present application;
[0088] FIG18 is a schematic diagram of the structure of a chip provided in an embodiment of the present application;
[0089] FIG19 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0090] FIG20 is a schematic structural diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0091] 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.
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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 having priority or advantage 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.
[0096] 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).
[0097] 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.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] 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 .
[0102] 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.
[0103] 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 .
[0104] 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 .
[0105] The 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 (e.g., 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 above images.
[0106] 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 .
[0107] 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 YCbCr), color grading, or denoising. It will be appreciated that the preprocessor 18 may be an optional component.
[0108] 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).
[0109] 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.
[0110] The destination device 14 includes a decoder 30 and, in addition or alternatively, may include a communication interface (or communication unit) 28 , a post-processor (or post-processing unit) 32 , and a display device 34 .
[0111] 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.
[0112] 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.
[0113] 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.
[0114] 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 .
[0115] 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.
[0116] 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).
[0117] 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.
[0118] 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.
[0119] The decoding system 10 also includes a training engine 25, which is used to train the encoder 20 (especially the entropy encoding unit 270 in the encoder 20) or the decoder 30 (especially the entropy decoding unit 304 in the decoder 30) to perform entropy encoding on the image block to be encoded based on the estimated probability distribution. For a detailed description of the training engine 25, please refer to the following method test example.
[0120] 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.
[0121] 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.
[0122] 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 FIG4 , 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 FIG1 b.
[0123] 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.
[0124] 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).
[0125] 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.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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.
[0131] 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.
[0132] 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.
[0133] 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.
[0134] 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.
[0135] 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.
[0136] Encoders and encoding methods
[0137] 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.
[0138] Images and image segmentation (images and blocks)
[0139] 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).
[0140] 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.
[0141] 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.
[0142] 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 an image block to be encoded.
[0143] 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.
[0144] 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 .
[0145] 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), where 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 (e.g., tiles in the H.265 / HEVC / VVC standard and bricks in the VVC standard).
[0146] 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).
[0147] Residual calculation
[0148] 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.
[0149] Quantification
[0150] 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 .
[0151] 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.
[0152] 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.
[0153] Dequantization
[0154] 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.
[0155] reconstruction
[0156] 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.
[0157] segmentation
[0158] 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).
[0159] Entropy Coding
[0160] 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.
[0161] 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.
[0162] Decoder and decoding method
[0163] 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.
[0164] 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 .
[0165] 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.
[0166] Entropy decoding
[0167] 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.
[0168] Dequantization
[0169] 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.
[0170] reconstruction
[0171] 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 .
[0172] 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.
[0173] 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.
[0174] 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, does not exceed 1 pixel. Two methods of limiting the motion vector based on bitDepth are provided here.
[0175] 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.
[0176] Please refer to Figure 4, which is an exemplary block diagram of a video decoding device 400 provided in an embodiment of the present application. Video decoding device 400 is suitable for implementing the disclosed embodiments described herein. In one embodiment, video decoding device 400 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.
[0177] Video decoding device 400 includes: an input port 410 (or input port 410) and a receiver unit (Rx) 420 for receiving data; a processor, logic unit, or central processing unit (CPU) 430 for processing data; for example, processor 430 may be a neural network processor 430; a transmitter unit (Tx) 440 and an output port 450 (or output port 550) for transmitting data; and a memory 460 for storing data. Video decoding device 400 may also include optical-to-electrical (OE) components and electrical-to-optical (EO) components coupled to input port 410, receiver unit 420, transmitter unit 440, and output port 450 for outputting or receiving optical or electrical signals.
[0178] The processor 430 is implemented in hardware and software. The processor 430 can be implemented as one or more processor chips, cores (e.g., multi-core processors), FPGAs, ASICs, and DSPs. The processor 430 communicates with the input port 410, the receiving unit 420, the transmitting unit 440, the output port 450, and the memory 460. The processor 430 includes a neural network-based codec 470. The neural network-based codec 470 implements the embodiments disclosed above. For example, the neural network-based codec 470 performs, processes, prepares, or provides various encoding operations. Therefore, the neural network-based codec 470 provides substantial improvements to the functionality of the video decoding device 400 and affects the switching of the video decoding device 400 to different states. Alternatively, the neural network-based codec 470 is implemented by instructions stored in the memory 460 and executed by the processor 430.
[0179] Memory 460 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 460 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).
[0180] Please refer to FIG. 5 , which is an exemplary block diagram of an apparatus 500 provided in an embodiment of the present application. The apparatus 500 may be used as either or both of the source device 12 and the destination device 14 in FIG. 1 a .
[0181] The processor 502 in the apparatus 500 may be a central processing unit (CPU). Alternatively, the processor 502 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 502 shown, using more than one processor may provide greater speed and efficiency.
[0182] In one implementation, the memory 504 in the apparatus 500 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 504. The memory 504 may include code and data 506 that are accessed by the processor 502 via a bus 512. The memory 504 may also include an operating system 508 and application programs 510, which include at least one program that allows the processor 502 to perform the methods described herein. For example, the application programs 510 may include applications 1 through N, as well as a video decoding application that performs the methods described herein.
[0183] The apparatus 500 may also include one or more output devices, such as a display 518. In one example, the display 518 may be a touch-sensitive display that combines a display with touch-sensitive elements that can be used to sense touch input. The display 518 may be coupled to the processor 502 via the bus 512.
[0184] Although bus 512 in device 500 is described herein as a single bus, bus 512 may include multiple buses. Furthermore, secondary storage may be directly coupled to other components of device 500 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 500 may have a variety of configurations.
[0185] Image encoding:
[0186] Today, multimedia data accounts for the majority of internet traffic. Image data compression plays a vital role in the storage and efficient transmission of multimedia data. Therefore, image coding technology is a highly practical technology. It is important to note that the English terms "image coding" and "image encoding" are often translated into "image coding" in Chinese. Image coding is a broad term that encompasses both the process of encoding an image into a bitstream and the process of decoding (decoding) the bitstream back into an image.
[0187] Image coding simply refers to the process of encoding an image into a bitstream. Image coding research has a long history. Researchers have proposed numerous methods and developed I-frame encoding schemes for various image and video coding standards, including JPEG, JPEG 2000, JPEG-XL, JPEG-XX, WebP, H.264 / AVC, H.264 / HEVC, H.26 / VVC, AVS3, and AV1. Most of these coding methods are based on transform, prediction, and entropy coding techniques. While these coding methods are currently widely used, the increase in image data volumes and the emergence of new media types have necessitated the need for coding methods with higher compression efficiency.
[0188] Image encoding based on deep learning:
[0189] In recent years, researchers have been studying deep learning-based image coding methods. Some have achieved promising results. For example, Balle et al. proposed an end-to-end optimized image coding method that outperforms the best existing image coding methods and even the best existing traditional coding standard, H.265 / HEVC.
[0190] Deep learning-based image coding relies on deep neural networks, typically convolutional neural networks. Several research works have proposed image coding methods based on Transformer networks. The architecture of a deep neural network can be designed manually or obtained through neural architecture search (NAS). The parameters of a deep neural network are obtained by using a loss function and a backpropagation algorithm.
[0191] Figure 6 shows a typical deep learning-based image compression method, also known as a neural network-based image compression method. Generally, a neural network-based image compression method includes the following components: a feature extraction module, a feature quantization module, an entropy coding module, an entropy decoding module, a feature dequantization module, and a feature decoding module. On the encoder side, the feature extraction module can use a nonlinear mapping activation function to obtain an extracted three-dimensional feature map through multi-layer convolution stacking. The feature quantization module quantizes the eigenvalues of floating-point numbers through eigenvalue quantization to obtain quantized eigenvalues. The quantized eigenvalues are losslessly entropy encoded to obtain an encoded bitstream. Upon receiving the entropy-coded bitstream, the decoder performs lossless entropy decoding to obtain the three-dimensional quantized eigenvalues. The feature decoding module decodes the features into a reconstructed image to achieve decoding.
[0192] After the image to be compressed passes through the feature extraction module and the feature quantization module, a three-dimensional feature quantization map is generated. When processing each eigenvalue in the three-dimensional feature quantization map, the entropy coding module uses the eigenvalues in the processed neighborhood as context to estimate and obtain the probability distribution of the eigenvalue. Based on this probability distribution, subsequent encoding is performed to obtain the encoded bitstream.
[0193] With the outstanding performance of deep learning in various fields, researchers have proposed an end-to-end image coding solution based on deep learning. Figure 7 shows the coding framework. The specific technical scheme is as follows: On the encoder side, the original image is input to the feature extraction module, and the feature map is output. The feature map passes through the side information extraction module and outputs the side information. On the encoder and decoder sides, it is input to the probability estimation module, and the probability distribution of each feature element is output to obtain the value of the feature element to be encoded. In addition, the feature map is input into the quantization module to obtain a quantized feature map. The entropy coding module performs entropy coding on each feature element in the quantized feature map based on the probability distribution of each feature element to obtain an encoded bit stream.
[0194] On the decoder side, the decoder parses the bitstream and outputs the probability distribution of the symbols to be encoded based on the accompanying information to obtain the value of the feature element to be decoded. The k-entropy decoding module performs arithmetic decoding on each feature element in the quantized feature map based on the probability distribution of each feature element to obtain the value of the feature element. The feature map is input to the image reconstruction module, and the reconstructed image is output.
[0195] Neural Networks
[0196] A neural network may include neurons. A neuron may be an operation unit that uses xs and an intercept 1 as input. The output of the operation unit may be:
[0197] Here, s=s=1,2,...,n, n is a natural number greater than 1, Ws is the weight of xs, b is the bias of the neuron, and f is the activation function of the neuron (activation function), which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neuron into the output signal. The output signal of the activation function can be used as the input of the next convolutional layer. The activation function can be a sigmoid function. A neural network is a network constructed by connecting multiple single neurons together. Specifically, the output of a neuron can be the input to another neuron. The input of each neuron can be connected to the local receptive field of the previous layer to extract the characteristics of the local receptive field. The local receptive field can be an area including several neurons.
[0198] Convolutional Neural Networks:
[0199] A convolutional neural network (CNN) is a deep neural network with a convolutional architecture. A CNN includes a feature extractor, which consists of convolutional layers and subsampling layers. The feature extractor can be considered a filter. A convolutional layer is a layer of neurons in a CNN that performs convolution processing on the input signal. In a convolutional layer of a CNN, a neuron may only be connected to a subset of neurons in an adjacent layer. A convolutional layer typically includes several feature planes, each of which may include a number of neurons arranged in a rectangular shape. Neurons on the same feature plane share a weight, which is the convolution kernel. Shared weights can be understood as a position-independent way of extracting image information. The convolution kernel can be initialized as a matrix of random size. During the training process of a CNN, appropriate weights can be obtained for the convolution kernel through learning. In addition, shared weights directly reduce the number of connections between CNN layers and reduce the risk of overfitting.
[0200] Figure 8 schematically illustrates the general concept of processing by a neural network such as a CNN. A convolutional neural network consists of an input layer, an output layer, and multiple hidden layers. The input layer provides the input (e.g., a portion of an image, as shown in Figure 8) for processing. The hidden layers of a CNN typically consist of a series of convolutional layers, which perform convolutions with multiplications or other dot products. The result of these layers is one or more feature maps, sometimes also called channels. Subsampling may be involved in some or all layers. Therefore, as shown in Figure 8, the feature maps can become smaller. The activation function in a CNN is typically a Rectified Linear Unit (RELU) layer, followed by additional convolutions such as pooling, fully connected, and normalization layers. These are called hidden layers because their inputs and outputs are masked by the activation function and the final convolution. Although these layers are colloquially referred to as convolutions, this is just convention. Mathematically, it is technically a sliding dot product or cross-correlation. This has important implications for the indices in the matrix, as it affects how weights are determined at specific index points.
[0201] When programming a CNN for image processing, as shown in Figure 8, the input is a tensor with a shape of (number of images) x (image width) x (image height) x (image depth). Then, after passing through the convolutional layer, the image is abstracted into a feature map with a shape of (number of images) x (feature map width) x (feature map height) x (feature map channels). A convolutional layer in a neural network should have the following properties: A convolution kernel defined by width and height (hyperparameters). The number of input and output channels (hyperparameters). The depth of the convolution filter (input channels) should be equal to the number of channels in the input feature map (depth).
[0202] Traditional multilayer perceptron (MLP) models have been used for image recognition in the past. However, due to the full connectivity between nodes, their dimensionality is high and does not scale well with higher resolution images. A 1000×1000 pixel image with RGB color channels has 3 million weights, which is too high to be processed efficiently at scale with full connectivity. Furthermore, this network architecture does not account for the spatial structure of the data, treating input pixels that are far apart in the same way as pixels that are close together. This ignores the locality of reference in image data, both computationally and semantically. Therefore, full connectivity of neurons is wasteful for purposes such as image recognition, which is dominated by spatially local input patterns.
[0203] Convolutional neural networks are biologically inspired variants of multilayer perceptrons, specifically designed to mimic the behavior of the visual cortex. These models alleviate the challenges posed by MLP architectures by exploiting the strong spatially local correlations present in natural images. The convolutional layer is the core building block of a CNN. The parameters of this layer consist of a set of learnable filters (the kernels mentioned above) that have a small receptive field but extend to the full depth of the input volume. During the forward pass, each filter is convolved across the width and height of the input volume, computing the dot product between the entries of the filter and the input, and producing a two-dimensional activation map for that filter. Thus, the network learns filters that activate when it detects a certain type of feature at a certain spatial location in the input.
[0204] The activation maps of all filters stacked along the depth dimension form the complete output volume of the convolutional layer. Therefore, each entry in the output volume can also be interpreted as the output of a neuron that observes a small region in the input and shares parameters with neurons in the same activation map. A feature map, or activation map, is the output activation of a given filter. Feature map and activation have the same meaning. In some papers, it is called an activation map because it is a map corresponding to the activations of different parts of the image, and a feature map because it is also a map of certain features found in the image. High activation means that a certain feature has been found.
[0205] Another important concept in CNNs is pooling, a form of nonlinear downsampling. Several nonlinear functions can implement pooling, with max pooling being the most common. It divides the input image into a set of non-overlapping rectangles and, for each such subregion, outputs the maximum value.
[0206] Intuitively, the precise location of a feature relative to other features is less important than its coarse location. This is the idea behind pooling in convolutional neural networks. Pooling layers are used to gradually reduce the spatial size of the representation, reducing the number of parameters, memory usage, and computational overhead in the network, thereby controlling overfitting. In CNN architectures, it is common to periodically insert pooling layers between consecutive convolutional layers. Pooling provides another form of translation invariance.
[0207] Pooling layers operate independently on each depth slice of the input and resize it spatially. The most common form is a pooling layer with filters of size 2×2, applying a downsampling stride of 2 along both width and height to each depth slice in the input, discarding 75% of the activations. In this case, each maximum operation exceeds 4 numbers. The depth dimension remains unchanged.
[0208] In addition to max pooling, the pooling unit can also use other functions such as average pooling or 2-norm pooling. Average pooling was often used historically but has recently fallen out of favor compared to max pooling, which performs better in practice. Due to the large reduction in representation size, there has been a recent trend to use smaller filters or to drop pooling layers entirely. "Region of interest" pooling (also known as ROI pooling) is a variant of max pooling where the output size is fixed and the input rectangle is a parameter. Pooling is an important component of convolutional neural networks for object detection based on the Faster R-CNN architecture.
[0209] The aforementioned ReLU, short for Rectified Linear Unit, applies a non-saturating activation function. By setting negative values to zero, it effectively removes negative values from the activation map. This adds nonlinearity to the decision function and the entire network without affecting the receptive field of the convolutional layer. Other functions are also used to add nonlinearity, such as the saturated hyperbolic tangent and the sigmoid function. ReLU is often preferred over other functions because it trains neural networks several times faster without significantly affecting generalization accuracy.
[0210] After several convolutional and max-pooling layers, high-level reasoning in a neural network is done through fully connected layers. Neurons in a fully connected layer have connections to all activations in the previous layer, as seen in regular (non-convolutional) artificial neural networks. Therefore, their activations can be calculated as affine transformations, matrix multiplications followed by bias shifts (vector addition of learned or fixed bias terms).
[0211] The "loss layer" specifies how training penalizes deviations between predictions (outputs) and true labels and is typically the last layer in a neural network. A variety of loss functions can be used, appropriate for different tasks. Softmax loss is used to predict a single class among K mutually exclusive classes. Sigmoid cross-entropy loss is used to predict K independent probability values in the range [0, 1]. Euclidean loss is used to regress to real-valued labels.
[0212] In summary, Figure 8 shows the data flow in a typical convolutional neural network. First, the input image passes through a convolutional layer and is abstracted into a feature map consisting of several channels, corresponding to the number of filters in the set of learnable filters in that layer (e.g., one channel per filter). The feature map is then subsampled using, for example, a pooling layer, which reduces the dimensionality of each channel in the feature map. The data then enters another convolutional layer, which may have a different number of output channels, resulting in a different number of channels in the feature map. As mentioned above, the number of input channels and output channels are hyperparameters of the layer. In order to establish the connectivity of the network, these parameters need to be synchronized between the two connected layers, for example, the number of input channels of the current layer should be equal to the number of output channels of the previous layer. For the first layer that processes the input data (e.g., an image), the number of input channels is typically equal to the number of channels of the data representation, such as 3 channels for RGB or YUV representation of images or videos, or 1 channel for grayscale image or video representation.
[0213] The present invention is applicable to video codecs, such as those in video communication systems, as shown in Figure 9: After video is captured using a video capture device, it undergoes a series of pre-processing steps and is then compressed and encoded to produce an encoded bitstream. A transmitting module transmits the bitstream via a transmission network to a receiving module, where it is decoded by a decoder and then rendered for display. Furthermore, the encoded bitstream can also be directly stored.
[0214] The present invention can be used in devices or products containing video encoder and / or decoder functions, such as video processing hardware and software products, such as chips, as well as products or devices containing such chips, such as mobile phones and other media products.
[0215] FIG10 shows an encoding method provided by an embodiment of the present application. As shown in FIG10 , the method includes:
[0216] S1001: Acquire multiple RAW image frames and shooting information.
[0217] The shooting information is related information generated by shooting the multiple RAW images, and includes exposure values of the multiple RAW images.
[0218] In a possible implementation, a RAW image with an intermediate exposure value among multiple RAW images may be selected as a reference frame.
[0219] In a possible implementation, the reference frame may be used as the first frame in the multiple RAW images, and the other RAW images in the multiple RAW images may be reordered by size according to exposure amount.
[0220] For example, a plurality of RAW images may be captured by a camera, and then the plurality of RAW images and the capturing information may be acquired by the camera.
[0221] In a possible implementation, the shooting information includes ISO values of the multiple RAW images.
[0222] In a possible implementation, the shooting information includes the bit widths of the multiple RAW images.
[0223] S1002 : Obtain multiple frames of RAW component images according to the multiple frames of RAW images.
[0224] The RAW component image is a component image of a type of pixel in the RAW image. For example, the RAW component image may be a component image of an R pixel in the RAW image.
[0225] For example, the RAW image can be arranged in a preset format (such as a Bayer format) to obtain the basic components of the RAW image. A basic component of the RAW image is split into four pixels: G1, B, R, and G2. The same splitting operation is performed on each basic unit of the RAW image to combine them into four color component images: G1, B, R, and G2. The specific form of the basic component of the RAW image can be determined by the hardware. For example, the basic component of the RAW image can be GBRG, RGGB, or other forms.
[0226] S1003 : Map multiple frames of RAW component images according to mapping parameters.
[0227] The mapping parameters are used to update the pixel values of the multiple RAW component images, and the mapping parameters are related to the exposure of the multiple RAW images.
[0228] Exemplarily, multiple frames of RAW component images may be mapped according to a preset mapping curve.
[0229] For example, multiple frames of RAW component maps may be mapped according to a gamma correction curve.
[0230] For example, the pixel value y of the mapped RAW component image can satisfy:
[0231] Among them, γ is the above mapping parameter, s is the scaling factor, and nbits is the bit width of the RAW image, x is the pixel value of the RAW component image before mapping, and y is the pixel value of the RAW component image after mapping.
[0232] In a possible implementation, the mapping parameters may be determined according to the exposure values of multiple RAW image frames.
[0233] For example, in a possible implementation, the mapping parameters may be determined according to the exposure amounts of multiple RAW images using a linear function.
[0234] For example, the mapping parameter γ of the jth component of the i-th frame in the multi-frame RAW image is ij Can satisfy:
[0235] Among them, i is the frame number, j is the component number of the i-th frame, and the component images of the RAW image can be numbered in the order of G1, B, R, and G2. That is, the j values of the G1, B, R, and G2 component images of the RAW image correspond to 1, 2, 3, and 4 respectively. j is the average brightness I of the jth component of the current frame i j The average brightness I of the first component G1 G1 The relative value of α j =I j / I G1
[0236] E L 、E H are the minimum exposure and maximum exposure of multiple RAW frames, γ L , γ H is the γ value corresponding to the minimum exposure and maximum exposure, γ i With E i It can be positively correlated or negatively correlated.
[0237] S1004: Encode the mapped multiple-frame RAW component images to obtain a code stream.
[0238] Exemplarily, the mapped multiple-frame RAW component images may be encoded by an encoder to obtain a code stream.
[0239] For example, the encoder may be an H.264 encoder, an H.265 encoder, an H.266 encoder, an AVS3 encoder, or an AV1 encoder.
[0240] S1005: Encode the mapping parameters into the bitstream.
[0241] Exemplarily, the mapping parameters may be encoded into a bitstream by an encoder.
[0242] In a possible implementation, the frame-level quantization parameters of the multiple RAW images may be determined according to the ISO values of the multiple RAW images, and the multiple RAW component images may be encoded according to the frame-level quantization parameters to obtain a bitstream.
[0243] For example, the frame-level quantization parameter QP of the i-th frame RAW image in the above-mentioned multi-frame RAW image is i Can satisfy: QP i =g(ISO)
[0244] Here, g(x) is the mapping function from ISO to frame-level QP, and other frames use the same or different functions.
[0245] A specific form of g(x) can be a linear function as shown below, or other forms such as nonlinear functions can be used. QP can be positively correlated with ISO, g(x) = C(x-ISO0) + QP0
[0246] Wherein, C is a constant greater than 0, ISO0 is a preset ISO (such as the minimum ISO of the camera), and QP0 is a preset frame-level QP (such as the frame-level QP that can be used for the minimum ISO).
[0247] In a possible implementation, the block-level quantization parameters of the image blocks in the multiple RAW component images may be determined based on the frame-level quantization parameters and reference frame information, and the multiple RAW component images may be encoded based on the block-level quantization parameters to obtain a bitstream.
[0248] The reference frame information is used to indicate the overexposed image blocks and underexposed image blocks of a reference frame, and the reference frame is a RAW image with an intermediate exposure value among the multiple RAW images.
[0249] The overexposed image block is an image block whose brightness value is greater than or equal to the first brightness threshold.
[0250] The overexposed image block can be meanBLK L ≥threshold overExpo The image block, where meanBLK is the average brightness of the image block, threshold overExpo is the first brightness threshold (ie, the overexposure brightness threshold).
[0251] The underexposed image block is an image block whose brightness value is less than or equal to the second brightness threshold.
[0252] The above underexposed image block can be meanBLK L ≤threshold underExpo image blocks, where threshold underExpo is the second brightness threshold (ie, the underexposure brightness threshold).
[0253] The reference frame information may include a first value (mask) of the image block of the reference frame. overExpo ) and the second value (mask underExpo ).
[0254] If the image block is overexposed, the mask of the image block overExpo If it is 1, the image block is not overexposed, then the mask of the image block overExpo is 0.
[0255] If the image block is underexposed, the mask of the image block underExpo If it is 1, the image block is not underexposed, then the mask of the image block underExpo is 0.
[0256] In a possible implementation, when the target image block corresponds to the overexposed image block of the reference frame, the block-level quantization parameter of the target image block may be determined according to the frame-level quantization parameter and the overexposure adjustment parameter.
[0257] The target image block is any image block in the first RAW component images of the multiple frames;
[0258] Exemplarily, when the target image block corresponds to the overexposed image block of the reference frame, the block-level quantization parameter of the target image block may satisfy: QP ijk =QP i -deltaQPoverExpo
[0259] Among them, QP ijk is the block-level quantization parameter of the Kth image block of the jth component of the i-th frame RAW image in the above multi-frame RAW image, QP i is the frame-level quantization parameter of the i-th frame in the multi-frame RAW image, and deltaQPoverExpo is the overexposure adjustment parameter. The overexposure adjustment parameter can be a constant greater than 0.
[0260] In a possible implementation, when the target image block corresponds to the underexposed image block of the reference frame, the block-level quantization parameter of the target image block may be determined according to the frame-level quantization parameter and the underexposure adjustment parameter.
[0261] Exemplarily, when the target image block corresponds to the underexposed image block of the reference frame, the block-level quantization parameter of the target image block may satisfy: QP ijk =QP i -deltaQPunderExpo
[0262] Among them, QP ijkis the block-level quantization parameter of the Kth image block of the jth component of the i-th frame RAW image in the above multi-frame RAW image, QP i is the frame-level quantization parameter of the i-th frame in the multi-frame RAW image, and deltaQPunderExpo is the underexposure adjustment parameter. The underexposure adjustment parameter can be a constant greater than 0.
[0263] In a possible implementation, the frame-level quantization parameters of the multiple RAW images or the block-level quantization parameters of the image blocks in the multiple RAW component images may be encoded into the bitstream.
[0264] Exemplarily, the frame-level quantization parameters of the multiple RAW images or the block-level quantization parameters of the image blocks in the multiple RAW component images may be encoded into the bitstream through an encoder.
[0265] In a possible implementation, the above code stream may also be encapsulated.
[0266] The method provided in the embodiments of the present application maps the RAW component image to the RWA component image using the exposure value of the RAW image, thereby improving the encoding accuracy of the value region of interest in the RAW image and balancing the relative bit rates between different frame types, thereby improving the encoding accuracy of the RAW image.
[0267] FIG11 shows a decoding method provided by an embodiment of the present application. As shown in FIG11 , the method includes:
[0268] S1101 , decode a code stream to obtain multiple frames of RAW component images.
[0269] Exemplarily, a decoder may be used to decode a code stream to obtain multiple frames of RAW component images.
[0270] In a possible implementation, the above code stream may also be decapsulated.
[0271] For example, the above decoder can be an H.264 decoder, an H.265 decoder, an H.266 decoder, an AVS3 decoder or an AV1 decoder.
[0272] S1102: Decode the code stream to obtain mapping parameters.
[0273] Exemplarily, the mapping parameters may be obtained by decoding the code stream through a decoder.
[0274] Of course, the mapping parameters may also be obtained in other ways, such as by manually configuring the mapping parameters or transmitting the mapping parameters via data.
[0275] S1103 : Perform inverse mapping on the multiple-frame RAW component images according to the mapping parameters.
[0276] The specific implementation of the above inverse mapping can refer to the above S1004 and will not be repeated here.
[0277] S1104 , obtaining multiple frames of RAW images according to the inverse-mapped multiple frames of RAW component images.
[0278] For example, corresponding to the process of splitting a RAW image, component quantities of multiple RAW images (such as the four component images G1, B, R, and G2) can be reassembled into a complete RAW image.
[0279] FIG12 shows an encoding method provided by an embodiment of the present application. As shown in FIG12 , the method includes:
[0280] S1201: Acquire multiple RAW image frames and shooting information.
[0281] The specific implementation of S1201 can refer to the above S1001 and will not be repeated here.
[0282] S1202 : Obtain multiple frames of RAW component images according to the multiple frames of RAW images.
[0283] The specific implementation of S1202 can refer to the above S1002 and will not be repeated here.
[0284] S1203 : Determine frame-level quantization parameters of the multiple RAW images according to the ISO values of the multiple RAW images.
[0285] For example, the frame-level quantization parameter QP of the i-th frame RAW image in the above-mentioned multi-frame RAW image is i Can satisfy: QP i =g(ISO)
[0286] Here, g(x) is the mapping function from ISO to frame-level QP, and other frames use the same or different functions.
[0287] A specific form of g(x) can be a linear function as shown below, or other forms such as nonlinear functions can be used. QP can be positively correlated with ISO, g(x) = C(x-ISO0) + QP0
[0288] Wherein, C is a constant greater than 0, ISO0 is a preset ISO (such as the minimum ISO of the camera), and QP0 is a preset frame-level QP (such as the frame-level QP that can be used for the minimum ISO).
[0289] S1204 : Encode multiple RAW component images according to the frame-level quantization parameter to obtain a bitstream.
[0290] Exemplarily, an encoder may encode multiple frames of RAW component images according to a frame-level quantization parameter to obtain a code stream.
[0291] In a possible implementation, the block-level quantization parameters of the image blocks in the multiple RAW component images may be determined based on the frame-level quantization parameters and reference frame information, and the multiple RAW component images may be encoded based on the block-level quantization parameters to obtain a bitstream.
[0292] The reference frame information is used to indicate overexposed image blocks and underexposed image blocks of a base frame, where the base frame is a RAW image with an intermediate exposure value among the multiple RAW images. The overexposed image blocks are image blocks with brightness values greater than or equal to a first brightness threshold. The underexposed image blocks are image blocks with brightness values less than or equal to a second brightness threshold.
[0293] In one possible implementation, when the target image block corresponds to the overexposed image block of the reference frame, the block-level quantization parameter of the target image block can be determined according to the frame-level quantization parameter and the overexposure adjustment parameter, and the above-mentioned target image block is any image block in the above-mentioned multi-frame first RAW component image.
[0294] In a possible implementation, when the target image block corresponds to the underexposed image block of the reference frame, the block-level quantization parameter of the target image block may be determined according to the frame-level quantization parameter and the underexposure adjustment parameter.
[0295] In a possible implementation, the multiple RAW component images may be mapped according to mapping parameters, the mapped multiple RAW component images may be encoded according to the frame-level quantization parameters to obtain a bitstream, and the mapping parameters may be encoded into the bitstream.
[0296] In a possible implementation, the mapping parameters may be determined according to the exposure amounts of the multiple RAW image frames.
[0297] FIG13 shows a decoding method provided by an embodiment of the present application. As shown in FIG13 , the method includes:
[0298] S1301: Obtain frame-level quantization parameters of multiple RAW image frames.
[0299] S1302 : Decode the code stream according to the frame-level quantization parameter to obtain multiple frames of RAW component images.
[0300] In a possible implementation, block-level quantization parameters of image blocks in multiple RAW component images may be obtained, and the bitstream may be decoded according to the block-level quantization parameters to obtain multiple RAW component images.
[0301] S1303 : Obtain multiple frames of RAW images according to the multiple frames of RAW component images.
[0302] In a possible implementation, the code stream may be decoded to obtain mapping parameters, the multiple RAW component images may be inversely mapped according to the mapping parameters, and the multiple RAW images may be obtained according to the inversely mapped multiple RAW component images.
[0303] The following will introduce an encoding device for executing the above encoding method in conjunction with FIG14 .
[0304] 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.
[0305] 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.
[0306] In the case of dividing each functional module according to each function, Figure 14 shows a possible schematic diagram of the composition of the encoding device involved in the above embodiment. The device can be an electronic device, or a module applied to an electronic device (such as a processor, chip, or chip system, etc.), or a logical node, logical module, or software that can realize all or part of the functions of the electronic device. As shown in Figure 14, the encoding device 1400 may include: an acquisition unit 1401, a splitting unit 1402, a mapping unit 1403, and an encoding unit 1404.
[0307] The acquisition unit 1401 is configured to acquire multiple RAW image frames and shooting information, where the shooting information includes exposure values of the multiple RAW image frames.
[0308] The splitting unit 1402 is configured to obtain multiple frames of RAW component images according to the multiple frames of RAW images.
[0309] The mapping unit 1403 is configured to map the multiple RAW component images according to mapping parameters, where the mapping parameters are related to the exposure values of the multiple RAW images.
[0310] The encoding unit 1404 is configured to encode the mapped multi-frame RAW component images to obtain a bitstream.
[0311] The encoding unit 1404 is further configured to encode the mapping parameters into the bitstream.
[0312] In a possible implementation, the shooting information further includes the ISOs of the multiple RAW images.
[0313] The encoding unit 1404 is specifically configured to: determine frame-level quantization parameters of the multiple RAW images according to the ISOs of the multiple RAW images; and encode the multiple RAW component images according to the frame-level quantization parameters to obtain a bitstream.
[0314] In a possible implementation, the encoding unit 1404 is specifically used to: determine the block-level quantization parameters of the image blocks in the multi-frame RAW component image according to the frame-level quantization parameters and the reference frame information, the reference frame information is used to indicate the overexposed image blocks and underexposed image blocks of the reference frame, the reference frame is a RAW image with an intermediate exposure value in the multi-frame RAW image, the overexposed image block is an image block with a brightness value greater than or equal to a first brightness threshold, and the underexposed image block is an image block with a brightness value less than or equal to a second brightness threshold; encode the multi-frame RAW component image according to the block-level quantization parameters to obtain a code stream.
[0315] In one possible implementation, the encoding unit 1404 is specifically configured to: when the target image block corresponds to an overexposed image block of the reference frame, determine the block-level quantization parameter of the target image block according to the frame-level quantization parameter and the overexposure adjustment parameter, and the target image block is any image block in the first RAW component image of the multiple frames.
[0316] In a possible implementation, the encoding unit 1404 is specifically configured to determine a block-level quantization parameter of the target image block according to the frame-level quantization parameter and the underexposure adjustment parameter when the target image block corresponds to an underexposed image block of the reference frame.
[0317] In a possible implementation, the encoding unit 1404 is further configured to encode the frame-level quantization parameters of the multiple RAW images or the block-level quantization parameters of the image blocks in the multiple RAW component images into the bitstream.
[0318] In the case of dividing each functional module according to each function, Figure 15 shows a possible schematic diagram of the composition of the encoding device involved in the above embodiment. The device can be an electronic device, or a module applied to an electronic device (such as a processor, chip, or chip system, etc.), or a logical node, logical module, or software that can realize all or part of the functions of the electronic device. As shown in Figure 15, the encoding device 1500 may include: an acquisition unit 1501, a splitting unit 1502, a determination unit 1503, and an encoding unit 1504.
[0319] The acquisition unit 1501 is configured to acquire multiple RAW images and shooting information, where the shooting information includes the ISOs of the multiple RAW images.
[0320] The splitting unit 1502 is configured to obtain multiple frames of RAW component images according to the multiple frames of RAW images.
[0321] The determining unit 1503 is configured to determine the frame-level quantization parameters of the multiple RAW images according to the ISOs of the multiple RAW images.
[0322] The encoding unit 1504 is configured to encode the multiple RAW component images according to the frame-level quantization parameter to obtain a bitstream.
[0323] In a possible implementation, the encoding unit 1504 is specifically used to: determine the block-level quantization parameters of the image blocks in the multi-frame RAW component image according to the frame-level quantization parameters and the reference frame information, the reference frame information is used to indicate the overexposed image blocks and underexposed image blocks of the reference frame, the reference frame is a RAW image with an intermediate exposure value in the multi-frame RAW image, the overexposed image block is an image block with a brightness value greater than or equal to the overexposure brightness threshold, and the underexposed image block is an image block with a brightness value greater than or equal to the underexposure brightness threshold; and encode the multi-frame RAW component image according to the block-level quantization parameters to obtain a code stream.
[0324] In one possible implementation, the encoding unit 1504 is specifically used to: when the target image block corresponds to the overexposed image block of the reference frame, determine the block-level quantization parameter of the target image block according to the frame-level quantization parameter and the overexposure adjustment parameter, and the target image block is any image block in the first RAW component image of the multiple frames.
[0325] In a possible implementation, the encoding unit 1504 is specifically configured to determine a block-level quantization parameter of the target image block according to the frame-level quantization parameter and the underexposure adjustment parameter when the target image block corresponds to the underexposed image block of the reference frame.
[0326] In a possible implementation, the encoding unit 1504 is specifically used to: map the multi-frame RAW component images according to the mapping parameters; encode the mapped multi-frame RAW component images according to the frame-level quantization parameters to obtain a code stream; and encode the mapping parameters into the code stream.
[0327] In a possible implementation, the shooting information further includes exposure values of the multiple RAW frames.
[0328] In a possible implementation, the determining unit 1503 is further configured to determine the mapping parameters according to the exposure values of the multiple RAW image frames.
[0329] The decoding device for executing the above decoding method will be introduced below with reference to FIG16 .
[0330] 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.
[0331] 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.
[0332] In the case of dividing each functional module according to each function, Figure 16 shows a possible schematic diagram of the composition of the decoding device involved in the above embodiment. The device can be an electronic device, or a module applied to an electronic device (such as a processor, chip, or chip system, etc.), or a logical node, logical module, or software that can implement all or part of the functions of the electronic device. As shown in Figure 16, the decoding device 1600 may include: a decoding unit 1601, an inverse mapping unit 1602, and a combining unit 1603.
[0333] The acquisition unit 1601 is configured to acquire frame-level quantization parameters of multiple RAW frames or block-level quantization parameters of image blocks in multiple RAW component frames.
[0334] The decoding unit 1602 is configured to decode the bitstream according to the frame-level quantization parameter or the block-level quantization parameter to obtain multiple frames of RAW component images.
[0335] The combining unit 1603 is configured to obtain multiple frames of RAW images according to the multiple frames of RAW component images.
[0336] In a possible implementation, the decoding unit 1602 is specifically configured to: obtain frame-level quantization parameters of the multiple RAW images; and decode the bitstream according to the frame-level quantization parameters to obtain multiple RAW component images.
[0337] In a possible implementation, the decoding unit 1602 is specifically configured to: obtain block-level quantization parameters of image blocks in the multi-frame RAW component images; and decode the code stream according to the block-level quantization parameters to obtain the multi-frame RAW component images.
[0338] In the case of dividing each functional module according to each function, Figure 17 shows a possible schematic diagram of the composition of the decoding device involved in the above embodiment. The device can be an electronic device, or a module applied to an electronic device (such as a processor, chip, or chip system, etc.), or a logical node, logical module, or software that can realize all or part of the functions of the electronic device. As shown in Figure 17, the decoding device 1700 may include: an acquisition unit 1701, a decoding unit 1702, and a combination unit 1703.
[0339] The acquisition unit 1701 is configured to acquire frame-level quantization parameters of multiple RAW frames or block-level quantization parameters of image blocks in multiple RAW component frames.
[0340] The decoding unit 1702 is configured to decode the bitstream according to the frame-level quantization parameter or the block-level quantization parameter to obtain multiple frames of RAW component images.
[0341] The combining unit 1703 is configured to obtain multiple frames of RAW images according to the multiple frames of RAW component images.
[0342] In a possible implementation, the combination unit 1703 is specifically configured to: decode the code stream to obtain mapping parameters; perform inverse mapping on the multiple RAW component images according to the mapping parameters; and obtain multiple RAW images according to the inversely mapped multiple RAW component images.
[0343] The present application also provides a chip, which can be a chip for the encoding device or decoding device described above. FIG18 shows a schematic diagram of the structure of a chip 1800. Chip 1800 includes one or more processors 1801 and an interface circuit 1802. Optionally, chip 1800 may also include a bus 1803.
[0344] The processor 1801 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 1801 or by software instructions.
[0345] Optionally, the processor 1801 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.
[0346] The interface circuit 1802 can be used to send or receive data, instructions or information. The processor 1801 can use the data, instructions or other information received by the interface circuit 1802 to process it, and can send the processing completion information through the interface circuit 1802.
[0347] 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).
[0348] 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).
[0349] Optionally, the chip can be used in the encoding device or decoding device involved in the embodiments of the present application. Optionally, the interface circuit 1802 can be used to output the execution result of the processor 1801. For 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.
[0350] It should be noted that the corresponding functions of the processor 1801 and the interface circuit 1802 can be implemented through hardware design, software design, or a combination of hardware and software, and there is no limitation here.
[0351] Figure 19 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device can be an encoding device or a decoding device, a chip or functional module in an encoding device, or a chip or functional module in a decoding device. As shown in Figure 19, the electronic device 1900 includes a processor 1901, a transceiver 1902, and a communication circuit 1903.
[0352] In which, the processor 1901 is used to execute any step in the encoding and decoding method provided in the embodiment of the present application, and in the process of executing any step in the encoding and decoding method provided in the embodiment of the present application, the transceiver 1902 and the communication line 1903 can be optionally called to complete the corresponding operation.
[0353] Furthermore, the electronic device 1900 may further include a memory 1904 . The processor 1901 , the memory 1904 and the transceiver 1902 may be connected via a communication line 1903 .
[0354] The processor 1901 is a processor, a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 1901 may also be other devices with processing functions, such as circuits, devices, or software modules, without limitation.
[0355] Transceiver 1902 is used to communicate with other devices or other communication networks, such as Ethernet, radio access networks (RAN), wireless local area networks (WLAN), etc. Transceiver 1902 can be a module, circuit, transceiver, or any device capable of implementing communication.
[0356] The transceiver 1902 is mainly used for sending and receiving commands and information, etc., and may include a transmitter and a receiver for sending and receiving commands and information, etc. respectively; operations other than sending and receiving commands and information, etc. are implemented by the processor.
[0357] The communication line 1903 is used to transmit information between the various components included in the electronic device 1900.
[0358] In one design, the processor can be considered as the logic circuit and the transceiver as the interface circuit.
[0359] The memory 1904 is used to store instructions, where the instructions may be computer programs.
[0360] Memory 1904 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM may be used, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). Memory 1904 may also be a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, etc. It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0361] It should be noted that memory 1904 can exist independently of processor 1901 or can be integrated with processor 1901. Memory 1904 can be used to store instructions, program code, or some data. Memory 1904 can be located within electronic device 1900 or outside of electronic device 1900, without limitation. Processor 1901 is configured to execute instructions stored in memory 1904 to implement the methods provided in the above embodiments of this application.
[0362] In one example, processor 1901 may include one or more processors, such as processor 0 and processor 1 in FIG. 19 .
[0363] As an optional implementation, the electronic device 1900 includes multiple processors. For example, in addition to the processor 1901 in FIG. 19 , it may also include a processor 1909 .
[0364] As an optional implementation, the electronic device 1900 further includes an output device 1905 and an input device 1906. For example, the input device 1906 is a keyboard, a mouse, a microphone, or a joystick, and the output device 1905 is a display screen, a speaker, or the like.
[0365] It should be pointed out that the electronic device 1900 can be a chip system or a device with a similar structure as shown in Figure 19. Among them, the chip system can be composed of chips, or it can include chips and other discrete devices. The actions, terms, etc. involved in the various embodiments of this application can refer to each other without limitation. The message names or parameter names in the messages exchanged between the various devices in the embodiments of this application are only an example. Other names can also be used in the specific implementation without limitation. In addition, the component structure shown in Figure 19 does not constitute a limitation on the electronic device 1900. In addition to the components shown in Figure 19, the electronic device 1900 may include more or fewer components than those shown in Figure 19, or combine certain components, or arrange the components differently.
[0366] The processor and transceiver described in this application can be implemented on an integrated circuit (IC), an analog IC, a radio frequency integrated circuit, a mixed-signal IC, an application specific integrated circuit (ASIC), a printed circuit board (PCB), an electronic device, etc. The processor and transceiver can also be manufactured using various IC process technologies, such as complementary metal oxide semiconductor (CMOS), N-type metal oxide semiconductor (NMOS), P-type metal oxide semiconductor (positive channel metal oxide semiconductor, PMOS), bipolar junction transistor (BJT), bipolar CMOS (BiCMOS), silicon germanium (SiGe), gallium arsenide (GaAs), etc.
[0367] Figure 20 is a schematic diagram of the structure of another electronic device provided in an embodiment of the present application. The electronic device may be an encoding device or a decoding device, a chip or a functional module in an encoding device, or a chip or a functional module in a decoding device. For ease of explanation, Figure 20 only shows the main components of the electronic device, including a processor 2001, a memory 2002, a control circuit 2003, and an input / output device 2004. The processor 2001 is mainly used to process communication protocols and communication data, execute software programs, and process data of software programs. The memory 2002 is mainly used to store software programs and data. The control circuit 2003 is mainly used for power supply and transmission of various electrical signals. The input / output device 2004 is mainly used to receive data input by the user and output data to the user.
[0368] When the electronic device is a processor 2001, the control circuit 2003 may be a motherboard, the memory 2002 includes a hard disk, RAM, ROM and other media with storage functions, the processor 2001 may include a baseband processor 2001 and a central processing unit, the baseband processor is mainly used to process communication protocols and communication data, the central processing unit is mainly used to control the entire electronic device, execute software programs, and process software program data, the input and output device 2004 includes a display screen, a keyboard, and a mouse, etc.; the control circuit 2003 may further include or be connected to a transceiver circuit or transceiver, such as a network cable interface, etc., for sending or receiving data or signals, such as for data transmission and communication with other devices. Furthermore, it may also include an antenna for sending and receiving wireless signals for data / signal transmission with other devices.
[0369] 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, it implements the above-mentioned related method steps to implement the encoding method in the above embodiment.
[0370] Optionally, the apparatus may further include at least one memory configured to store the program code or instruction.
[0371] 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, it implements the above-mentioned related method steps to implement the decoding method in the above embodiment.
[0372] Optionally, the apparatus may further include at least one memory configured to store the program code or instruction.
[0373] An embodiment of the present application further provides a computer storage medium, which stores computer instructions. When the computer instructions are executed on a communication device, the communication device executes the above-mentioned related method steps to implement the encoding and decoding method in the above-mentioned embodiment.
[0374] 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.
[0375] The present application also provides an encoding device, which may be a chip, integrated circuit, component, or module. Specifically, the device may include a processor and a memory for storing instructions, or the device may include at least one processor configured to retrieve instructions from an external memory. When the device is running, the processor may execute the instructions, causing the chip to perform the encoding method described in each of the above method embodiments.
[0376] The present application also provides a decoding device, which can be a chip, integrated circuit, component, or module. Specifically, the device can include a processor and a memory for storing instructions, or the device can include at least one processor for retrieving instructions from an external memory. When the device is running, the processor can execute the instructions, causing the chip to perform the decoding method described in each of the above method embodiments.
[0377] An embodiment of the present application further provides a code stream storage method, which includes: acquiring and storing the code stream obtained by the above encoding and decoding method.
[0378] The embodiment of the present application further provides a code stream storage device, which is used to obtain and store the code stream obtained by the above encoding and decoding method.
[0379] An embodiment of the present application further provides a code stream transmission method, which includes: acquiring and transmitting the code stream obtained by the above encoding and decoding method.
[0380] An embodiment of the present application further provides a bit stream transmission device, which is used to obtain and transmit the bit stream obtained by the above encoding and decoding method.
[0381] An embodiment of the present application further provides a computer-readable storage medium, on which a code stream obtained by the above encoding and decoding method is stored.
[0382] 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.
[0383] 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.
[0384] 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.
[0385] 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.
[0386] 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.
[0387] 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.
[0388] 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.
[0389] 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.
[0390] 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: Acquire multiple frames of digital negative RAW images and shooting information, wherein the shooting information includes exposure values of the multiple frames of RAW images; Obtain multiple frames of RAW component images according to the multiple frames of RAW images; Mapping the multiple RAW component images according to mapping parameters, where the mapping parameters are related to exposures of the multiple RAW images; Encoding the mapped multiple RAW component images to obtain a bitstream; The mapping parameters are encoded into the codestream.
2. The method according to claim 1, characterized in that The shooting information further includes the ISO sensitivity of the multiple RAW image frames, and encoding the multiple RAW component image frames to obtain a code stream includes: Obtaining frame-level quantization parameters of the multiple frames of RAW images according to the ISOs of the multiple frames of RAW images; The multiple frames of RAW component images are encoded according to the frame-level quantization parameters to obtain a code stream.
3. The method according to claim 2, characterized in that The encoding of the multiple RAW component images according to the frame-level quantization parameter to obtain a bitstream includes: Obtaining block-level quantization parameters of image blocks in the multi-frame RAW component image according to the frame-level quantization parameters and reference frame information, wherein the reference frame information is used to indicate overexposed image blocks and underexposed image blocks of a reference frame; The multiple frames of RAW component images are encoded according to the block-level quantization parameters to obtain a code stream.
4. The method according to claim 3, characterized in that The obtaining, according to the frame-level quantization parameter and the reference frame information, the block-level quantization parameter of the image block in the multi-frame RAW component image includes: When the target image block corresponds to the overexposed image block of the reference frame, the block-level quantization parameter of the target image block is obtained according to the frame-level quantization parameter and the overexposure adjustment parameter, and the target image block is any image block in the first RAW component image of the multiple frames.
5. The method according to claim 3 or 4, characterized in that The obtaining, according to the frame-level quantization parameter and the reference frame information, the block-level quantization parameter of the image block in the multi-frame RAW component image includes: In a case where the target image block corresponds to the underexposed image block of the reference frame, a block-level quantization parameter of the target image block is obtained according to the frame-level quantization parameter and the underexposure adjustment parameter.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The frame-level quantization parameters of the multiple-frame RAW images or the block-level quantization parameters of the image blocks in the multiple-frame RAW component images are encoded into the bitstream.
7. A coding method, characterized in that include: Acquire multiple RAW images and shooting information, wherein the shooting information includes ISO values of the multiple RAW images; Obtain multiple frames of RAW component images according to the multiple frames of RAW images; Determine frame-level quantization parameters of the multiple frames of RAW images according to the ISOs of the multiple frames of RAW images; The multiple frames of RAW component images are encoded according to the frame-level quantization parameters to obtain a code stream.
8. The method according to claim 7, characterized in that The encoding of the multiple RAW component images according to the frame-level quantization parameter to obtain a bitstream includes: Obtaining block-level quantization parameters of image blocks in the multi-frame RAW component image according to the frame-level quantization parameters and reference frame information, wherein the reference frame information is used to indicate overexposed image blocks and underexposed image blocks of a reference frame; The multiple frames of RAW component images are encoded according to the block-level quantization parameters to obtain a code stream.
9. The method according to claim 8, characterized in that The obtaining, according to the frame-level quantization parameter and the reference frame information, the block-level quantization parameter of the image block in the multi-frame RAW component image includes: When the target image block corresponds to the overexposed image block of the reference frame, the block-level quantization parameter of the target image block is obtained according to the frame-level quantization parameter and the overexposure adjustment parameter, and the target image block is any image block in the first RAW component image of the multiple frames.
10. The method according to claim 8 or 9, characterized in that The obtaining, according to the frame-level quantization parameter and the reference frame information, the block-level quantization parameter of the image block in the multi-frame RAW component image includes: In a case where the target image block corresponds to the underexposed image block of the reference frame, a block-level quantization parameter of the target image block is obtained according to the frame-level quantization parameter and the underexposure adjustment parameter.
11. The method according to any one of claims 7 to 10, characterized in that The encoding of the multiple RAW component images according to the frame-level quantization parameter to obtain a bitstream includes: Mapping the multiple RAW component images according to mapping parameters; Encoding the mapped multiple RAW component images according to the frame-level quantization parameter to obtain a bitstream; The mapping parameters are encoded into the codestream.
12. The method according to claim 11, characterized in that The shooting information further includes exposure values of the multiple frames of RAW images, and the method further includes: The mapping parameters are obtained according to the exposure amounts of the multiple frames of RAW images.
13. A decoding method, characterized in that: include: Decode the code stream to obtain multiple frames of RAW component images; Decode the code stream to obtain mapping parameters; Performing inverse mapping on the multiple frames of RAW component images according to the mapping parameters; A plurality of RAW images are obtained according to the inverse-mapped plurality of RAW component images.
14. The decoding method according to claim 13, characterized in that: The decoded code stream obtains multiple frames of RAW component images, including: Obtaining frame-level quantization parameters of the multiple RAW frames; The code stream is decoded according to the frame-level quantization parameter to obtain multiple frames of RAW component images.
15. The decoding method according to claim 13, wherein: Decoding the code stream to obtain multiple frames of RAW component images includes: Obtaining block-level quantization parameters of image blocks in the multi-frame RAW component image; The code stream is decoded according to the block-level quantization parameter to obtain multiple frames of RAW component images.
16. A decoding method, characterized in that: include: Obtaining frame-level quantization parameters of multiple RAW frames or block-level quantization parameters of image blocks in multiple RAW component frames; Decoding a bitstream according to the frame-level quantization parameter or the block-level quantization parameter to obtain a multi-frame RAW component map; A plurality of RAW images are obtained according to the plurality of RAW component images.
17. The method according to claim 16, characterized in that The obtaining of multiple RAW images according to the multiple RAW component images includes: Decode the code stream to obtain mapping parameters; Performing inverse mapping on the multiple frames of RAW component images according to the mapping parameters; A plurality of RAW images are obtained according to the inverse-mapped plurality of RAW component images.
18. An encoding device, characterized in that: include: Get unit, split unit, map unit and encode unit; The acquisition unit is configured to acquire multiple RAW image frames and shooting information, wherein the shooting information includes exposure values of the multiple RAW image frames; The splitting unit is configured to obtain multiple frames of RAW component images according to the multiple frames of RAW images; The mapping unit is configured to map the multiple RAW component images according to a mapping parameter, wherein the mapping parameter is related to the exposure of the multiple RAW images; The encoding unit is configured to encode the mapped multiple frames of RAW component images to obtain a code stream; The encoding unit is further configured to encode the mapping parameters into the code stream.
19. The device according to claim 18, characterized in that The shooting information further includes ISO values of the multiple RAW images, and the encoding unit is specifically configured to: Obtaining frame-level quantization parameters of the multiple frames of RAW images according to the ISOs of the multiple frames of RAW images; The multiple frames of RAW component images are encoded according to the frame-level quantization parameters to obtain a code stream.
20. The device according to claim 19, characterized in that The encoding unit is specifically used for: Obtaining block-level quantization parameters of image blocks in the multi-frame RAW component image according to the frame-level quantization parameters and reference frame information, wherein the reference frame information is used to indicate overexposed image blocks and underexposed image blocks of a reference frame; The multiple frames of RAW component images are encoded according to the block-level quantization parameters to obtain a code stream.
21. The device according to claim 20, characterized in that The encoding unit is specifically used for: When the target image block corresponds to the overexposed image block of the reference frame, the block-level quantization parameter of the target image block is obtained according to the frame-level quantization parameter and the overexposure adjustment parameter, and the target image block is any image block in the first RAW component image of the multiple frames.
22. The device according to claim 20 or 21, characterized in that The encoding unit is specifically used for: In a case where the target image block corresponds to the underexposed image block of the reference frame, a block-level quantization parameter of the target image block is obtained according to the frame-level quantization parameter and the underexposure adjustment parameter.
23. The device according to any one of claims 18 to 22, characterized in that The encoding unit is further configured to: The frame-level quantization parameters of the multiple-frame RAW images or the block-level quantization parameters of the image blocks in the multiple-frame RAW component images are encoded into the bitstream.
24. An encoding device, characterized in that include: Acquisition unit, split unit, determination unit and encoding unit; The acquiring unit is configured to acquire multiple RAW image frames and shooting information, wherein the shooting information includes ISO values of the multiple RAW image frames; The splitting unit is configured to obtain multiple frames of RAW component images according to the multiple frames of RAW images; The determining unit is configured to determine the frame-level quantization parameters of the multiple RAW images according to the ISO values of the multiple RAW images; The encoding unit is configured to encode the multiple frames of RAW component images according to the frame-level quantization parameter to obtain a code stream.
25. The device according to claim 24, characterized in that The encoding unit is specifically used for: Obtaining block-level quantization parameters of image blocks in the multi-frame RAW component image according to the frame-level quantization parameters and reference frame information, wherein the reference frame information is used to indicate overexposed image blocks and underexposed image blocks of a reference frame; The multiple frames of RAW component images are encoded according to the block-level quantization parameters to obtain a code stream.
26. The device according to claim 25, characterized in that The encoding unit is specifically used for: When the target image block corresponds to the overexposed image block of the reference frame, the block-level quantization parameter of the target image block is obtained according to the frame-level quantization parameter and the overexposure adjustment parameter, and the target image block is any image block in the first RAW component image of the multiple frames.
27. The device according to claim 25 or 26, characterized in that The encoding unit is specifically used for: In a case where the target image block corresponds to the underexposed image block of the reference frame, a block-level quantization parameter of the target image block is obtained according to the frame-level quantization parameter and the underexposure adjustment parameter.
28. The device according to any one of claims 24 to 27, characterized in that The encoding unit is specifically used for: Mapping the multiple RAW component images according to mapping parameters; Encoding the mapped multiple RAW component images according to the frame-level quantization parameter to obtain a bitstream; The mapping parameters are encoded into the codestream.
29. The device according to claim 28, characterized in that The shooting information further includes exposure values of the multiple RAW frames, and the determining unit is further configured to: The mapping parameters are obtained according to the exposure amounts of the multiple frames of RAW images.
30. A decoding device, characterized in that: include: decoding unit, inverse mapping unit and combining unit; The decoding unit is used to decode the code stream to obtain multiple frames of RAW component images; The decoding unit is further configured to decode the code stream to obtain mapping parameters; The inverse mapping unit is configured to perform inverse mapping on the multiple frames of RAW component images according to the mapping parameters; The combining unit is configured to obtain multiple frames of RAW images according to the multiple frames of RAW component images after inverse mapping.
31. The device according to claim 30, characterized in that The decoding unit is specifically configured to: Obtaining frame-level quantization parameters of the multiple RAW frames; The code stream is decoded according to the frame-level quantization parameter to obtain multiple frames of RAW component images.
32. The device according to claim 30, characterized in that The decoding unit is specifically configured to: Obtaining block-level quantization parameters of image blocks in the multi-frame RAW component image; The code stream is decoded according to the block-level quantization parameter to obtain multiple frames of RAW component images.
33. A decoding device, characterized in that: include: Acquisition unit, decoding unit and combination unit; The acquisition unit is used to acquire frame-level quantization parameters of multiple frames of RAW images or block-level quantization parameters of image blocks in multiple frames of RAW component images; The decoding unit is configured to decode the code stream according to the frame-level quantization parameter or the block-level quantization parameter to obtain a multi-frame RAW component map; The combining unit is configured to obtain multiple frames of RAW images based on the multiple frames of RAW component images.
34. The device according to claim 33, characterized in that The combination unit is specifically used for: Decode the code stream to obtain mapping parameters; Performing inverse mapping on the multiple frames of RAW component images according to the mapping parameters; A plurality of RAW images are obtained according to the inverse-mapped plurality of RAW component images.
35. An encoding device, characterized in that The coding device comprises at least one processor and a memory, wherein the at least one processor executes a program or instruction stored in the memory, so that the coding device implements the method according to any one of claims 1 to 12.
36. A decoding device, characterized in that The system comprises at least one processor and a memory, wherein 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 13 to 17.
37. A code stream storage method, characterized in that: include: Acquire and store the code stream obtained by the method according to any one of claims 1 to 17.
38. A code stream storage device, characterized in that: The device is used to obtain and store the code stream obtained by the method according to any one of claims 1 to 17.
39. A code stream transmission method, characterized in that: include: Acquire and transmit the code stream obtained by the method according to any one of claims 1 to 17.
40. A code stream transmission device, characterized in that: The device is used to obtain and transmit the code stream obtained by the method according to any one of claims 1 to 17.
41. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a code stream obtained by the method according to any one of claims 1 to 17.
42. A computer-readable storage medium, characterized in that Used to store a computer program, which, when executed on a computer or a processor, enables the computer or the processor to implement the method according to any one of claims 1 to 17.
43. A computer program product, characterized in that The computer program product includes instructions, and when the instructions are executed on a computer or a processor, the computer or the processor implements the method according to any one of claims 1 to 17.
Citation Information
Patent Citations
Image processing method and electronic equipment
CN110868548A
Encoder, decoder, encoding method, decoding method, encoding program, and decoding program
CN111869213A
Encoding apparatus and method, image capturing apparatus, and storage medium
CN113747152A
Video encoding device, method for controlling the same, and program
JP2020109923A
Video encoding method and apparatus, electronic device, and computer-readable storage medium
US20210409713A1