Image encoding and decoding method, device and system

By assigning personalized sub-target bit rates and encoding parameters to video image frames, the problem of uneven encoding performance caused by differences in the content of different image frames is solved, and more efficient video encoding and decoding effects are achieved.

CN118632000APending Publication Date: 2024-09-10HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310444868.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-03-07
Filing Date
2023-04-14
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

In the existing technology, in video encoding, due to the content differences of different image frames, the compression effect is uneven under the same target bit rate, which affects the overall encoding performance of the video.

Method used

By assigning a personalized sub-target code rate to each image frame, adjusting encoding parameters according to the content of the image frame, using the code rate control model and weight distribution network, optimizing the encoding and decoding process of the image frame to ensure that the code rate matches the content.

Benefits of technology

It improves the coding accuracy and compression rate of image frames, reduces the storage and transmission bandwidth of redundant information, and improves the overall performance of video encoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118632000A
    Figure CN118632000A
Patent Text Reader

Abstract

The invention discloses an image coding and decoding method, device and system, and relates to the technical field of image coding and decoding. And the coding device adjusts the sub-target code rate of the uncoded image frame in the video according to the target code rate of the video, the code rate of the coded image frame in the video and the image content contained in the uncoded image frame. For example, the coding device allocates a large sub-target code rate to an image frame containing rich image content, so that the bit stream of the image frame retains more image information, and the precision of video coding is improved; if the coding device distributes a small sub-target code rate for the image frame containing little image information, the image frame can compress redundant image information more effectively, the coding rate of the image frame in the video is reduced, and the compression rate of the image frame is improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 7, 2023, with application number 202310248372.5 and application name “Encoding and Decoding Methods, Devices and Systems”, all contents of which are incorporated by reference in this application. Technical Field

[0002] The present application relates to the field of image coding and decoding technology, and in particular to an image coding and decoding method, device and system. Background Art

[0003] Video is an image sequence including multiple continuous image frames, and one image frame corresponds to one image. Since the similarities between multiple continuous image frames are extremely high, the video needs to be compressed to facilitate the transmission and / or storage of the video. The processing device compresses the multiple image frames contained in the video according to the same target bit rate to obtain compressed data. However, the multiple image frames contained in the video have different image contents. When the processing device compresses different image frames according to the same target bit rate, there are obvious differences in the compression effects of different image frames, and the compression performance of the processing device on the video is affected. Summary of the invention

[0004] The present application provides an image encoding and decoding method, device and system, which solves the problem that the same target bit rate cannot effectively compress different image frames.

[0005] In a first aspect, the present application provides an image coding method. The image coding method is applied to an image coding and decoding system and is executed by a coding device included in the image coding and decoding system. The image coding method comprises: first, the coding device obtains a video and a target bit rate of the video. The video comprises a plurality of continuous image frames, and the plurality of continuous image frames comprise at least one of an encoded image frame and an unencoded image frame. Secondly, the coding device obtains a sub-target bit rate of the starting image frame for the starting image frame of the plurality of continuous image frames according to the target bit rate of the video and the image content of the starting image frame. Thirdly, for each image frame of the other image frames of the plurality of continuous image frames, the coding device obtains a sub-target bit rate of each image frame of the other image frames according to at least two of the target bit rate of the video, the bit rate of the encoded image frames in the video, and the image content of the unencoded image frames in the video. The other image frames indicate image frames that do not include the starting image frame in the plurality of continuous image frames. Finally, the coding device encodes the image frames corresponding to the sub-target bit rates of the image frames in the plurality of continuous image frames contained in the video according to the sub-target bit rates of the image frames to obtain a bit stream.

[0006] In the present application, the encoding device adjusts the sub-target bit rate of the unencoded image frame according to the target bit rate of the video, the bit rate of the encoded image frame, and the image content contained in the unencoded image frame. Since the sub-target bit rate is related to the image content contained in the image frame, the encoding device encodes the image frame based on the sub-target bit rate, which can improve the encoding accuracy of the image frame or the compression rate of the image frame. For example, the encoding device assigns a larger sub-target bit rate to an image frame containing rich image content, so that the bit stream of the image frame retains more image information, thereby improving the accuracy of video encoding; for another example, the encoding device assigns a smaller sub-target bit rate to an image frame containing less image information, so that the image frame can compress redundant image information more effectively, reduce the encoding bit rate of the image frame in the video, and improve the compression rate of the image frame.

[0007] In one possible implementation, multiple consecutive image frames include an encoded first image frame and an unencoded second image frame, and a sub-target bit rate of each image frame in other image frames is obtained, including: an encoding device obtains the sub-target bit rate of the second image frame according to the target bit rate of the video, the encoding bit rate of the first image frame, and the image content of the second image frame.

[0008] In a possible implementation, an encoding device encodes image frames corresponding to the sub-target bit rates of each image frame among a plurality of consecutive image frames contained in a video according to the sub-target bit rates of each image frame to obtain a bit stream, including: the encoding device inputs the sub-target bit rates of each image frame into a bit rate control model to obtain a parameter. The parameter indicates at least one of a quantization parameter and a feature of the image frame, and the feature of the image frame indicates the image content of the image frame. Exemplarily, the parameter includes a quantization parameter, parameters of each network in the encoding unit, and the like. And, the encoding device encodes each image frame according to the parameter to obtain a bit stream. The actual bit rate of the first image frame indicates the bit length occupied by the encoding result obtained by encoding the first image frame.

[0009] In the present application, when the encoding device encodes each image frame according to the parameters, since the parameters are determined by the encoding device according to the sub-target bit rate of each image frame using a rate control model, the parameters are adapted to the image information contained in each image frame, thereby avoiding the problem of low compression performance caused by encoding image frames containing different image information at the same target bit rate.

[0010] As a feasible implementation method, the encoding device can also update the rate control model according to the sub-target bit rate and the actual bit rate of the first image frame. The updated rate control model carries information about the sub-target bit rate and the actual bit rate of the image frame, and the rate control model is used to obtain parameters according to the sub-target bit rate, so that the parameters carry information about the sub-target bit rate.

[0011] In a possible implementation, the plurality of continuous image frames include a first image frame. The first image frame is any one of the plurality of continuous image frames. The encoding device inputs the sub-target bitrate of each image frame into a bitrate control model to obtain parameters, including: the encoding device inputs the first image frame into the bitrate control model to obtain features of the image frame; and the encoding device uses the bitrate control model to obtain parameters of the first image frame based on the features of the first image frame and the sub-target bitrate.

[0012] In the present application, since the characteristics of the image frame indicate the information such as the image content contained in the image frame, in the process in which the encoding device determines the parameters of the image frame based on the characteristics of the image frame and the sub-target bit rate, the parameters of the image frame also indicate the information such as the image content contained in the image frame. Therefore, when the encoding device performs encoding based on the parameters of the image frame, if the image frame contains more image information, a larger sub-target bit rate is set for the image frame to retain more image information and improve the accuracy of video encoding; if the image frame contains less image information, a smaller sub-target bit rate is set for the image frame to improve the compression rate of redundant information and reduce the storage space and communication bandwidth occupied by the bit stream of the image frame.

[0013] In a possible implementation, the plurality of continuous image frames include an unencoded first image frame and an encoded second image frame, and the first image frame and the second image frame are continuous. The encoding device obtains the features of the first image frame, including: first, the encoding device obtains the first image frame and the residual of the first image frame; the residual of the first image frame indicates the residual of the reconstructed frame of the first image frame and the second image frame. Secondly, the encoding device obtains the encoding information of the second image frame; the encoding information of the second image frame indicates at least one of the parameters of the second image frame, the encoding quality and the encoding bit rate of the second image frame, and the encoding quality of the second image frame indicates the difference between the reconstructed frame of the second image frame and the second image frame. Finally, the processing device obtains the features of the first image frame according to the first image frame, the residual of the first image frame and the encoding information of the second image frame.

[0014] In the present application, when encoding an unencoded image frame, the encoding device uses the encoding information of the encoded image frame as a reference. In the case where the image content of the unencoded image frame and the image content of the encoded image frame overlap a lot, the encoding device can increase the compression rate of the unencoded image frame by compressing the content contained in the unencoded image frame and the content that overlaps in the encoded image frame, thereby improving the compression rate of the image frame.

[0015] In a possible implementation, the plurality of continuous image frames include: at least two continuous uncoded image frames. The encoding device obtains the sub-target bit rate of each image frame in the other image frames, including: first, the encoding device inputs at least two uncoded image frames into a bit rate allocation model to obtain the weight of each uncoded image frame. The image content of the image frame includes at least one of the timing information of the image frame and the spatial complexity of the image frame. Secondly, the encoding device obtains the sub-target bit rate of each uncoded image frame according to the target bit rate of the video and the weights of the at least two uncoded image frames.

