Ai-based video coding method and apparatus, device, and storage medium

By detecting and compressing key points of source reference frames and driving frames in AI video coding technology to generate code stream data, it solves the problems of poor adaptability and training difficulty of the coding model, and achieves ultra-low bit rate video coding and more efficient video compression effect.

WO2024212822A1PCT designated stage expired Publication Date: 2024-10-17BIGO TECH PTE LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/084506
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-12
Filing Date
2024-03-28
Publication Date
2024-10-17

AI Technical Summary

Technical Problem

Existing AI video coding technology has problems such as poor adaptability of the coding model, difficulty in model training, and high transmission bit rate, making it difficult to achieve efficient video coding.

Method used

The key point detection network is used to output the key point information of the source reference frame and driver frame of the video to be encoded, and the key point information compression results of each driver frame are determined based on the key point information of the source reference frame and the preset compression rules, and the code stream data is generated. Transmission to achieve ultra-low bit rate video encoding.

Benefits of technology

It improves the applicable scope and coding efficiency of the AI ​​video coding model, reduces the difficulty and cost of model development and training, and achieves better video compression effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024084506_17102024_PF_FP_ABST
    Figure CN2024084506_17102024_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide an AI-based video coding method and apparatus, a device, a storage medium, and a product. The method comprises: obtaining a video to be coded; using a key point detection network on a source reference frame and driving frame of the video to be coded, and outputting key point information; according to the key point information of the source reference frame and a preset compression rule, determining a key point information compression result for each driving frame; and based on the source reference frame, the key point information of the source reference frame, and the key point information compression result of each driving frame, generating code stream data and performing transmission. The present solution achieves the effect of ultra-low code rate video coding, and, by means of deep compression of video data in combination with an AI model to achieve a data coding process, obtains a better video compression effect; moreover, the present solution likewise increases the range of applications of the AI video coding model, and reduces the difficulty and cost of developing and training the model.
Need to check novelty before this filing date? Find Prior Art

Description

AI-based video encoding method, device, equipment and storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 12, 2023, with application number 202310396495.3, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present application relate to the field of video processing technology, and in particular to an AI-based video encoding method, apparatus, device, storage medium, and product. Background Art

[0003] With the continuous development of the internet industry, video usage scenarios are becoming increasingly diverse, such as intelligent security, autonomous driving, smart cities, and the Industrial Internet. More and more fields are beginning to use video as a means of supporting work, while more and more people are gradually sharing and watching videos as a form of entertainment. Because video data itself is very large, encoding is necessary to ensure successful transmission and presentation of video data on device terminals. Therefore, research on video coding technology, especially AI-based video coding technology, has become extremely important.

[0004] Among related technologies, AI video coding methods mainly include Deep Video Coding (DVC) and machine vision coding. Deep Video Coding (DVC) is an end-to-end video coding model. The entire video compression framework is completed by a neural network and can be trained uniformly. By replacing various modules in the traditional coding framework with deep neural networks, the purpose of video coding and image frame reconstruction is achieved. Machine vision coding is a video coding technology aimed at intelligent applications. It combines video encoding and decoding with machine vision analysis, and implements video encoding and decoding tasks through an end-to-end network system to enable machines to complete visual tasks.

[0005] Since the deep video coding DVC framework is completed by a neural network, and the deep learning method used is mainly based on offline optimization, there are problems such as poor model adaptability, complex model deployment and implementation, and high transmission bit rate. At the same time, in addition to video encoding and decoding, the machine vision coding model is more important to use the decoded video to complete machine vision tasks, which has problems such as strong model targeting and high difficulty in model training. Moreover, in related technologies, AI video coding technology usually requires a large floating-point data representation, which does not show obvious advantages compared with P frame compression in high-efficiency video coding. Therefore, when using existing AI video coding technology to encode videos, there are problems such as poor coding model adaptability, high difficulty in model training, and high transmission bit rate.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide an AI-based video encoding method, apparatus, device, storage medium and product, which solve the problems of poor adaptability of the encoding model, great difficulty in model training and high transmission bit rate when encoding videos using existing AI video encoding technology. By using a key point detection network to output key point information of the source reference frame and driving frame of the encoded video, and determining the key point information compression result of each driving frame based on the key point information of the source reference frame and the preset compression rules, and then generating code stream data based on the key point information of the source reference frame, the source reference frame and the key point information compression result of each driving frame for transmission, the effect of ultra-low bit rate video encoding can be achieved. By deeply compressing the video data and combining the AI ​​model to realize the data encoding process, better video compression effect can be obtained. At the same time, this solution also improves the scope of application of the AI ​​video encoding model and reduces the difficulty and cost of model development and training.

[0008] In a first aspect, an embodiment of the present application provides an AI-based video encoding method, the method comprising:

[0009] Get the video to be encoded;

[0010] Outputting key point information of the source reference frame and the driving frame of the video to be encoded using a key point detection network;

[0011] Determine the compression result of the key point information of each driving frame according to the key point information of the source reference frame and the preset compression rules;

[0012] Code stream data is generated based on the source reference frame, the key point information of the source reference frame and the key point information compression result of each driving frame for transmission.

[0013] In a second aspect, an embodiment of the present application further provides an AI-based video encoding device, comprising:

[0014] Video acquisition module, used to acquire the video to be encoded;

[0015] A key point information output module, configured to output key point information using a key point detection network for a source reference frame and a driving frame of the video to be encoded;

[0016] A key point information compression module is used to determine the key point information compression result of each driving frame based on the key point information of the source reference frame and a preset compression rule;

[0017] The code stream data transmission module is used to generate code stream data for transmission based on the compression result of the source reference frame, the key point information of the source reference frame and the key point information of each driving frame.

[0018] In a third aspect, an embodiment of the present application further provides an AI-based video encoding device, the device comprising:

[0019] one or more processors;

[0020] a storage device for storing one or more programs,