[0016] In this application, the encoding device obtains the sub-target bit rate of the image frame according to the image content of the image frame. For example, for image frames with rich image content, a larger sub-target bit rate is allocated to retain more image information and improve the accuracy of video encoding; for image frames with less image content, a smaller sub-target bit rate is allocated to compress the redundant information contained in the image frame, reduce the encoding bit rate of the image frame in the video, and improve the compression rate of the image frame.

[0017] As a feasible implementation, the bit rate allocation model is updated by the encoding device according to at least two of the target bit rate of the video, the real bit rates of at least two unencoded image frames, and the encoding information of the encoded image frames. The real bit rates of the at least two unencoded image frames indicate the bit length occupied by the encoding result obtained after encoding the at least two unencoded image frames.

[0018] In a possible implementation, the multiple continuous image frames included in the video include: at least two continuous uncoded image frames and coded image frames. The encoding device inputs at least two uncoded image frames into a rate allocation model to obtain the weight of each uncoded image frame, including: first, the encoding device inputs at least two uncoded image frames into a rate allocation model to obtain the features of at least two uncoded image frames. Secondly, the encoding device obtains the encoding information of the coded image frame. Among them, the encoding information of the coded image frame indicates the parameters of the coded image frame, the encoding quality, and the encoding bit rate of the coded image frame. The encoding quality indicates the difference between the reconstructed image frame of the coded image frame and the coded image frame. Finally, the encoding device determines the weights of the at least two uncoded image frames based on the features of the at least two uncoded image frames and the encoding information of the coded image frame.

[0019] In the present application, the encoding device processes the features contained in the unencoded image frame according to the information of the encoded image frame. For example, the proportion of features repeated with the encoded image frame is reduced, the redundant information in the image frame is compressed, the encoding bit rate of the compressed image frame is reduced, and the compression rate is improved; the proportion of features that are not repeated with the encoded image frame is increased, more information in the image frame that is different from other image frames is retained, and the encoding accuracy is improved.

[0020] In a second aspect, the present application provides an image encoding device, which includes modules for executing the method of the first aspect or any possible design of the first aspect.

[0021] In a possible design, the image encoding device includes: a video information acquisition module, a sub-target bit rate acquisition module for a starting frame, a sub-target bit rate acquisition module for other frames, an encoded image frame acquisition module and an encoding module. First, the video information acquisition module is used to acquire a video and a target bit rate of the video. The video includes a plurality of continuous image frames, and the plurality of continuous image frames include at least one of an encoded image frame and an unencoded image frame. Secondly, the sub-target bit rate acquisition module for the starting frame is used to: for a starting image frame of the plurality of continuous image frames, acquire the sub-target bit rate of the starting image frame according to the target bit rate of the video and the image content of the starting image frame. Thirdly, the sub-target bit rate acquisition module for other frames is used to acquire the sub-target bit rate of each image frame in the other image frames according to at least two of the target bit rate of the video, the bit rate of the encoded image frames in the video and the image content of the unencoded image frames in the video. Finally, the encoding module is used to encode the image frames corresponding to the sub-target bit rates of the image frames among a plurality of continuous image frames according to the sub-target bit rates of the image frames to obtain a bit stream.

[0022] In a third aspect, the present application provides a coding device. The coding device includes at least one processor and a memory. The memory is used to store a computer program, so that when the computer program is executed by at least one processor, the method described in the first aspect or any possible design of the first aspect is implemented.

[0023] In a fourth aspect, the present application provides an image decoding method. The image decoding method is applied to an image coding and decoding system and is executed by a decoding device included in the image coding and decoding system. The image decoding method includes: first, the decoding device obtains a bit stream of a video; the video includes multiple continuous image frames. Secondly, the decoding device obtains the encoding bit rate of each image frame according to the bit stream. Among them, the encoding bit rate of each image frame indicates the bit length occupied by the encoding result obtained by encoding each image frame. Thirdly, the decoding device obtains a parameter based on the encoding bit rate of each image frame. The parameter indicates at least one of a quantization parameter or a feature of the image frame, and the feature of the image frame indicates the image content contained in the image frame. Finally, the decoding device decodes the bit stream of the video according to the parameter to obtain a reconstructed image frame.

[0024] In the present application, since the parameters of the image frame indicate the image content contained in the image frame, the parameters of image frames with different image contents are different, such as the parameters of image frames with rich image content are different from the parameters of image frames with less image content. When the decoding device reconstructs the image frame according to the parameters corresponding to the image content of the image frame, the reconstructed image frame can more accurately display the image content contained in the aforementioned image frame, thereby reducing the distortion rate caused by the decoding device decoding the bit stream.

[0025] In a fifth aspect, the present application provides an image decoding device, which includes modules for executing the method of the fourth aspect or any possible design of the fourth aspect.

[0026] In a possible design, the image decoding device includes: a bitstream acquisition module, a bitstream parsing module and a decoding module. The bitstream acquisition module is used to acquire a bitstream of a video; the video includes a plurality of continuous image frames. The bitstream parsing module is used to parse the bitstream to acquire parameters of the plurality of continuous image frames, the parameters indicating at least one of a quantization parameter and a feature of the image frame, the feature of the image frame indicating the image content of the image frame. The decoding module is used to decode the bitstream of the video according to the parameters to obtain a reconstructed video.

[0027] In a sixth aspect, the present application provides an image decoding device. The decoding device includes at least one processor and a memory. The memory is used to store a computer program, so that when the computer program is executed by at least one processor, the method described in the fourth aspect or any possible design of the fourth aspect is implemented.

[0028] In a seventh aspect, the present application provides an image encoding and decoding device. The encoding and decoding device includes a memory and at least one processor. The memory is used to store a computer program. The processor is used to execute the computer program, execute the operation steps of the method in the first aspect or any possible implementation of the first aspect, and execute the operation steps of the method in the fourth aspect or any possible implementation of the fourth aspect.

[0029] In an eighth aspect, the present application provides a coding and decoding system, which includes the coding device described in the third aspect and the decoding device described in the seventh aspect.

[0030] In a ninth aspect, the present application provides a chip, which includes: a processor and a power supply circuit.

[0031] The power supply circuit is used to supply power to the processor. The processor is used to execute the operation steps of the method in the first aspect or any possible implementation of the first aspect, and execute the operation steps of the method in the fourth aspect or any possible implementation of the fourth aspect.

[0032] In a tenth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium includes: computer software instructions.

[0033] When the computer software instructions are executed in a computing device, the computing device executes the operating steps of the method in the first aspect or any possible implementation of the first aspect, and executes the operating steps of the method in the fourth aspect or any possible implementation of the fourth aspect.

[0034] In an eleventh aspect, the present application provides a computer program product. When the computer program product is run on a computer, the computing device executes the operation steps of the method in the first aspect or any possible implementation of the first aspect, and executes the operation steps of the method in the fourth aspect or any possible implementation of the fourth aspect. For example, the computer is the aforementioned encoding device and decoding device.

[0035] The beneficial effects of the second to eleventh aspects above can refer to the description of any implementation in the first or fourth aspects, and will not be repeated here. Based on the implementation provided by the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A schematic diagram of a neural network structure;

[0037] Figure 2 A schematic diagram of a video transmission system provided for this application;

[0038] Figure 3A A schematic diagram of a video encoding and decoding system provided in this application;

[0039] Figure 3B A schematic diagram of the structure of a video encoding and decoding system provided in this application;

[0040] Figure 3C A schematic diagram of the structure of a weight distribution network provided in this application;

[0041] Figure 3D A schematic diagram of the structure of a rate control unit provided in this application;

[0042] Figure 3E A schematic diagram of the structure of a coding unit provided in this application;

[0043] Figure 3F is a schematic diagram of the structure of another encoding unit;

[0044] Figure 4A A flowchart of an image encoding method provided by the present application;

[0045] Figure 4B A parameter acquisition flow chart provided for this application;

[0046] Figure 4C Another parameter acquisition flow chart provided for this application;

[0047] Figure 4D A flowchart of an image decoding method provided by the present application;

[0048] Figure 4E A flowchart of an image encoding and decoding method provided by this application;

[0049] Figure 5 Schematic diagram of the rate-distortion performance curve of the encoding and decoding method of the present application on different test sets;

[0050] Figure 6 A schematic diagram of the compression accuracy of the encoding and decoding method of this application;

[0051] Fig. 7A A schematic diagram of the structure of an encoding device provided in this application;

[0052] Figure 7B A schematic diagram of the structure of a decoding device provided by the present application;

[0053] Figure 8 A schematic diagram of the structure of an image processing system provided in this application. DETAILED DESCRIPTION