[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the AI-based video encoding method described in the embodiment of the present application.

[0022] In a fourth aspect, an embodiment of the present application further provides a storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to execute the AI-based video encoding method described in an embodiment of the present application.

[0023] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the AI-based video encoding method described in the embodiment of the present application.

[0024] In an embodiment of the present application, a video to be encoded is obtained; a key point detection network is used to output key point information of a source reference frame and a driving frame of the video to be encoded; a key point information compression result of each driving frame is determined based on the key point information of the source reference frame and a preset compression rule; and based on the source reference frame, the key point information of the source reference frame and the key point information compression result of each driving frame, code stream data is generated for transmission. The above-mentioned AI-based video encoding method solves the problems of poor adaptability of the encoding model, difficulty in model training and high transmission bit rate when encoding videos using existing AI video encoding technology. The key point detection network is used to output key point information of the source reference frame and driving frame of the encoded video, and the key point information compression result of each driving frame is determined according to the key point information of the source reference frame and the preset compression rules. Then, based on the key point information of the source reference frame, the source reference frame and the key point information compression result of each driving frame, the code stream data is generated for transmission, which can achieve the effect of ultra-low bit rate video encoding. By deeply compressing the video data and combining the AI ​​model to realize the data encoding process, better video compression effect can be obtained. At the same time, this solution also improves the applicability of the AI ​​video encoding model and reduces the difficulty and cost of model development and training. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] FIG1 is a flowchart of an AI-based video encoding method provided in an embodiment of the present application;

[0026] FIG2 is a schematic diagram of an AI-based video coding system framework provided in an embodiment of the present application;

[0027] FIG3 is a flowchart of an AI-based video encoding method provided in an embodiment of the present application;

[0028] FIG4 is a flowchart of an AI-based video encoding method provided in an embodiment of the present application;

[0029] FIG5 is a flowchart of a key point coordinate compression method provided by an embodiment of the present application;

[0030] FIG6 is a flow chart of a reconstructed image evaluation method provided in an embodiment of the present application;

[0031] FIG7 is a structural block diagram of an AI-based video encoding device provided in an embodiment of the present application;

[0032] FIG8 is a schematic structural diagram of an AI-based video encoding device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The following is a further detailed description of the embodiments of the present application in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the embodiments of the present application, and are not intended to limit the embodiments of the present application. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions of the embodiments of the present application, rather than all structures.

[0034] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0035] For some generation and compression schemes for facial videos, based on the First Order Motion Model (FOM) framework, the first frame (reference frame) is first encoded and transmitted using a traditional encoder, and then the key points of subsequent frames are extracted at the encoding end and transmitted to the decoding end. The decoding end relies on the relative displacement of the key points of the current frame and the reference frame to distort the reference frame face and fill the background to generate the current frame.

[0036] However, this method is only suitable for simple videos with minimal head movement. If the head is significantly offset, the face is obscured, or background objects are added, the quality of the generated frame will drop significantly. Problems such as facial deformation, jitter, and missing background objects can significantly affect the viewing experience. Frequent reference frame updates are necessary to address these issues, but this undoubtedly increases the bitrate burden.

[0037] To explore the compression limits and application scenarios of a generative compression scheme, this paper proposes an ultra-low bitrate generative encoding method that compresses and reuses the original keypoint data, further reducing the amount of keypoint information required to be transmitted at the encoder end. This method achieves a bitrate reduction of at least 1 / 10 compared to HEVC, while ensuring no significant degradation in subjective quality.

[0038] Existing FOM-based generative compression schemes are still in the exploratory stage, with significant room for improvement in bitrate reduction and driving strategies. First, keypoint information typically requires 240 bytes of floating-point data, which is not as advantageous as P-frame compression in HEVC. Therefore, in order to meet the stringent requirements of real-world applications for both transmission bitrate and subjective quality, further research is needed to explore the achievable compression limits of generative compression schemes and their effective application scenarios.

[0039] In response to the problems existing in the FOM generation and compression scheme, the present invention combines the needs of mobile live broadcast services to build an end-to-end generation and coding system framework. Through encoding pre-processing and FOM generation and compression links, it provides new ideas for regenerating lost frames and generating frames to replace traditional coded frames for the transcoding engine side and the audience decoding side respectively.

[0040] Figure 1 is a flowchart of an AI-based video encoding method provided in an embodiment of the present application. The method can be used in scenarios where video images are transmitted, especially when video is transmitted through video coding compression. The method can be executed by a server and smart terminal with encoding and computing capabilities. The method specifically includes the following steps:

[0041] S101, obtaining a video to be encoded;

[0042] In one embodiment, the video to be encoded may be video data to be transmitted, and the video data may be composed of multiple frames of the same or different images. By encoding the video, the purpose of compressing the video can be achieved, so that the video can be successfully transmitted to the user terminal device.

[0043] In this solution, the video to be encoded can be obtained through a video recording device at a video recording end, such as a camera. After obtaining the video to be encoded, data acquisition and image preprocessing can be performed on the images in the video to be encoded. For example, the video to be encoded can be classified, judged, and enhanced, thereby improving the robustness of video coding model training and the efficiency of video information acquisition.

[0044] S102, outputting key point information using a key point detection network for the source reference frame and the driving frame of the video to be encoded;

[0045] The source reference frame may be the first frame of the video to be encoded. The driving frame may be each frame of the video to be encoded that follows the source reference frame. The image content and image data of each frame in the driving frame may be the same or different, and the image content and image data of the driving frame may be the same or different from those of the source reference frame.

[0046] In one embodiment, key points can be points that can represent the characteristics of each frame of the video to be encoded, including points that represent the overall shape or content distribution of the source reference frame and the driving frame image, as well as points that change in the next frame or multiple frames of the driving frame image. For example, in a lecture video mainly featuring a teacher, the teacher's head and facial features can be used as key points of the video to be encoded. Key point information can be information used to encode the video to be encoded, including content information, location information, and data information of the key point, such as pixel data of the key point, location coordinate data, and data information within a certain range near the coordinates.