[0054] The terms used in the implementation method of this application are only used to explain the specific embodiments of this application, and are not intended to limit this application. The following is a brief introduction to some concepts that may be involved in this application.

[0055] (1) Video

[0056] Videos contain multiple continuous image frames. When the number of continuous image frames changes by more than 24 frames per second, the human eye cannot distinguish a single static image based on the principle of visual persistence, and it appears as a smooth and continuous multiple images, i.e., a video.

[0057] (2) Video Coding

[0058] Video encoding refers to the processing of a sequence of image frames that form a video or video sequence. In the field of video encoding, the terms "video frame", "picture", "frame", "image" or "image frame" can be used as synonyms. Video encoding used in this application means video encoding or video decoding. Video encoding is performed on the source side, and generally includes processing (e.g., compressing) the original video picture to reduce the amount of data required to represent the video picture under the condition of meeting a certain image quality, so as to store and / or transmit it more efficiently. Video decoding is performed on the destination side, and generally includes inverse processing relative to video encoding to reconstruct the video picture. The "encoding" of the video picture involved in the embodiment should be understood as involving the "encoding" or "decoding" of the video sequence. The combination of the encoding part and the decoding part is also called codec (encoding and decoding). Video coding can also be called image coding or image compression. Video decoding refers to the inverse process of video encoding.

[0059] (3) Current frame

[0060] The current frame refers to an image frame or an original image that is being encoded and decoded at the current moment.

[0061] (4) Image characteristics

[0062] The features of an image refer to some mathematical and physical properties that an image has that are different from other images. For example, it can be one or more of the color histogram, grayscale histogram, edge, skeleton, number of connected domains, and rectangularity.

[0063] (5) Data Rate

[0064] Bitstream refers to the binary stream generated after encoding a video or image. Bitstream is also called code stream, bit rate or data stream, which is the number of bits transmitted per unit time. It is an important part of picture quality control in video or image encoding. For images of the same resolution, the larger the bitstream of the image, the smaller the compression ratio and the better the picture quality.

[0065] (6) Neural Network

[0066] A neural network can be composed of neurons, and a neuron can be a s The output of this operation unit satisfies the following formula (1).

[0067]

[0068] Where, s = 1, 2, ... n, n is a natural number greater than 1, W s For x sThe weight of the neuron is , and b is the bias of the neuron. f is the activation function of the neuron, which is used to introduce nonlinear characteristics into the neural network and 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 layer. A neural network is a network formed by connecting multiple single neurons mentioned above. The weight represents the strength of the connection between different neurons and determines the influence of the input on the output.

[0069] Figure 1 Schematic diagram of a neural network structure. The neural network 100 includes X processing layers, where X is an integer greater than or equal to 3. The first layer of the neural network 100 is the input layer 110, which is responsible for receiving input signals. The last layer of the neural network 100 is the output layer 130, which is responsible for outputting the processing results of the neural network. The other layers except the first and last layers are intermediate layers 140, which together constitute the hidden layer 120. Each intermediate layer 140 in the hidden layer 120 can both receive input signals and output signals. The hidden layer 120 is responsible for processing input signals. Each layer represents a logical level of signal processing. Through multiple layers, the data signal can be processed by multiple levels of logic.

[0070] Based on a brief introduction to some concepts that may be involved in the present application, the implementation methods of the present application are described below in conjunction with the accompanying drawings.