[0047] The key point detection network may be a network for obtaining the key point information, including a key point detector Kp-detector, etc. The key point information of the source reference frame and the driving frame can be obtained by applying the sparse motion field network in the key point detection network to the source reference frame and the driving frame in the video to be encoded.

[0048] S103, determining a compression result of the key point information of each driving frame according to the key point information of the source reference frame and a preset compression rule;

[0049] The preset compression rule may be a rule for compressing each drive frame in the to-be-encoded video to reduce the size of the to-be-encoded video according to video compression requirements, including an intra-frame compression rule and an inter-frame compression rule. The key point information compression result of each drive frame may be a result of compressing the key point data of each drive frame into encoded data, including intra-frame compression results of different key point information data in the same drive frame and inter-frame compression results of the same key point data in different drive frames.

[0050] In one embodiment, an end-to-end coding system model based on the FOM (First Order Motion Model) can be generated, and a key point data compression method can be used to perform intra-frame compression on the key point information of each drive frame according to preset compression rules. In addition, the key point information of each drive frame can be inter-frame compressed based on the relationship between the source reference frame and the key point information of each drive frame and the preset compression rules. The key point data compression can include compression of pixel data, compression of position coordinate data, and conversion of data types, etc., which are not further limited here. By performing intra-frame and inter-frame compression on each drive frame, the key point information compression result of each drive frame can be determined.

[0051] This solution further compresses the key point information using preset compression rules, which can greatly improve the compression efficiency based on the key point information obtained by the original compression, achieve the purpose of deep compression of the data, and thus realize the encoding effect of ultra-low bit rate.

[0052] S104 , generating code stream data for transmission based on the source reference frame, the key point information of the source reference frame, and the key point information compression results of each driving frame.

[0053] The code stream data may be data obtained by encoding and compressing the source reference frame and each driving frame in the video to be encoded. The video to be encoded may be transmitted to the user terminal device in the form of code stream data. The code stream data is generated based on the image encoding result of the source reference frame, the key point information encoding result of the source reference frame, and the key point information compression result of each driving frame.

[0054] In one embodiment, taking a video primarily depicting a human face as an example, when a user terminal device receives the bitstream, for a video with no facial occlusion, minimal head movement, and a simple background, since the content information, position information, and data information of the key points of the source reference frame and each drive frame in the video vary little, i.e., the key point information of the source reference frame and each drive frame has a high correlation, the source reference frame can be directly used as a unidirectional reference to generate each drive frame to restore the video to be encoded. For example, based on the key point information of the source reference frame and a preset compression rule, dense motion field calculation is performed to generate each drive frame image that is adjacent or non-adjacent to the source reference frame.

[0055] In another embodiment, when the user terminal device receives the code stream, for videos with occasional facial occlusion, moderate motion, and simple background, since the content information, position information, and data information of the key points of the source reference frame and each drive frame in the video vary greatly, that is, the correlation between the key point information of the source reference frame and each drive frame is low, after the video is compressed, it is impossible to accurately restore the drive frame image based on the unidirectional reference of the source reference frame. Therefore, a backward reference can be added on the basis of FOM, and a bidirectional reference driving strategy can be adopted to generate the final image of each drive frame. For example: the key point information of the current drive frame d and the drive frames at the positions of n frames before and after the current drive frame d are obtained through a sparse motion field, and the drive frames at the positions of n frames before and after the current drive frame are used as forward reference frames d. -n and the backward reference frame d +n , the forward reference frame d -n and the backward reference frame d +n After the dense motion field is applied, the reference images of the respective reference directions are generated. Finally, the reference images of the forward reference frame and the backward reference frame are fused to obtain the bidirectional fused reference image M, and the formula is used: output = d -n ×M+d +n ×(1-M);

[0056] Guides the final generation of the current driven frame image. Compared to using only a unidirectional reference, bidirectional reference significantly improves subjective quality and reduces facial jitter. By adjusting the update frequency of the reference source to achieve better subjective quality, a preprocessing module is added to detect scene changes. The scene change detection method includes a scene detection network and calculation of the mutual information between adjacent frames. By detecting scene changes, it is determined whether the estimated update probability of the current frame is greater than the mean update probability predicted by the previously encoded frames, and whether the mutual information between the current frame and the adjacent frames is greater than the mean mutual information calculated for the encoded frames, indicating more accurate source reference update positioning. Ultimately, a certain degree of subjective quality improvement is achieved, improving poor generation results. For videos without facial occlusion, minimal head movement, and simple backgrounds, the bidirectional reference driving strategy can also be adopted based on the user's requirements for video restoration quality, without further limitation here.

[0057] In one embodiment, optionally, after generating code stream data for transmission based on the compression result of the source reference frame, the key point information of the source reference frame, and the key point information of each driving frame, the method further includes:

[0058] Identifying, by a transcoding engine, whether there is a terminal that cannot recognize the code stream data;

[0059] If so, converting the code stream data based on the target terminal parameter and transmitting the converted code stream data to the target terminal;

[0060] If not, the code stream data is directly transmitted to the corresponding terminal.

[0061] The transcoding engine can be used to receive the bitstream data generated by the above solution and, if necessary, perform transcoding processing and resolution requirements. The transcoding engine can be provided with multiple output ports for forwarding the bitstream data to different user terminals. The transcoding engine can identify whether there are user terminals that do not meet the bitstream data transmission conditions, that is, user terminals that cannot recognize or transmit the bitstream data.

[0062] In one embodiment, the target terminal may be a user terminal device that is unable to transmit the code stream. The target terminal parameter may be a code stream transmission parameter of the target terminal. If the transcoding engine recognizes the existence of the target terminal, the code stream data is decoded and re-encoded according to the target terminal parameters, and then the converted code stream data is forwarded to the corresponding target terminal. Since the transcoding engine can be connected to multiple different user terminal devices at the same time, the encoding method and encoding standard re-encoded by the transcoding engine can be the same or different for different target terminals. If the transcoding engine does not recognize the existence of the target terminal, the code stream data is directly transmitted to the corresponding user terminal device for the user terminal device to regenerate the video.