[0071] Figure 2 A schematic diagram of a video transmission system provided in this application. Figure 2 As shown, the video processing process includes video acquisition, video encoding, video transmission, video decoding and display process. The video transmission system includes multiple terminal devices (such as Figure 2 The terminal devices 211 to 215 are shown and a network. The network can realize the function of video transmission, and the network can include one or more network devices, and the network device can be a router or a switch.

[0072] Figure 2 The terminal device shown may be, but is not limited to, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device may be a mobile phone (such as Figure 2 Terminal device 214 in the device), tablet computer, computer with wireless transceiver function (such as Figure 2 Terminal devices 215 in the virtual reality (VR) terminal devices (such as Figure 2terminal devices 213 in the field of automation, augmented reality (AR) terminal devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in smart cities, wireless terminals in smart homes, etc.

[0073] like Figure 2 As shown, in different video processing processes, the terminal devices can be different.

[0074] For example, during the video acquisition process, the terminal device 211 can be a camera device (such as a video camera, etc.) used for road monitoring, or it can be a mobile phone, tablet computer or smart wearable device with video acquisition function.

[0075] For another example, during the video encoding process, the terminal device 212 may be a server or a data center, and the data center may include one or more physical devices with encoding functions, such as a server, a mobile phone, a tablet computer or other encoding devices.

[0076] For example, during video decoding and display, the terminal device 213 may be a VR glasses, and the user may control the viewing angle by turning. The terminal device 214 may also be a mobile phone, and the user may control the viewing angle on the mobile phone 214 by touch operation or air operation. The terminal device 215 may also be a personal computer, and the user may control the viewing angle displayed on the display screen by input devices such as a mouse or keyboard.

[0077] It is understandable that video is a general term, and video includes a sequence of multiple continuous frames, and one frame corresponds to one image. For example, panoramic video can refer to 360° video or 180° video; in some possible situations, panoramic video can also refer to a "large" range video that exceeds the viewing angle range of the human eye (such as 110°~120°), such as 270° video.

[0078] Figure 2 This is just a schematic diagram. The video transmission system can also include Figure 2 The embodiments of the present application do not limit the number and type of terminal devices included in the system.

[0079] Combination of the above Figure 2 The video transmission system provided by the embodiment of the present application is described below. Figure 3A The video encoding and decoding system provided by this application is described. Figure 3AThe schematic diagram of the framework of a video coding and decoding system provided in the present application includes an encoding device 310 and a decoding device 320 . The encoding device 310 establishes a communication connection with the decoding device 320 via a communication channel 330 .

[0080] The encoding device 310 can implement the function of video encoding. The encoding device 310 can be Figure 2 The terminal device 212 shown may also be a data center with video encoding capabilities, such as a data center including multiple servers.

[0081] The encoding device 310 may include a data source 311 , a pre-processing module 312 , an encoder 313 , and a communication interface 314 .

[0082] The data source 311 may include or may be any type of electronic device for capturing video, and / or any type of source video generating device, such as a computer graphics processor for generating computer animation scenes or any type of device for acquiring and / or providing source video or computer-generated source video. The data source 311 may also be any type of memory or storage for storing the above-mentioned source video. The above-mentioned source video may include multiple video streams (bit streams) or images captured by multiple video capture devices (such as cameras).

[0083] An image can be considered as a two-dimensional array or matrix of pixels (picture elements). The pixels in the array can also be called sampling points. The number of sampling points in the array or image in the horizontal and vertical directions (or axes) defines the size and / or resolution of the image. In order to represent color, three color components are usually used, that is, the image can be represented as or include three sampling arrays. For example, in the RGB format or color space, the image includes corresponding red, green and blue sampling arrays. However, in video coding, each pixel is usually represented in a brightness / chrominance format or color space, for example, for an image in the YUV format, a brightness (luma) component indicated by Y (sometimes also indicated by L) and two chroma components indicated by U and V. The brightness component Y represents the brightness or grayscale level intensity (for example, the two are the same in a grayscale image), while the two chroma components U and V represent the chroma or color information components. Accordingly, an image in the YUV format includes a brightness sampling array of brightness sampling values ​​(Y) and two chroma sampling arrays of chroma values ​​(U and V). An image in RGB format can be converted or transformed into YUV format, and vice versa, which is also referred to as color conversion or transformation. If the image is black and white, the image may only include a brightness sampling array. In the present application, the image transmitted from the data source 311 to the preprocessing module 312 may also be referred to as an original image or source image.

[0084] The preprocessing module 312 is used to receive a source video or a plurality of frames of images, and preprocess the source video or the plurality of frames of images to obtain a preprocessed image. The source video may be a panoramic video. For example, the preprocessing performed by the preprocessing module 312 may include video cutting / splicing, color format conversion (for example, from RGB to YCbCr), etc. For example, the preprocessing module 312 may divide the source video into at least one mini-group of picture (min-gop), each of which includes a plurality of continuous image frames. For example, the video is divided into image group 1 to image group n, and image group 1 includes an I frame, a B frame, and a P frame. For another example, the preprocessing module 312 may also directly divide the source video into a plurality of continuous image frames.

[0085] The encoder 313 is used to receive the preprocessed image and encode the preprocessed image to obtain encoded data (such as a bit stream). The encoder 313 may include a rate allocation unit 3131, a rate control unit 3132 and an encoding unit 3133. For example, Figure 3B As shown, Figure 3B A schematic diagram of the structure of a video encoding and decoding system provided in this application.

[0086] like Figure 3B As shown, the bit rate allocation unit 3131 obtains the sub-target bit rate of the image according to the image content contained in the image, so that the sub-target bit rate of the image matches the image content. The image content can be at least one of the temporal information and spatial complexity of the image. For example, the spatial complexity of the image can be texture complexity, brightness complexity, chromaticity complexity, etc.; the temporal information of the image is the order of the image in the image sequence.

[0087] The rate allocation unit 3131 includes a weight allocation network and a sub-target rate update network. The weight allocation network obtains the weight of the image based on the image content. The sub-target rate update network obtains the sub-target rate of the image frame based on at least two of the weight of the image frame, the rate of the encoded frame, and the target rate of the video. The process of the weight allocation network obtaining the weight of the image is described in detail below. In the present application, the function of the rate allocation unit 3131 can be implemented by the support of the rate allocation model, and the function of the weight allocation network can be implemented by the support of the weight allocation model.

[0088] The weight distribution network obtains the weight of the image according to the image content, including the following two cases.

[0089] In a first possible example, the weight allocation network calculates the weight of the image according to at least one of the temporal information and the spatial complexity of the uncoded image.

[0090] In the second possible example, the weight allocation network calculates the weight of the image based on the information of the encoded image and at least one of the temporal information and spatial complexity of the unencoded image. For the specific structure and training process of the weight allocation network, please refer to the following Figure 3C The description is not repeated here.

[0091] The rate control unit 3132 outputs the sub-target rate parameters obtained by the rate allocation unit 3131 based on the different requirements of different application scenarios (e.g., real-time or online scenarios or offline scenarios). For the specific structure and training process of the rate control unit, please refer to the following Figure 3D In the present application, the function of the rate control unit may be implemented by the rate control model.

[0092] The encoding unit 3133 encodes the video or image sequence according to the parameters obtained by the bit rate control unit 3132 to obtain a bit stream.

[0093] The communication interface 314 is used to receive a bitstream and send the bitstream (or a version of the bitstream after any other processing) to another device such as the decoding device 320 or any other device through the communication channel 330 to store, display or directly reconstruct the original image frame.

[0094] The decoding device 320 can implement the functions of video decoding or image decoding. Figure 2 As shown, the decoding device 320 may be Figure 2 Any one of the terminal devices 213 to 215 is shown. The decoding device 320 may include a display device 321 , a post-processing module 322 , a decoder 323 and a communication interface 324 .

[0095] The communication interface 324 is used to receive a bitstream (or a version of the bitstream after any other processing is performed on the bitstream) from the encoding device 310 or any other encoding device such as a storage device.

[0096] The communication interface 314 and the communication interface 324 may be used to send or receive a bitstream via a direct communication link between the encoding device 310 and the decoding device 320. The direct communication link may be a 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.

[0097] The communication interface 324 and the communication interface 314 can be configured as follows: Figure 3AThe unidirectional communication interface or the bidirectional communication interface indicated by the arrow pointing from the encoding device 310 to the corresponding communication channel 330 of the decoding device 320 can be used to send and receive messages to establish a connection, etc., confirm and exchange information transmitted through the communication channel 330, such as the transmission of encoded compressed data (such as a bit stream) and any other information related to data transmission, etc.

[0098] The decoder 323 is used to receive the encoded data (bit stream, etc.) and decode the encoded data to obtain decoded data (video or image, etc.). Exemplarily, the decoder 323 may include a rate control unit 3231 and a decoding unit 3232. The rate control unit 3231 is used to determine the parameters used to decode the current frame, so that the decoding unit 3232 decodes the bit stream according to the parameters to obtain a reconstructed image.

[0099] The post-processing module 322 is used to post-process the decoded data after decoding to obtain post-processed data (such as a reconstructed image to be displayed or a reconstructed video to be displayed). The post-processing performed by the post-processing module 322 may include, for example, video splitting and fusion, color format conversion (such as conversion from YCbCr to RGB), etc., or any other processing for generating data for display by the display device 321, etc.

[0100] The display device 321 is used to receive the post-processing data for display to a user or viewer, etc. The display device 321 can be or include any type of display for displaying the reconstructed image / video, such as an integrated or external display screen or display. For example, the display screen can 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), a digital light processor (DLP), or any other type of display screen.

[0101] As an optional implementation, the encoding device 310 and the decoding device 320 may transmit the encoded data via a data forwarding device, such as a router or a switch.

[0102] The structure of the above codec system is only a schematic illustration. In some possible implementations, the codec system may further include other devices. For example, the codec system may further include a terminal-side device or a cloud-side device. Figure 2After the terminal 211 shown in the figure obtains the original image, the original image is preprocessed to obtain a preprocessed image; and the preprocessed image is transmitted to the terminal side device or the cloud side device (such as Figure 2 The terminal 212 shown in the figure) encodes and decodes the pre-processed image by the terminal-side device or the cloud-side device.

[0103] Combination of the above Figure 3A and Figure 3B The video encoding and decoding system provided by the embodiment of the present application is described below. Figure 3C Describes the weight distribution network in video encoding and decoding systems. Figure 3C A structural diagram of a weight allocation network provided in this application is provided. The structure and training process of the weight allocation network are introduced below.

[0104] ①The structure of the weight distribution network.

[0105] The weight distribution network includes convolutional layers, activation layers, pooling layers and fully connected layers (FC). The convolutional layer extracts the features of the image, the activation layer filters the features obtained by the convolutional layer, and the pooling layer pools the filtered features. The activation layer can use resblock, relu, etc. The pooling layer can use average pooling, minimum pooling or maximum pooling, etc. Exemplarily, the weight distribution network includes convolutional layer 1 (3, 64, 3), convolutional layer 2 (3, 128, 3), convolutional layer 3 (3, 128, 3), convolutional layer 4 (3, 128, 3), resblock (128, 3) × 3 and average pooling.

[0106] In one possible scenario, the weight assignment process uses coded image information. The coded image information can be processed using a multi-layer perception (MLP). Exemplarily, the weight assignment network uses MLP (1, 32, 64) to process the coded image information based on the parameters, coding quality, and coding bit rate of the coded image.

[0107] ② Training of weight distribution network.

[0108] The encoding device updates the bit rate allocation model according to at least two of the target bit rate of the video, the real bit rates of at least two unencoded image frames, and the encoding information of the encoded image frames. The real bit rate of each unencoded image frame indicates the bit length occupied by the encoding result obtained after encoding each unencoded image frame.

[0109] Taking a video containing multiple image groups as an example, formula (2) is used as the loss function when training the weight distribution network.

[0110]

[0111] Wherein, the subscript t represents the start time of the current image group, n represents the number of image groups considered during training, and λ g Represents the global λ value of the current image group. g Determines the target bitrate value when encoding the current group of pictures.

[0112] Combination of the above Figure 3C Describes the weight distribution network, and combines Figure 3D describe Figure 3A and Figure 3B The rate control unit involved. Figure 3D This is a schematic diagram of the structure of a rate control unit provided in the present application. The structure and training process of the rate control unit are introduced below.

[0113] ①The structure of the rate control unit.

[0114] The rate control unit includes a feature extraction network and a sub-target rate processing network.

[0115] The feature extraction network extracts features of the image frame. The feature extraction network may include a convolution layer, an activation layer, and a pooling layer. The activation layer may use resblock, relu, etc. The pooling layer may use average pooling, minimum pooling, or maximum pooling, etc. Exemplarily, the feature extraction network includes convolution layer 1 (3, 16, 2), convolution layer 2 (3, 32, 2), convolution layer 3 (3, 64, 2), convolution layer 4 (3, 64, 2), resblock (64, 3) × 3, and average pooling.

[0116] In a possible scenario, the rate control unit further includes a coded information acquisition network. The coded information acquisition network is used to acquire information of the coded image frame. Exemplarily, the coded information acquisition network includes MLP1 and MLP2. MLP1 (1, 32, 64) is used to process the coded image information, and the obtained processing result is used. The processing result and the feature are used as inputs of MLP2 (256, 684, 192) to obtain the feature after referring to the coded image information.

[0117] The sub-target rate processing network processes the sub-target rate. The sub-target rate processing network includes a third MLP and a norm function. Exemplarily, the sub-target rate processing network uses the sub-target rate as an input of MLP3 (1, 32, 64) to obtain a processing result, and uses the processing result and the mean and variance of the MLP3 output as inputs of the norm function to obtain the processed sub-target rate.

[0118] ② Training of the rate control unit.

[0119] When training the rate control unit, the rate allocation unit is not considered, and the connection order between the rate control unit and the encoder is reversed. The multiple image frames include a first image frame, and the first image frame indicates any one of the multiple image frames. Taking the first image frame as an example, the training process is described as follows: the rate control unit is updated according to the sub-target rate and the true rate of the first image frame. The true rate of the first image frame indicates the bit length occupied by the encoding result obtained by encoding the first image frame. The specific description of the training process of the rate control unit can refer to the relevant content of the following steps ① to ⑤.

[0120] Step ①: The encoder encodes the first image frame using randomly generated parameters to obtain a real bit rate of the first image frame. The bit rate is input into a bit rate control unit to obtain a prediction parameter predicted by the bit rate control unit.

[0121] Step ②: The encoder encodes the first image frame using the prediction parameter to obtain the encoding bit rate of the first image frame.

[0122] Step ③: Calculate the difference between the encoding bit rate of the first image frame and the sub-target bit rate of the first image frame. For the calculation method of the difference, please refer to formula (3) and formula (4).

[0123] L RI =(R target -R real ) 2 Formula (3)

[0124] R real =C(RI(R target )) Formula (4)

[0125] Among them, L RI Indicator difference, R target Indicates the sub-target bit rate, R real Indicates the actual bit rate.

[0126] Step ④: If the difference is greater than the set threshold, repeat steps ① to ③ using a non-first image frame among multiple image frames until the difference is less than or equal to the set threshold, then execute step ⑤.

[0127] Step ⑤: If the difference is less than or equal to the set threshold, the updated rate control model is output.

[0128] Combination of the above Figure 3D Describes the rate control unit, the following combines Figure 3E describe Figure 3A and Figure 3B The coding units involved in Figure 3E A schematic diagram of the structure of a coding unit provided in this application, such as Figure 3EAs shown, the encoding unit of the present application includes a residual encoding network, quantization, a residual decoding network, a motion transform enhancement network, a motion encoding network, an optical flow estimation network, and a bit rate prediction network. Figure 3F is a schematic diagram of the structure of another encoding unit, Figure 3F The difference between the coding unit shown is that the coding unit of the present application adopts a deep learning model. For the specific content of the deep learning model, please refer to the prior art, which will not be repeated here.

[0129] Combination of the above FIG. 3A to FIG. 3F The video encoding and decoding system provided by the present application is described below. Figure 4A The present invention describes the image encoding and decoding method provided by the present application. Figure 4A The following is a flow chart of an image encoding method provided by the present application. Figure 3A The encoding device 310 and the decoding device 320 perform the image encoding and decoding process as an example for specific description. Figure 4A As shown, the image encoding method includes the following steps.

[0130] Step S410: The encoding device obtains a video and a target bit rate of the video.

[0131] The video includes a plurality of continuous image frames. The target bit rate of the video varies with different application scenarios. For example, for the same video, the target bit rate of the video in an offline scenario is bit rate 1, and the target bit rate of the video in an offline scenario is bit rate 2, and bit rate 1 is less than bit rate 2.

[0132] Exemplarily, the video includes continuous image frame 1, image frame 2 and image frame 3. Image frame 1 and image frame 2 are uncoded image frames, image frame 3 is a coded image frame, and the target bit rate of the video is: m, such as m is 256 kilobits per second (kbps).

[0133] Step S420: For a starting image frame of the plurality of continuous image frames, the encoding device obtains a sub-target bit rate of the starting image frame according to a target bit rate of the video and image content of the starting image frame.

[0134] Step S430: For each of the other image frames of the plurality of continuous image frames, the encoding device obtains a sub-target bit rate of each of the other image frames according to at least two of the target bit rate of the video, the bit rate of the encoded image frames in the video, and the image content contained in the unencoded image frames in the video. The other image frames indicate image frames that do not contain the start image frame in the plurality of continuous image frames. In the present application, the image content contained in the image frame may also be referred to as the image information contained in the image frame.

[0135] Exemplarily, the video includes continuous image frame 2 and image frame 3. Image frame 2 is an uncoded image frame, and image frame 3 is a coded image frame. The encoding device obtains the sub-target bit rate of image frame 2 according to the target bit rate of the video, the encoding bit rate of image frame 3, and the image content of image frame 2.

[0136] In the first possible scenario, the plurality of continuous image frames include at least two uncoded image frames. The encoding device obtains the sub-target bitrate of each image frame in the other image frames, including: first, the encoding device inputs the at least two uncoded image frames into the bitrate allocation model to obtain the weight of each uncoded image frame. For this process, please refer to Figure 3C The description of is not repeated here. Secondly, the encoding device uses formula (5) to obtain the sub-target bit rate of each uncoded image frame according to the target bit rate of the video and the weight of each uncoded image frame.

[0137] Sub-target bitrate = target bitrate of video * weight formula of image frame (5)

[0138] For example, the target bit rate of the video is m, and the weight of the image frame 1 is w1. Then the sub-target bit rate 1 of the image frame 1 is m*w1.

[0139] In this application, the encoding device obtains the sub-target bit rate of the image frame according to the image content of the image frame. For example, for image frames with rich image content, a larger sub-target bit rate is allocated to retain more image information and improve the accuracy of video encoding; for image frames with less image content, a smaller sub-target bit rate is allocated to compress the redundant information contained in the image frame, reduce the encoding bit rate of the image frame in the video, and improve the compression rate of the image frame.

[0140] In the second possible scenario, the multiple consecutive image frames include: at least two uncoded image frames and coded image frames, and at least two uncoded image frames and coded image frames are consecutive. The encoding device obtains the sub-target bit rate of each image frame in the other image frames, including: first, the encoding device obtains the weight of each uncoded image frame according to the information of the coded image frame and the image content contained in the uncoded image frame. For this process, please refer to Figure 3C The description of the encoding device is not repeated here. Secondly, the encoding device obtains the sub-target bit rate of each unencoded image frame according to the target bit rate of the video, the bit rate of the encoded image frame and the weights of at least two unencoded image frames. In this application, the encoding bit rate of the encoded image frame is also called the bit rate of the encoded image frame.

[0141] In the present application, the encoding device processes the features contained in the unencoded image frame according to the information of the encoded image frame. For example, the proportion of features repeated with the encoded image frame is reduced, the redundant information in the image frame is compressed, the encoding bit rate of the compressed image frame is reduced, and the compression rate is improved; the proportion of features that are not repeated with the encoded image frame is increased, more information in the image frame that is different from other image frames is retained, and the encoding accuracy is improved.

[0142] As a feasible implementation method, when the video is divided into at least one image group for encoding and decoding, the sub-target updating sub-unit obtains the sub-target bit rate of the image frame according to the image weight, the bit rate of the encoded frame and the target bit rate of the image group.

[0143] Step S440: The encoding device encodes each image frame according to the sub-target bit rate of each image frame to obtain a bit stream.

[0144] The bit rate of the bit stream matches the target bit rate of the video. Matching may mean that the bit rate of the bit stream is consistent with the target bit rate of the video, or that the difference between the bit rate of the bit stream and the target bit rate of the video is less than a set threshold.

[0145] In one possible scenario, the encoding device inputs the sub-target bit rate of each image frame into the bit rate control model to obtain a parameter. The parameter indicates at least one of a quantization parameter and a feature of the image frame, and the feature of the image frame indicates the image content of the image frame. When the parameter indicates the feature of the image frame, the parameter refers to the weight of the connection between the neurons of each layer of each network of the encoding unit, such as the weight of the connection between the neurons of each layer in the residual coding network. For more information about the bit rate control model, please refer to Figure 3D The encoding device encodes each image frame according to the parameter to obtain a bit stream.

[0146] In the present application, when the encoding device encodes each image frame according to the parameters, since the parameters are determined by the encoding device according to the sub-target bit rate of each image frame using a rate control model, the parameters are adapted to the image information contained in each image frame, thereby avoiding the problem of low compression performance caused by encoding image frames containing different image information at the same target bit rate.

[0147] The encoding device inputs the sub-target bit rate of each image frame into the bit rate control model to obtain the parameter process, which is divided into the following two cases according to whether the encoded image information is introduced.

[0148] In a first possible scenario, the multiple image frames include: a first image frame, wherein the first image frame is any one of multiple continuous image frames. Figure 4B A parameter acquisition flow chart provided for this application, such as Figure 4BAs shown, the encoding device obtains parameters including the following steps SB410 to SB430.

[0149] Step SB410: The encoding device obtains the sub-target bit rate of the first image frame.

[0150] In step SB420, the encoding device inputs the first image frame into a rate control model to obtain features of the first image frame.

[0151] In step SB430, the encoding device uses a rate control model to obtain parameters of the first image frame based on the characteristics of the first image frame and the sub-target rate of the first image frame.

[0152] In the present application, since the characteristics of the image frame indicate the information such as the image content contained in the image frame, in the process in which the encoding device determines the parameters of the image frame based on the characteristics of the image frame and the sub-target bit rate, the parameters of the image frame also indicate the information such as the image content contained in the image frame. Therefore, when the encoding device performs encoding based on the parameters of the image frame, if the image frame contains more image information, a larger sub-target bit rate is set for the image frame to retain more image information and improve the accuracy of video encoding; if the image frame contains less image information, a smaller sub-target bit rate is set for the image frame to improve the compression rate of redundant information and reduce the storage space and communication bandwidth occupied by the bit stream of the image frame.

[0153] In a second possible scenario, the multiple image frames include: a first image frame and a second image frame. The first image frame is an uncoded image frame, the second image frame is a coded image frame, and the first image frame and the second image frame are continuous. Figure 4C Another parameter acquisition flow chart provided for this application is as follows: Figure 4C As shown, the parameters acquired by the encoding device include the following steps SC410 to SC440.

[0154] In step SC410, the encoding device obtains a first image frame and a residual of the first image frame, wherein the residual of the first image frame indicates a residual of a reconstructed frame of the first image frame and the second image frame.

[0155] In step SC420, the encoding device obtains encoding information of the second image frame. The encoding information of the second image frame indicates at least one of the parameters used when encoding the second image frame, the encoding quality, and the encoding bit rate of the second image frame. The encoding quality indicates the difference between the reconstructed frame of the second image frame and the second image frame.

[0156] In step SC430 , the encoding device obtains the feature of the first image frame according to the first image frame, the residual of the first image frame, and the encoding information of the second image frame.

[0157] In step SC440 , the encoding device uses a rate control model to obtain parameters of the first image frame based on the features of the first image frame and the sub-target rate of the first image frame.

[0158] In the present application, the encoding device adjusts the sub-target bit rate of the unencoded image frame according to the target bit rate of the video, the bit rate of the encoded image frame, and the image content contained in the unencoded image frame. Since the sub-target bit rate is related to the image content contained in the image frame, the encoding device encodes the image frame based on the sub-target bit rate, which can improve the encoding accuracy of the image frame or the compression rate of the image frame. For example, the encoding device assigns a larger sub-target bit rate to an image frame containing rich image content, so that the bit stream of the image frame retains more image information, thereby improving the accuracy of video encoding; for another example, the encoding device assigns a smaller sub-target bit rate to an image frame containing less image information, so that the image frame can compress redundant image information more effectively, reduce the encoding bit rate of the image frame in the video, and improve the compression rate of the image frame. Figure 5 Schematic diagram of the rate-distortion performance curve of the encoding and decoding method of this application on different test sets, Figure 6 Table 1 is a compression performance table of the coding and decoding method of the present application in different scenarios. From Table 1, it can be seen that the image coding and decoding method of the present application has a good compression effect for the E-type sequence which is mainly a static scene.

[0159] Table 1

[0160]

[0161] After the encoding device encodes the video to obtain the bit stream, it can be used Figure 3A The communication channel transmits the bit stream to the decoding device, and the decoding device decodes the received bit stream to obtain the reconstructed video. Figure 4D A flowchart of an image decoding method provided by this application is shown in FIG. Figure 4E A flowchart of an image encoding and decoding method provided by this application is shown in FIG. Figure 4D and Figure 4E As shown, the decoding method may include the following steps S450 to S480.

[0162] Step S450: The decoding device obtains the video bit stream.

[0163] In a first possible example, the encoding device may send a bit stream of the video to the decoding device after encoding the entire video.

[0164] In a second possible example, the encoding device may also encode the original image in real time in units of frames, and send a bit stream of one frame after encoding one frame.

[0165] The above two examples are only possible implementations of sending bit streams provided in this embodiment and should not be understood as limiting the present application. The specific method of sending bit streams by the encoding device can refer to the general technology and the description of the communication interface in the above embodiment.

[0166] S460: The decoding device obtains the encoding bit rate of each image frame according to the bit stream.

[0167] The encoding bit rate of each image frame indicates the bit length occupied by the encoding result obtained by encoding each image frame.

[0168] The parameter indicates at least one of a quantization parameter and a feature of the image frame, and the feature of the image frame indicates the image content of the image frame.

[0169] S470: The decoding device obtains parameters according to the encoding bit rate of each image frame.

[0170] S480: The decoding device decodes the video bit stream according to the parameters to obtain a reconstructed image frame.

[0171] The decoding device displays the reconstructed image frame. Alternatively, the decoding device transmits the reconstructed image frame to other display devices, which then display the reconstructed image frame.

[0172] In the present application, since the parameters of the image frame indicate the image content contained in the image frame, the parameters of image frames with different image contents are different, such as the parameters of image frames with rich image content are different from the parameters of image frames with less image content. When the decoding device reconstructs the image frame according to the parameters corresponding to the image content of the image frame, the reconstructed image frame can more accurately display the image content contained in the aforementioned image frame, thereby reducing the distortion rate caused by the decoding device decoding the bit stream.

[0173] Combination of the above Figure 4A-Figure 6 Describes the encoding and decoding method provided by this application, and the following is combined with Fig. 7A The encoding device provided by the present application is described. Fig. 7A This is a structural schematic diagram of a coding device provided in the present application, the coding device includes a video information acquisition module 710, a sub-target bit rate acquisition module 720 for a starting frame, a sub-target bit rate acquisition module 730 for other frames, and a coding module 740.

[0174] The video information acquisition module is used to acquire a video and a target bit rate of the video. The video includes a plurality of continuous image frames, and the plurality of continuous image frames include at least one of an encoded image frame and an unencoded image frame. The sub-target bit rate acquisition module 720 of the starting frame is used to: for the starting image frame of the plurality of continuous image frames, acquire the sub-target bit rate of the starting image frame according to the target bit rate of the video and the image content of the starting image frame. The sub-target bit rate acquisition module 730 of other frames is used to acquire the sub-target bit rate of each image frame in the other image frames of the plurality of continuous image frames according to at least two of the target bit rate of the video, the bit rate of the encoded image frames in the video, and the image content of the unencoded image frames in the video. The encoding module 740 is used to encode the image frames corresponding to the sub-target bit rates of the image frames in the plurality of continuous image frames according to the sub-target bit rates of the image frames to obtain a bit stream. The bit rate of the bit stream matches the target bit rate of the video. Matching may mean that the bit rate of the bit stream is consistent with the target bit rate of the video, or may mean that the difference between the bit rate of the bit stream and the target bit rate of the video is less than a set threshold.

[0175] In a possible scenario, the multiple consecutive image frames include an encoded first image frame and an unencoded second image frame, and the sub-target bit rate acquisition module for other frames is specifically used to obtain the sub-target bit rate of the second image frame according to the target bit rate of the video, the encoding bit rate of the first image frame and the image content of the second image frame. In a possible scenario, the multiple consecutive image frames include at least two consecutive unencoded image frames. The sub-target bit rate acquisition module 730 for other frames is specifically used to input at least two unencoded image frames into a bit rate allocation model to obtain the weight of each unencoded image frame. The sub-target bit rate acquisition module 730 for other frames is also specifically used to obtain the sub-target bit rate of each unencoded image frame according to the target bit rate of the video and the weights of at least two unencoded image frames.

[0176] In a possible scenario, the multiple continuous image frames include: an encoded image frame and at least two continuous unencoded image frames. The sub-target rate acquisition module 730 for other frames is also specifically used to input at least two unencoded image frames into a rate allocation model to obtain the characteristics of the at least two unencoded image frames. The sub-target rate acquisition module 730 for other frames is also specifically used to obtain the encoding information of the encoded image frame. The encoding information of the encoded image frame indicates at least one of the parameters of the encoded image frame, the encoding quality, and the encoding rate of the encoded image frame. The encoding quality indicates the difference between the reconstructed image frame of the encoded image frame and the encoded image frame. The sub-target rate acquisition module 730 for other frames is also specifically used to determine the weights of the at least two unencoded image frames based on the characteristics of the at least two unencoded image frames and the encoding information of the encoded image frames.

[0177] In a possible scenario, the encoding module 740 is specifically configured to input the sub-target bit rate of each image frame into the bit rate control model to obtain parameters. The encoding module 740 is also specifically configured to encode each image frame according to the parameters to obtain a bit stream.

[0178] In a possible scenario, the plurality of continuous image frames include: a first image frame. The first image frame is any one of the plurality of continuous image frames. The encoding module 740 is specifically used to input the first image frame into a rate control model to obtain features of the first image frame. The encoding module 740 is also specifically used to obtain a sub-target rate of the first image frame. The encoding module is also specifically used to obtain parameters of the first image frame according to the features of the first image frame and the sub-target rate of the first image frame using the rate control model.

[0179] In a possible scenario, the multiple continuous image frames include: a first image frame and a second image frame. The second image frame is an encoded image frame that is continuous with the first image frame. The encoding module 740 is specifically used to obtain the residual of the first image frame and the first image frame. The residual of the first image frame indicates the residual of the reconstructed frame of the first image frame and the second image frame. The encoding module 740 is also specifically used to obtain the encoding information of the second image frame. The encoding information refers to at least one of the parameters of the second image frame, the encoding quality and the encoding bit rate obtained after encoding the second image frame. The encoding quality refers to the difference between the reconstructed frame of the second image frame and the second image frame. The encoding module 740 is also specifically used to obtain the characteristics of the first image frame based on the first image frame, the residual of the first image frame and the encoding information of the second image frame.

[0180] The encoding device according to the embodiment of the present application may correspond to the method described in the embodiment of the present application, and the various modules and other operations and / or functions in the encoding device are respectively for implementing the corresponding processes of the various methods in the aforementioned figures, which will not be repeated here for the sake of brevity.

[0181] Combination of the above Fig. 7A The image encoding device provided by the present application is described below. Figure 7B The image decoding device provided by the present application is described. Figure 7B A schematic diagram of the structure of an image decoding device provided by the present application is shown in FIG. Figure 7B As shown, the image decoding device includes a bit stream acquisition module, a code rate acquisition module, a parameter acquisition module and a decoding module.

[0182] The bitstream acquisition module is used to acquire the bitstream of the video; the video includes multiple continuous image frames. The bitrate acquisition module is used to acquire the encoding bitrate of each image frame according to the bitstream of the video, and the encoding bitrate of each image frame indicates the bit length occupied by the encoding result obtained by encoding each image frame. The parameter acquisition module is used to: acquire parameters according to the encoding bitrate of each image frame. The decoding module is used to decode the bitstream of the video according to the parameters to obtain the reconstructed image frame.

[0183] Figure 8 Schematic diagram of the structure of an image processing system provided by the present application. The image processing system is described by taking a mobile phone as an example. The mobile phone or the chip system built into the mobile phone includes: a memory 810, a processor 820, a sensor component 830, a multimedia component 840 and an input / output interface 850. Figure 8 Provide a detailed introduction to each component of a mobile phone or a chip system built into a mobile phone.

[0184] The memory 810 can be used to store data, software programs and modules; it mainly includes a program storage area and a data storage area, wherein the program storage area can store software programs, including instructions formed in code, including but not limited to an operating system, an application required for at least one function, such as a sound playback function, an image playback function, etc.; the data storage area can store data created according to the use of the mobile phone, such as audio data, image data, a phone book, etc. In the embodiment of the present application, the memory 810 can be used to store multiple continuous image frames contained in a video, etc. In some feasible embodiments, there may be one memory or multiple memories; the memory may include a floppy disk, a hard disk such as a built-in hard disk and a mobile hard disk, a magnetic disk, an optical disk, a magneto-optical disk such as a compact disc read-only memory (CD_ROM), a DCD_ROM, a non-volatile storage device such as a random access memory (RAM), 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), a flash memory, or any other form of storage medium known in the technical field.

[0185] The processor 820 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire device. By running or executing software programs and / or software modules stored in the memory 810, and calling data stored in the memory 810, it executes various functions of the mobile phone and processes data, thereby monitoring the mobile phone as a whole. In the embodiment of the present application, the processor 820 can be used to execute one or more steps in the method embodiment of the present application. For example, the processor 820 can be used to execute one or more steps from S410 to S480 in the above method embodiment. In some feasible embodiments, the processor 820 can be a single processor structure, a multi-processor structure, a single-threaded processor, and a multi-threaded processor; in some feasible embodiments, the processor 820 can include at least one of a central processing unit, a general processor, a digital signal processor, a neural network processor, an image processing unit, an image signal processor, a microcontroller or a microprocessor. In addition, the processor 820 may further include other hardware circuits or accelerators, such as application-specific integrated circuits, field programmable gate arrays or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of the present application. The processor 820 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on.

[0186] The sensor component 830 includes one or more sensors for providing status assessment of various aspects for the mobile phone. Among them, the sensor component 830 may include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications, that is, a component of a camera or a camera head. In the present application, the sensor component 830 can be used to support the camera in the multimedia component 840 to obtain video or image frames, etc. In addition, the sensor component 830 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor. The acceleration / deceleration, orientation, open / closed state of the mobile phone, the relative positioning of the components, or the temperature change of the mobile phone can be detected by the sensor component 830.

[0187] The multimedia component 840 provides a screen of an output interface between the mobile phone and the user, and the screen can be a touch panel, and when the screen is a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide and gestures on the touch panel. The touch sensor can not only sense the boundary of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In addition, the multimedia component 840 also includes at least one camera, for example, the multimedia component 840 includes a front camera and / or a rear camera. When the mobile phone is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can sense an external multimedia signal, which is used to form an image frame. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0188] The input / output interface 850 provides an interface between the processor 820 and a peripheral interface module. For example, the peripheral interface module may include a keyboard, a mouse, or a USB (Universal Serial Bus) device, etc. In a possible implementation, the input / output interface 850 may have only one input / output interface or may have multiple input / output interfaces.