[0063] In another embodiment, the transcoding engine and the user terminal device can decode the source reference frame code stream to regenerate the source reference frame image, and then regenerate each driving frame image in the driving frame sequence based on the regenerated source reference frame and code stream data to restore the video. Furthermore, the transcoding engine and the user terminal device can determine whether there is frame loss based on the sequence number of each driving frame in the code stream. If so, the lost frame can be regenerated by encoding the adjacent driving frames.

[0064] This solution uses a transcoding engine to identify whether there are terminals that cannot recognize the code stream data, converts the code stream data based on the target terminal parameters, and then transmits the converted code stream data to the target terminal. This can avoid the problem of being unable to receive code stream data due to different configurations of user terminal devices, and improve the accuracy and efficiency of user terminal devices in receiving and restoring transmitted videos.

[0065] The technical solution provided in the embodiment of the present application obtains a video to be encoded; uses a key point detection network to output key point information for the source reference frame and drive frame of the video to be encoded; determines the key point information compression result of each drive frame based on the key point information of the source reference frame and preset compression rules; and generates code stream data for transmission based on the source reference frame, the key point information of the source reference frame, and the key point information compression result of each drive frame. The above-mentioned AI-based video encoding method solves the problems of poor adaptability of the encoding model, difficulty in model training and high transmission bit rate when encoding videos using existing AI video encoding technology. The key point detection network is used to output key point information of the source reference frame and driving frame of the encoded video, and the key point information compression result of each driving frame is determined according to the key point information of the source reference frame and the preset compression rules. Then, based on the key point information of the source reference frame, the source reference frame and the key point information compression result of each driving frame, the code stream data is generated for transmission, which can achieve the effect of ultra-low bit rate video encoding. By deeply compressing the video data and combining the AI ​​model to realize the data encoding process, better video compression effect can be obtained. At the same time, this solution also improves the applicability of the AI ​​video encoding model and reduces the difficulty and cost of model development and training.

[0066] Figure 2 is a schematic diagram of the AI-based video encoding system framework provided in an embodiment of the present application. As shown in Figure 2, it specifically includes: an acquisition / pre-processing module, an AI Enc module, a transcoding engine module and an AIDec module.

[0067] The acquisition / pre-processing module is used to perform pre-processing operations such as classification, enhancement, and highlighting on the video to be encoded, and transmit the processed video to be encoded to the AI ​​Enc module.

[0068] The AI ​​Enc module is used to perform encoding and compression operations on the video to be encoded, including a traditional encoding link and two AI encoding links. Among them, the traditional encoding link is directed by the Codec Engine module to the mixing module. The Codec Engine module is used to encode the source reference frame image in the video to be encoded, so that the source reference frame image can enter the mixing module and be transmitted to the user end. The mixing module is used to mix the image encoding results of the source reference frame with the image encoding results of each driving frame and generate a code stream for transmitting the encoded video.

[0069] One of the AI ​​encoding links is connected to the Codec Engine module, which is used to encode and compress the source reference frame image, including the DPB (Decoded Picture Buffer) module, the key point detection Net, and the generation information compression module. The DPB module is used to perform decoding and caching operations on the source reference frame image encoded by the Codec Engine module, and transmit the decoded source reference frame image to the key point detection Net for the key point detection Net to perform key point information detection of the source reference frame image. It can be understood that the source reference frame image can also be directly input into the key point detection Net here. The generation information compression module is used to encode and compress the key point information detected by the key point detection Net, and transmit the compressed key point information to the mixing module in the traditional encoding link.

[0070] Another AI encoding link includes a key point detection Net and AIDec, wherein AIDec includes a sparse motion field Net and a dense motion field Net. The key point detection Net is used to perform key point information detection operations on each drive frame image, and transmit the detected key point information to the generated information compression module. AIDec is used to regenerate each frame image based on the detected key point information, and transmit the generated frame image to the identification Net, forming a generative adversarial network with the identification Net to identify the reliability and accuracy of the generated frame. Among them, the sparse motion field Net in AIDec is used to obtain the specific data of the key points in the key point information of each frame image, and the dense motion field Net is used to regenerate each frame image based on the data.

[0071] The transcoding engine module is responsible for transcoding bitstream data and regenerating lost frame data. It includes Codec Dec and AIDec. Codec Dec generates source reference frames based on bitstream data and source reference frame encoding data. AIDec regenerates lost frames based on bitstream data and generated adjacent reference frames or drive frames.

[0072] The AIDec module receives codestream data directly transmitted by the AI ​​Enc module or forwarded by the transcoding engine module, including Codec Dec and AIDec. Codec Dec generates source reference frames based on the codestream data and the source reference frame encoding data. AIDec regenerates lost frames based on the codestream data and generated adjacent reference frames or drive frames.

[0073] FIG3 is a flowchart of an AI-based video encoding method provided in an embodiment of the present application. As shown in FIG3 , the method specifically includes the following steps:

[0074] S201, obtaining a video to be encoded;

[0075] S202, using a key point detection network to output key point coordinates and Jacobian matrices corresponding to the coordinates for the source reference frame and the driving frame of the video to be encoded;

[0076] The key point coordinates may be the coordinates of each key point in the source reference frame and each driving frame in the same coordinate system, which represent the position of each key point. The change of each frame image can be determined by the change of the key point coordinates.

[0077] The Jacobian matrix may be the Jacobian matrix corresponding to the key point coordinates. This matrix is ​​a matrix formed by arranging the first-order partial derivatives of the key point coordinates in a specific manner. Its determinant is called the Jacobian determinant and represents the optimal linear approximation of a differentiable equation to a given point. The Jacobian matrix corresponding to the key point coordinates is calculated by using a sparse motion field in a key point detection network on the source reference frame and the driving frame of the video to be encoded to obtain and output the key point coordinates.

[0078] S203, reading the source Jacobian matrix corresponding to the coordinates of each source key point of the source reference frame, and reading the driving Jacobian matrix corresponding to the coordinates of each driving key point of each driving frame;

[0079] The source Jacobian matrix may be the Jacobian matrix corresponding to the coordinates of each source key point in the source reference frame, and the driving Jacobian matrix may be the Jacobian matrix corresponding to the coordinates of each driving key point in each driving frame. The coordinates of the driving key points may be the same or different, and thus the driving Jacobian matrices may also be the same or different accordingly. The key point detection network outputs the key point coordinates and the Jacobian matrix corresponding to the coordinates to read the source Jacobian matrix corresponding to the coordinates of each source key point in the source reference frame and the driving Jacobian matrix corresponding to the coordinates of each driving key point in each driving frame.

[0080] S204, compressing the driving Jacobian matrix of each driving frame according to the source Jacobian matrix and a first preset compression rule to obtain a driving Jacobian matrix compression result;

[0081] The first preset compression rule may be a rule for compressing the driving Jacobian matrix of each driving frame, a rule for performing residual calculations on the driving Jacobian matrices of adjacent driving frames, or a rule for performing residual calculations on each driving Jacobian matrix with a source Jacobian matrix, etc., without further limitation herein. Based on the source Jacobian matrix and the first preset compression rule, the driving Jacobian matrix of each driving frame may be compressed to obtain a compressed driving Jacobian matrix result.

[0082] In one embodiment, optionally, before compressing the driving Jacobian matrix of each driving frame according to the source Jacobian matrix and the first preset compression rule to obtain the driving Jacobian matrix compression result, the method further includes:

[0083] The source Jacobian matrix and the driving Jacobian matrix are converted from Float32 type data to Float16 type data.

[0084] In one embodiment, to maximize the compression of the driving Jacobian matrix, the precision of the source Jacobian matrix and the driving Jacobian matrix can be reduced before the driving Jacobian matrix of each driving frame is compressed according to the source Jacobian matrix and a first preset compression rule to obtain the compressed driving Jacobian matrix. Specifically, the matrix precision can be reduced by converting the format of the source Jacobian matrix and the driving Jacobian matrix from Float32 type data to Float16 type data. In this case, the amount of data required to calculate each driving frame is 100 bytes, and the compression comparison of the source video is approximately 1 / 5.09.

[0085] In one embodiment, by performing format conversion on the source Jacobian matrix and the driving Jacobian matrix, the accuracy of the Jacobian matrix can be reduced, thereby achieving the purpose of preliminary compression of the video.

[0086] S205 , generating code stream data for transmission based on the source reference frame, the key point information of the source reference frame, and the compression result of the key point information of each driving frame.

[0087] The technical solution provided by the embodiment of the present application uses a key point detection network to output key point coordinates and the Jacobian matrix corresponding to the coordinates for the source reference frame and the driving frame of the video to be encoded, reads the source Jacobian matrix corresponding to the coordinates of each source key point of the source reference frame, and reads the driving Jacobian matrix corresponding to the coordinates of each driving key point of each driving frame, and then compresses the driving Jacobian matrix of each driving frame according to the source Jacobian matrix and a first preset compression rule to obtain a compression result of the driving Jacobian matrix. This can improve the simplicity and efficiency of compressing the Jacobian matrix of the driving frame and reduce the difficulty and cost of developing and training a video coding model.

[0088] FIG4 is a flowchart of an AI-based video encoding method provided in an embodiment of the present application. As shown in FIG4 , the method specifically includes the following steps:

[0089] S301, obtaining a video to be encoded;

[0090] S302, using a key point detection network to output key point coordinates and source Jacobian matrices corresponding to the coordinates for the source reference frame and the driving frame of the video to be encoded;

[0091] S303, reading the source Jacobian matrix corresponding to the coordinates of each source key point of the source reference frame, and reading the driving Jacobian matrix corresponding to the coordinates of each driving key point of each driving frame;

[0092] S304, based on the frame sequence of the source reference frame and each driving frame, performing a subtraction between each driving Jacobian matrix of each driving frame and the Jacobian matrix of the source reference frame frame by frame according to the frame sequence, to obtain a Jacobian residual matrix of each driving frame as a driving Jacobian matrix compression result;

[0093] In one embodiment, the frame sequence can be the arrangement sequence of the source reference frame and each driving frame determined according to the playback order of the video image frame. The frame sequence can be stored in each frame code in the form of numbers, symbols, and character strings. Since the overall fluctuation range of the Jacobian matrix corresponding to the same key point position of the source reference frame and each driving frame in the video does not exceed [-1, 1], therefore, in order to further compress the Jacobian matrix of each driving frame, the driving Jacobian matrix of each driving frame can be subtracted from the Jacobian matrix of the source reference frame frame by frame according to the frame sequence of the source reference frame and each driving frame to obtain the Jacobian residual matrix of each driving frame, and the Jacobian residual matrix is ​​used as the driving Jacobian matrix compression result. The Jacobian matrix of Float16 type can be compressed into the Jacobian residual matrix of Uint8 type. At this time, the size of each driving frame is 60 bytes, and the compression comparison source video is approximately 1 / 8.28.

[0094] S305 , generating code stream data for transmission based on the source reference frame, the key point information of the source reference frame, and the compression result of the key point information of each driving frame.

[0095] The technical solution provided in the embodiment of the present application is to obtain the Jacobian residual matrix of each driving frame as the compression result of the driving Jacobian matrix by subtracting the driving Jacobian matrix of each driving frame from the Jacobian matrix of the source reference frame frame by frame according to the frame sequence based on the source reference frame and the frame sequence of each driving frame, thereby achieving the effect of further compressing the Jacobian matrix of each driving frame, thereby improving the degree of video compression and the effect of video encoding.