[0189] Although not shown, the mobile phone may also include an audio component and a communication component, for example, the audio component includes a microphone, and the communication component includes a wireless fidelity (WiFi) module, a Bluetooth module, etc., which will not be described in detail in the embodiments of the present application.

[0190] The image processing system may be a general purpose device or a dedicated device. For example, the image processing system may be an edge device (e.g., a box carrying a chip with processing capabilities), etc. Alternatively, the image processing system may also be a server or other device with computing capabilities.

[0191] It should be understood that the image processing system according to this embodiment may correspond to the encoding device or decoding device in this embodiment, and may correspond to the execution of the corresponding subject according to any method in the aforementioned figures, and the various modules and other operations and / or functions in the encoding device or decoding device are respectively for implementing the corresponding processes of each method in the aforementioned figures, which will not be repeated here for the sake of brevity.

[0192] The method steps in this embodiment can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM, flash memory, ROM, PROM, EPROM, EEPROM, registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a computing device. Of course, the processor and the storage medium can also be present in a network device or a terminal device as discrete components.

[0193] The present application also provides a chip system, which includes a processor for implementing the functions of the encoding and decoding device in the above method. In one possible design, the chip system also includes a memory for storing program instructions and / or data. The chip system can be composed of a chip, or can include a chip and other discrete devices.