[0096] FIG5 is a flowchart of a key point coordinate compression method provided by an embodiment of the present application, as shown in FIG5 , which specifically includes the following steps:

[0097] S401, reading the coordinates of each source key point of the source reference frame, and reading the coordinates of each driving key point of each driving frame;

[0098] In one embodiment, the source keypoint coordinates may be the coordinates of each keypoint in the source reference frame, and the driving keypoint coordinates may be the coordinates of each keypoint in each driving frame. The coordinates of each keypoint may be obtained through a sparse motion field in a keypoint detection network.

[0099] S402, using the second preset compression rule, converting the format of the source key point coordinates and the driving key point coordinates, converting the Float32 type data into the Uint8 type data, and obtaining the compression result of the source key point coordinates and the compression result of each driving key point coordinate.

[0100] In one embodiment, the second preset compression rule may be a rule for compressing the source key point coordinates and the driving key point coordinates, or may be coding redundancy of the key point coordinates within a frame or between frames, etc., which is not limited here. Since the key point coordinates are normalized to [-1, 1], the key point coordinates can be mapped from [-1, 1] to [0, 255] to achieve the purpose of compressing the key point coordinates. Specifically, the second preset compression rule can be used to convert the format of the source key point coordinates and the driving key point coordinates, so that the data type of the key point coordinates is converted from Float32 type to Uint8 type, thereby obtaining the compression result of the source key point coordinates and the compression result of the driving key point coordinates. Furthermore, the key point data can be compressed to the maximum extent by multiplexing the key point data. Specifically, the key points can be sampled at a fixed interval of 4 frames. At this time, the compressed video is about 1 / 27.67 of the source video, achieving a greater degree of compression and improving the effect of video encoding.

[0101] The technical solution provided in the embodiment of the present application reads the coordinates of each source key point of the source reference frame and the coordinates of each driving key point of each driving frame, adopts the second preset compression rule to convert the format of the source key point coordinates and the driving key point coordinates, converts the Float32 type data into Uint8 type data, obtains the compression results of the source key point coordinates, and obtains the compression results of the driving key point coordinates, which can increase the degree of video compression, reduce the compression bit rate, improve the effect of video encoding, and reduce the difficulty of video encoding model development and training.

[0102] FIG6 is a flow chart of a reconstructed image evaluation method provided in an embodiment of the present application. As shown in FIG6 , the method specifically includes the following steps:

[0103] S501, inputting the source reference frame and each of the driving frames into a generator, generating key point information of the source reference frame and key point information of the driving frames through the sparse motion field network of the generator, outputting intermediate products through the dense motion field network of the generator, and generating a reconstructed image of the current frame through an image generation unit;

[0104] In one embodiment, the generator can be a model for mapping a noise signal (usually a random number) into a sample similar to real data. Specifically, it can be a model that outputs an image, such as a fully connected neural network and a deconvolutional network. The generator is used to generate a reconstructed image of the current frame, and includes a sparse motion field network and a dense motion field network. The sparse motion field network acts on the source reference frame image and each driving frame image to obtain key point information of each frame; the dense motion field acts on the key point information received by the generator and the source reference frame to obtain an intermediate product. The intermediate product can be the change content or data between the key point information of the source reference frame and the corresponding key point information of the driving frame, which is used to guide the generator to generate the reconstructed image of the current frame. The image generation unit can be a unit for generating the reconstructed image of the current frame, having functions such as data reception, data processing, and image processing. The reconstructed image of the current frame can be an image generated by the image generation unit based on the source reference frame image or the driving frame image generated in the previous frame and the key point information of the current frame. The source reference frame and each of the driving frames are input into the generator to generate key point information of the source reference frame and key point information of the driving frame through the sparse motion field network of the generator, and output the intermediate product through the dense motion field network of the generator, and generate a reconstructed image of the current frame through the image generation unit.

[0105] In one embodiment, optionally, the intermediate product includes: a motion optical flow field and an occlusion map;

[0106] Accordingly, the reconstructed image of the current frame is generated by the image generation unit, including:

[0107] The motion optical flow field, the occlusion map and the source image are input to an image generation unit to output a reconstructed image of the current frame.

[0108] In one embodiment, the motion optical flow field may be the motion of an object between consecutive sequence frames, which is caused by the relative motion between the object and the camera. The motion optical flow field includes key point information of the observed object in the video and key point motion trends, etc., and is used to calculate the pixel motion information of each key point between adjacent frames based on the source reference frame and the pixel changes in the time domain in each driving frame image sequence and the correlation between adjacent frames. The occlusion map is used to indicate which parts can be obtained by pixel displacement of the source image and which parts need to be obtained by padding (filling) through the context when the image generation unit generates the reconstructed image of the current frame. The motion optical flow field, the occlusion map and the source reference frame image are input to the image generation unit of the generator to output the reconstructed image of the current frame.

[0109] In one embodiment, by inputting the motion optical flow field, the occlusion map, and the source image into an image generation unit to output a reconstructed image of the current frame, the efficiency and accuracy of regenerating the driving frame image can be improved.

[0110] S502, inputting the reconstructed image into a discriminator to obtain an evaluation result of the reconstructed image; wherein the generator and the discriminator constitute an adversarial neural network.

[0111] In one embodiment, the discriminator can be used to evaluate the generation quality of the current frame reconstructed image generated by the generator, and can be judged by the similarity between the current frame reconstructed image and the actual current frame image. The input of the discriminator is the current frame reconstructed image, and the output is the authenticity label of the image, that is, the similarity. Therefore, the reconstructed image is input to the discriminator, and the evaluation result of the discriminator on the reconstructed image can be obtained. The adversarial neural network is a generative model composed of two parts: a generator and a discriminator. They play against each other and generate high-quality data through this confrontation. In the adversarial neural network training process, through continuous training and updating of the discriminator and the generator, the discriminator network will gradually become more accurate, and the data finally generated by the generator will also be closer to the real data.

[0112] The technical solution provided in the embodiment of the present application generates key point information of the source reference frame and key point information of the driving frame through the sparse motion field network of the generator, outputs the intermediate product through the dense motion field network of the generator, and generates a reconstructed image of the current frame through the image generation unit, and inputs the reconstructed image into the discriminator to obtain an evaluation result of the reconstructed image, which can improve the accuracy of the regeneration of the current frame image, and thereby improve the reliability of the restoration of the encoded video.

[0113] Figure 7 is a structural block diagram of an AI-based video encoding device provided in an embodiment of the present application. The device is used to execute the AI-based video encoding method provided in the above embodiment, and has functional modules and beneficial effects corresponding to the execution method. As shown in Figure 7, the device specifically includes: a video acquisition module 601, a key point information output module 602, a key point information compression module 603, and a code stream data transmission module 604, wherein,

[0114] The video acquisition module 601 is used to acquire the video to be encoded;

[0115] A key point information output module 602 is configured to output key point information using a key point detection network for the source reference frame and the driving frame of the video to be encoded;

[0116] A key point information compression module 603 is used to determine a key point information compression result of each driving frame according to the key point information of the source reference frame and a preset compression rule;

[0117] The code stream data transmission module 604 is configured to generate code stream data for transmission based on the compression result of the source reference frame, the key point information of the source reference frame, and the key point information of each driving frame.

[0118] In a possible embodiment, the key point information includes: key point coordinates and source Jacobian matrices corresponding to the coordinates;

[0119] Accordingly, the key point information compression module 603 includes:

[0120] A Jacobian matrix reading unit, configured to read a source Jacobian matrix corresponding to the coordinates of each source key point of a source reference frame, and to read a driving Jacobian matrix corresponding to the coordinates of each driving key point of each driving frame;

[0121] The Jacobian matrix compression unit is used to compress the driving Jacobian matrix of each driving frame according to the source Jacobian matrix and a first preset compression rule to obtain a driving Jacobian matrix compression result.

[0122] In a possible embodiment, the Jacobian matrix compression unit is specifically used to:

[0123] Based on the frame sequence of the source reference frame and each driving frame, the driving Jacobian matrix of each driving frame is subtracted from the Jacobian matrix of the source reference frame frame by frame according to the frame sequence to obtain the Jacobian residual matrix of each driving frame as the driving Jacobian matrix compression result.

[0124] In a possible embodiment, the Jacobian matrix compression unit is further configured to:

[0125] The source Jacobian matrix and the driving Jacobian matrix are converted from Float32 type data to Float16 type data.

[0126] In a possible embodiment, the key point information compression module 603 further includes:

[0127] A key point coordinate reading unit, configured to read the coordinates of each source key point of a source reference frame and the coordinates of each driving key point of each driving frame;

[0128] The key point coordinate compression unit is used to adopt a second preset compression rule to convert the format of the source key point coordinates and the driving key point coordinates, converting the Float32 type data into Uint8 type data, and obtain the compression result of the source key point coordinates and the compression result of each driving key point coordinate.

[0129] In a possible embodiment, the video acquisition module 601 includes:

[0130] a reconstructed image generation unit, configured to input the source reference frame and each of the driving frames into a generator, generate key point information of the source reference frame and key point information of the driving frame through the sparse motion field network of the generator, output an intermediate product through the dense motion field network of the generator, and generate a reconstructed image of the current frame through the image generation unit;

[0131] The reconstructed image evaluation unit is used to input the reconstructed image into the discriminator to obtain an evaluation result of the reconstructed image; wherein the generator and the discriminator constitute an adversarial neural network.

[0132] In a possible embodiment, the intermediate product includes: a motion optical flow field and an occlusion map;

[0133] Accordingly, the reconstructed image generation unit is specifically configured to:

[0134] The motion optical flow field, the occlusion map and the source image are input to an image generation unit to output a reconstructed image of the current frame.

[0135] In a possible embodiment, the code stream data transmission module 604 is further configured to:

[0136] Identifying, by a transcoding engine, whether there is a terminal that cannot recognize the code stream data;

[0137] If so, converting the code stream data based on the target terminal parameter and transmitting the converted code stream data to the target terminal;

[0138] If not, the code stream data is directly transmitted to the corresponding terminal.

[0139] The technical solution provided in the embodiment of the present application includes a video acquisition module for acquiring a video to be encoded; a key point information output module for outputting key point information of a source reference frame and a driving frame of the video to be encoded using a key point detection network; a key point information compression module for determining a key point information compression result of each driving frame based on the key point information of the source reference frame and a preset compression rule; and a code stream data transmission module for generating code stream data for transmission based on the source reference frame, the key point information of the source reference frame, and the key point information compression result of each driving frame. The above-mentioned AI-based video encoding device solves the problems of poor adaptability of the encoding model, difficulty in model training and high transmission bit rate when encoding videos using existing AI video encoding technology. The key point detection network is used to output key point information of the source reference frame and driving frame of the encoded video, and the key point information compression result of each driving frame is determined according to the key point information of the source reference frame and the preset compression rules. Then, based on the key point information of the source reference frame, the source reference frame and the key point information compression result of each driving frame, the code stream data is generated for transmission, thereby achieving the effect of ultra-low bit rate video encoding. By deeply compressing the video data and combining it with the AI ​​model to realize the data encoding process, better video compression effect can be obtained. At the same time, this solution also improves the scope of application of the AI ​​video encoding model and reduces the difficulty and cost of model development and training.

[0140] FIG8 is a schematic diagram of the structure of an AI-based video encoding device provided in an embodiment of the present application. As shown in FIG8 , the device includes a processor 701, a memory 702, an input device 703, and an output device 704. The device may include one or more processors 701, with FIG7 assuming one processor 701 as an example. The processor 701, memory 702, input device 703, and output device 704 in the device may be connected via a bus or other means, with FIG7 assuming a bus connection as an example. Memory 702, as a computer-readable storage medium, can be used to store software programs, computer executable programs, and modules, such as the program instructions / modules corresponding to the AI-based video encoding method in the embodiment of the present application. Processor 701 executes the software programs, instructions, and modules stored in memory 702 to execute various functional applications and data processing of the device, thereby implementing the aforementioned AI-based video encoding method. Input device 703 can be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. Output device 704 may include a display device such as a display screen.