[0194] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD).

[0195] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for encoding an image, It is characterized in that Acquire a video and a target bit rate of the video, wherein the video includes a plurality of continuous image frames; For a starting image frame of the plurality of continuous image frames, obtaining a sub-target bit rate of the starting image frame according to a target bit rate of the video and image content of the starting image frame; For each of the other image frames of the plurality of continuous image frames, a sub-target bit rate of each of the other image frames is obtained according to at least two of a target bit rate of the video, a bit rate of an encoded image frame in the video, and image content of an unencoded image frame in the video; According to the sub-target bit rate of each image frame, the image frames corresponding to the sub-target bit rate of each image frame among the plurality of continuous image frames are encoded to obtain a bit stream.

2. The method according to claim 1, It is characterized in that The plurality of consecutive image frames include an encoded first image frame and an unencoded second image frame, The obtaining of the sub-target bit rate of each image frame in the other image frames includes: A sub-target bit rate of the second image frame is acquired according to the target bit rate of the video, the encoding bit rate of the first image frame, and the image content of the second image frame.

3. The method according to claim 1, It is characterized in that The step of encoding the image frames corresponding to the sub-target bit rates of the image frames among the plurality of continuous image frames according to the sub-target bit rates of the image frames to obtain a bit stream comprises: Inputting the sub-target bit rate of each image frame into a bit rate control model to obtain a parameter; the parameter indicates at least one of a quantization parameter and a feature of the image frame, and the image frame feature is used to indicate the image content of the image frame; The image frames are encoded according to the parameters to obtain the bit stream.

4. The method according to claim 3, It is characterized in that The plurality of continuous image frames include a first image frame, and the first image frame is any one of the plurality of continuous image frames; The step of inputting the sub-target bit rate of each image frame into a bit rate control model to obtain the parameter comprises: Inputting the first image frame into the rate control model to obtain features of the first image frame; Obtaining a sub-target bit rate of the first image frame; The rate control model obtains parameters of the first image frame based on the characteristics of the first image frame and the sub-target rate of the first image frame.

5. The method according to claim 4, It is characterized in that The plurality of continuous image frames include a second image frame, wherein the second image frame is an encoded image frame continuous with the first image frame; The acquiring the feature of the first image frame comprises: Acquire a residual between the first image frame and the second image frame, where the residual of the first image frame is used to indicate a residual of a reconstructed frame of the first image frame and the second image frame; Acquire encoding information of the second image frame, where the encoding information is used to indicate at least one of a parameter of the second image frame, encoding quality, and encoding bit rate of the second image frame, where the encoding quality indicates a difference between a reconstructed frame of the second image frame and the second image frame; A feature of the first image frame is obtained according to the first image frame, the residual of the first image frame and the encoding information of the second image frame.

6. The method according to claim 4 or 5, It is characterized in that The method further comprises: The rate control model is updated according to the sub-target bit rate and the actual bit rate of the first image frame, where the actual bit rate of the first image frame indicates the bit length occupied by the encoding result obtained after encoding the first image frame.