[0141] An embodiment of the present application further provides a storage medium containing computer-executable instructions. When the computer-executable instructions are executed by a computer processor, the computer-executable instructions are used to perform an AI-based video encoding method described in the above embodiment, which includes:

[0142] Get the video to be encoded;

[0143] Outputting key point information of the source reference frame and the driving frame of the video to be encoded using a key point detection network;

[0144] Determine the compression result of the key point information of each driving frame according to the key point information of the source reference frame and the preset compression rules;

[0145] Code stream data is generated based on the source reference frame, the key point information of the source reference frame and the key point information compression result of each driving frame for transmission.

[0146] It is worth noting that in the embodiment of the above-mentioned AI-based video encoding device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the embodiments of this application.

[0147] In some possible implementations, various aspects of the method provided herein may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to cause the computer device to perform the steps of the method according to the various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the AI-based video encoding method described in the embodiments of the present application. The program product may be implemented using any combination of one or more readable media.

Claims

1. A video encoding method based on AI, wherein: include: Get the video to be encoded; Outputting key point information of the source reference frame and the driving frame of the video to be encoded using a key point detection network; Determine the compression result of the key point information of each driving frame according to the key point information of the source reference frame and the preset compression rule; Based on the source reference frame, the key point information of the source reference frame and the key point information compression result of each driving frame, code stream data is generated for transmission.

2. The AI-based video encoding method according to claim 1, wherein: The key point information includes: key point coordinates and Jacobian matrix corresponding to the coordinates; Accordingly, according to the key point information of the source reference frame and the preset compression rule, the key point information compression result of each driving frame is determined, including: Read the source Jacobian matrix corresponding to the coordinates of each source key point of the source reference frame, and read the driving Jacobian matrix corresponding to the coordinates of each driving key point of each driving frame; According to the source Jacobian matrix and the first preset compression rule, the driving Jacobian matrix of each driving frame is compressed to obtain a driving Jacobian matrix compression result.

3. The AI-based video encoding method according to claim 2, wherein: According to the source Jacobian matrix and the first preset compression rule, the driving Jacobian matrix of each driving frame is compressed to obtain a driving Jacobian matrix compression result, including: Based on the frame sequence of the source reference frame and each driving frame, each driving Jacobian matrix of each driving frame is subtracted from the Jacobian matrix of the source reference frame frame by frame according to the frame sequence to obtain the Jacobian residual matrix of each driving frame as the driving Jacobian matrix compression result.

4. The AI-based video encoding method according to claim 2, wherein: Before compressing the driving Jacobian matrix of each driving frame according to the source Jacobian matrix and the first preset compression rule to obtain the driving Jacobian matrix compression result, the method further includes: The source Jacobian matrix and the driving Jacobian matrix are converted into a format from Float32 type data to Float16 type data.

5. The AI-based video encoding method according to claim 2, wherein: Determine the compression result of the key point information of each driving frame according to the key point information of the source reference frame and the preset compression rule, and also include: Read the coordinates of each source key point of the source reference frame, and read the coordinates of each driving key point of each driving frame; The second preset compression rule is used to convert the format of the source key point coordinates and the driving key point coordinates, converting the Float32 type data into the Uint8 type data, to obtain the compression result of the source key point coordinates and the compression result of each driving key point coordinate.

6. The AI-based video encoding method according to claims 1-5, wherein: After obtaining the video to be encoded, the method further includes: Input the source reference frame and each of the driving frames into a generator, so as to generate key point information of the source reference frame and key point information of the driving frame through a sparse motion field network of the generator, output an intermediate product through a dense motion field network of the generator, and generate a reconstructed image of the current frame through an image generation unit; The reconstructed image is input into a discriminator to obtain an evaluation result of the reconstructed image; wherein the generator and the discriminator constitute an adversarial neural network.

7. The AI-based video encoding method according to claim 6, wherein: The intermediate products include: motion optical flow field and occlusion map; Accordingly, a reconstructed image of the current frame is generated by an image generation unit, including: The motion optical flow field, the occlusion map and the source image are input into an image generation unit to output a reconstructed image of the current frame.

8. The AI-based video encoding method according to claims 1-7, wherein: After the code stream data is generated based on the source reference frame, the key point information of the source reference frame and the key point information compression result of each driving frame for transmission, the method further includes: Identify, by a transcoding engine, whether there is a terminal that cannot recognize the bitstream data; If so, converting the code stream data based on the target terminal parameter, and transmitting the converted code stream data to the target terminal; If it does not exist, the code stream data is directly transmitted to the corresponding terminal.

9. An AI-based video encoding device, wherein: include: A video acquisition module, configured to acquire a video to be encoded; A key point information output module is configured to output key point information using a key point detection network for a source reference frame and a driving frame of the video to be encoded; A key point information compression module is configured to determine a key point information compression result of each driving frame according to the key point information of the source reference frame and a preset compression rule; The code stream data transmission module is configured to generate code stream data for transmission based on the source reference frame, the key point information of the source reference frame and the key point information compression result of each driving frame.

10. An AI-based video encoding device, the device comprising: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, so that the one or more processors implement the AI-based video encoding method described in any one of claims 1-8.

11. A storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the AI-based video encoding method according to any one of claims 1 to 8 when executed by a computer processor.

12. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the AI-based video encoding method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Man-machine collaborative video coding method and video coding system

    CN113132732A

  • Video encoding and decoding method and device, equipment and storage medium

    CN114257818A

  • Image processing method and device, medium and electronic equipment

    CN114363623A

  • Video compression method and electronic equipment

    CN115941966A

  • Video coding method and device based on AI, equipment and storage medium

    CN116582686A