7. The method according to any one of claims 1 to 6, It is characterized in that The plurality of consecutive image frames include: at least two consecutive unencoded image frames; The obtaining of the sub-target bit rate of each image frame includes: Inputting the at least two uncoded image frames into a bit rate allocation model to obtain a weight of each uncoded image frame; According to the target bit rate of the video and the weights of the at least two uncoded image frames, a sub-target bit rate of each uncoded image frame is obtained.

8. The method according to claim 7, It is characterized in that The plurality of continuous image frames include: an encoded image frame and at least two continuous unencoded image frames; The step of inputting the at least two uncoded image frames into the bit rate allocation model to obtain a weight of each uncoded image frame includes: Inputting the at least two uncoded image frames into the bit rate allocation model to obtain features of the at least two uncoded image frames; Acquire encoding information of the encoded image frame, where the encoding information of the encoded image frame is used to indicate at least one of a parameter of the encoded image frame, encoding quality, and encoding bit rate of the encoded image frame, where the encoding quality indicates a difference between a reconstructed image frame of the encoded image frame and the encoded image frame; The weights of the at least two uncoded image frames are determined according to the features of the at least two uncoded image frames and the coding information of the coded image frames.

9. The method according to claim 7 or 8, It is characterized in that The method further comprises: The bit rate allocation model is updated according to at least two of the target bit rate of the video, the actual bit rates of the at least two unencoded image frames, and the encoding information of the encoded image frames; the actual bit rate of each unencoded image frame indicates the bit length occupied by the encoding result obtained after encoding each unencoded image frame.

10. An image encoding device, It is characterized in that The device comprises: A video information acquisition module, used to: acquire a video and a target bit rate of the video, wherein the video includes a plurality of continuous image frames; A sub-target bit rate acquisition module for a starting frame is used to: for a starting image frame of the plurality of continuous image frames, acquire a sub-target bit rate of the starting image frame according to a target bit rate of the video and an image content of the starting image frame; A sub-target bit rate acquisition module for other frames is used to: for each image frame in the other image frames of the plurality of continuous image frames, acquire a sub-target bit rate for each image frame in the other image frames according to at least two of the target bit rate of the video, the bit rate of the encoded image frames in the video, and the image content of the unencoded image frames in the video; The encoding module is used to: encode the image frames corresponding to the sub-target bit rates of the image frames among the plurality of continuous image frames according to the sub-target bit rates of the image frames to obtain a bit stream.

11. The device according to claim 10, It is characterized in that The plurality of consecutive image frames include an encoded first image frame and an unencoded second image frame, The sub-target bit rate acquisition module for other frames is specifically used to acquire the sub-target bit rate of the second image frame according to the target bit rate of the video, the encoding bit rate of the first image frame and the image content of the second image frame.

12. The device according to claim 10, It is characterized in that The encoding module is specifically used to input the sub-target bit rate of each image frame into a bit rate control model to obtain parameters; The encoding module is further specifically used to encode each image frame according to the parameters to obtain the bit stream.

13. The device according to claim 12, It is characterized in that The plurality of continuous image frames include a first image frame, and the first image frame is any one of the plurality of continuous image frames; The encoding module is specifically configured to input the first image frame into the rate control model to obtain features of the first image frame; The encoding module is further specifically used to obtain a sub-target bit rate of the first image frame; The encoding module is further specifically used to obtain parameters of the first image frame according to the characteristics of the first image frame and the sub-target bit rate of the first image frame by using the bit rate control model.

14. The device according to claim 13, It is characterized in that The plurality of continuous image frames include a second image frame, wherein the second image frame is an encoded image frame continuous with the first image frame; The encoding module is specifically used to obtain a residual between the first image frame and the second image frame, where the residual of the first image frame is used to indicate a residual of a reconstructed frame between the first image frame and the second image frame; The encoding module is further specifically used to obtain encoding information of the second image frame, where the encoding information is used to indicate at least one of a parameter of the second image frame, encoding quality, and encoding bit rate of the second image frame, where the encoding quality indicates a difference between a reconstructed frame of the second image frame and the second image frame; The encoding module is further specifically configured to obtain a feature of the first image frame according to the first image frame, the residual of the first image frame and the encoding information of the second image frame.

15. The device according to claim 13 or 14, It is characterized in that The device also includes: The rate control model updating module is used to update the rate control model according to the sub-target rate and the actual rate of the first image frame, wherein the actual rate of the first image frame indicates the bit length occupied by the encoding result obtained by encoding the first image frame.

16. The device according to any one of claims 10 to 15, It is characterized in that The plurality of consecutive image frames include: at least two consecutive unencoded image frames; The sub-target bit rate acquisition module of the other frames is specifically used to input the at least two uncoded image frames into the bit rate allocation model to obtain the weight of each uncoded image frame; The sub-target bit rate acquisition module for other frames is further specifically used to acquire the sub-target bit rate of each uncoded image frame according to the target bit rate of the video and the weights of the at least two uncoded image frames.

17. The device according to claim 16, It is characterized in that The plurality of continuous image frames include: an encoded image frame and at least two continuous unencoded image frames; The sub-target bit rate acquisition module of other frames is further specifically used to input the at least two uncoded image frames into a bit rate allocation model to acquire features of the at least two uncoded image frames; The sub-target bit rate acquisition module of the other frames is further specifically used to acquire the encoding information of the encoded image frame, where the encoding information of the encoded image frame is used to indicate at least one of a parameter of the encoded image frame, an encoding quality, and an encoding bit rate of the encoded image frame, where the encoding quality indicates a difference between a reconstructed image frame of the encoded image frame and the encoded image frame; The sub-target bit rate acquisition module for other frames is further specifically used to determine the weights of the at least two uncoded image frames according to the features of the at least two uncoded image frames and the coding information of the coded image frames.

18. The device according to claim 16 or 17, It is characterized in that The device also includes: A bit rate allocation model updating module is used to update the bit rate allocation model according to at least two of the target bit rate of the video, the real bit rates of the at least two unencoded image frames, and the encoding information of the encoded image frames; the real bit rate of each unencoded image frame indicates the bit length occupied by the encoding result obtained after encoding each unencoded image frame.

19. An image decoding method, It is characterized in that Acquire a bit stream of a video; the video includes a plurality of continuous image frames; Acquire a coding rate of each image frame according to the bit stream, where the coding rate of each image frame indicates a bit length occupied by a coding result obtained by encoding each image frame; Acquire parameters according to the encoding bit rate of each image frame; The bit stream of the video is decoded according to the parameters to obtain a reconstructed image frame.

20. An image decoding device, It is characterized in that include: A bit stream acquisition module is used to: acquire a bit stream of a video; the video includes a plurality of continuous image frames; A code rate acquisition module, used to: acquire the encoding code rate of each image frame according to the bit stream, wherein the encoding code rate of each image frame indicates the bit length occupied by the encoding result obtained by encoding each image frame; A parameter acquisition module, used to: acquire parameters according to the encoding bit rate of each image frame; The decoding module is used to decode the bit stream of the video according to the parameters to obtain a reconstructed image frame.

21. A coding and decoding device, It is characterized in that include: Memory for storing computer programs; At least one processor is used to execute the computer program to implement the method of any one of claims 1 to 9 or the method of claim 19.

22. A coding and decoding system, It is characterized in that include: Encoding equipment and decoding equipment, The encoding device is used to perform the encoding method according to any one of claims 1 to 9, and obtain a bit stream according to video encoding; The decoding device is used to execute the decoding method described in claim 19, and obtain the reconstructed video of the video according to the bit stream decoding.

23. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program or instruction. When the computer program or instruction is executed by a processing device, the method according to any one of claims 1 to 9 or the method according to claim 19 is implemented.

24. A chip, It is characterized in that include: Processor and power supply circuit; The power supply circuit is used to supply power to the processor; The processor is configured to execute the method of any one of claims 1 to 9 or the method of claim 19.

Citation Information

Cited By

  • Image coding method and apparatus, image decoding method and apparatus, and system

    EP4668733A1

  • Image coding method and apparatus, image decoding method and apparatus, and system

    WO2024183387A1