A video frame processing method, device and medium

By obtaining the encoding and decoding motion vectors of the current frame and multiple reference frames, determining the temporal context and performing network processing, it solves the problem in the existing technology that new video inter-frame motion content cannot be encoded, and improves video encoding performance and frame quality.

CN118175320BActive Publication Date: 2024-08-27SHENZHEN YUTO PACKAGING TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410581207.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2024-08-27
Estimated Expiration
2044-05-11

AI Technical Summary

Technical Problem

In existing video coding methods, the previous historical frame is only utilized through simple subtraction operations, resulting in new content generated by motion between video frames that cannot be effectively encoded, resulting in low video coding performance.

Method used

By obtaining the encoded and decoded motion vectors of the current frame and multiple reference frames, the temporal context is determined, and the residual network is used to process the feature tensor to perform efficient video frame coding.

Benefits of technology

Improved video encoding performance, able to encode video frames more efficiently, generate higher quality frames, and improve the encoding effect under a given bandwidth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118175320B
    Figure CN118175320B
Patent Text Reader

Abstract

The embodiments of the present application provide a method, device and medium for processing video frames. The method includes: obtaining a current frame to be processed; determining N reference frames corresponding to the current frame; N is a positive integer greater than 1; obtaining the first motion vector after encoding and decoding corresponding to the current frame, and obtaining the second motion vector after encoding and decoding corresponding to each reference frame; the video frame before the current frame is the historical frame of the current frame, and the encoded and decoded frame of the historical frame is the reference frame; according to the first motion vector after encoding and decoding, the second motion vector after encoding and decoding corresponding to each reference frame, and N reference frames, determine the time context; according to the time context, encode the current frame to obtain the target data stream, and send the target data stream. The method of the embodiment of the present application can improve the performance of video encoding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video encoding technology, and in particular to a method, device and medium for processing video frames. Background Art

[0002] Video encoding is the process of converting the original video format file into another video format file through compression technology for transmission. Therefore, it is crucial to generate higher quality frames within a given bandwidth budget.

[0003] The end-to-end video encoding method in the related art usually uses the coded frame of the previous historical frame of the current frame to generate a predicted frame of the current frame in the pixel space, and uses the predicted frame as a condition for encoding the current frame, subtracts the current frame from the predicted frame, and encodes the residual after the subtraction and sends it to the receiving device. However, the method in the related art only uses the condition through a simple subtraction operation, resulting in that the new content generated by the motion between the video frames cannot be encoded, resulting in the method in the related art having a low video encoding performance problem.

[0004] Therefore, there is an urgent need for a video frame processing method that can improve the performance of video encoding. Summary of the invention

[0005] The embodiments of the present application provide a method, device and medium for processing a video frame, which can improve the performance of video encoding.

[0006] In a first aspect, an embodiment of the present application provides a method for processing a video frame, the method comprising:

[0007] Get the current frame to be processed;

[0008] Determine N reference frames corresponding to the current frame; N is a positive integer greater than 1;

[0009] Obtaining a first motion vector after encoding and decoding corresponding to the current frame, and obtaining a second motion vector after encoding and decoding corresponding to each reference frame; wherein the video frame before the current frame is a historical frame of the current frame, and the encoded and decoded frame of the historical frame is a reference frame;

[0010] Determine a temporal context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and the N reference frames;

[0011] According to the time context, the current frame is encoded to obtain a target data stream, and the target data stream is sent.

[0012] In one implementation, determining a temporal context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and N reference frames includes:

[0013] extracting reference frame features for each reference frame;

[0014] According to the first motion vector after coding and decoding, a target reference frame among the N reference frames is distorted to obtain a distorted target reference frame; the target reference frame is a coded frame of a previous historical frame of the current frame;

[0015] For each reference frame, according to the second motion vector after encoding and decoding corresponding to the reference frame, a reference frame feature of the reference frame is distorted to obtain a distorted reference frame feature;

[0016] A temporal context is determined based on each warped reference frame feature, a reference frame feature of each reference frame, a warped target reference frame, and a target reference frame.

[0017] In one implementation, determining a temporal context based on each warped reference frame feature, a reference frame feature of each reference frame, a warped target reference frame, and a target reference frame includes:

[0018] Concatenate each distorted reference frame feature, each reference frame feature of the reference frame, the distorted target reference frame, and the target reference frame to obtain a feature tensor;

[0019] Using the residual network, the feature tensor is processed to obtain the temporal context.

[0020] In one implementation, obtaining a first motion vector corresponding to a current frame after encoding and decoding includes:

[0021] Get the first motion vector corresponding to the current frame;

[0022] Performing motion coding processing on the first motion vector to obtain an implicit representation of the first motion vector;

[0023] quantizing the first motion vector latent representation to obtain a quantized first motion vector latent representation;

[0024] Performing entropy coding on the quantized first motion vector latent representation to obtain a first data stream;

[0025] The first data stream is entropy decoded and motion decoded to obtain a first motion vector after encoding and decoding.

[0026] In one implementation, obtaining a first motion vector corresponding to a current frame includes:

[0027] A motion estimation process is performed according to a target reference frame among the N reference frames and a current frame to obtain a first motion vector; the target reference frame is a coded frame of a previous historical frame of the current frame.

[0028] In one implementation, encoding is performed on the current frame according to the time context to obtain a target data stream, including:

[0029] According to the temporal context, the current frame is context-encoded to obtain the contextual latent representation;

[0030] Quantize the contextual latent representation to obtain a quantized contextual latent representation;

[0031] Performing entropy coding on the quantized contextual latent representation to obtain a second data stream;

[0032] The first data stream and the second data stream are combined and processed to obtain a target data stream.

[0033] In one implementation, the method further includes:

[0034] According to the time context, the target data stream is decoded to obtain the codec frame of the current frame;

[0035] The encoded and decoded frame of the current frame is stored in the reference frame buffer to update the reference frame buffer.

[0036] In one implementation, determining N reference frames corresponding to the current frame includes:

[0037] Determine the previous N historical frames of the current frame;

[0038] From the reference frame buffer, the coded and decoded frame of each historical frame is obtained, and the coded and decoded frame of each historical frame is determined as the reference frame corresponding to the current frame.

[0039] In a second aspect, an embodiment of the present application provides a video frame processing device, including:

[0040] An acquisition module, used to acquire the current frame to be processed;

[0041] A processing module, used to determine N reference frames corresponding to the current frame; N is a positive integer greater than 1;

[0042] The processing module is further used to obtain a first motion vector after coding and decoding corresponding to the current frame, and obtain a second motion vector after coding and decoding corresponding to each reference frame; wherein the video frame before the current frame is a historical frame of the current frame, and the coded and decoded frame of the historical frame is a reference frame;

[0043] The processing module is further used to determine the temporal context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and the N reference frames;

[0044] The processing module is also used to encode the current frame according to the time context to obtain the target data stream and send the target data stream.

[0045] In one implementation, the processing module is specifically configured to:

[0046] extracting reference frame features for each reference frame;

[0047] According to the first motion vector after coding and decoding, a target reference frame among the N reference frames is distorted to obtain a distorted target reference frame; the target reference frame is a coded frame of a previous historical frame of the current frame;

[0048] For each reference frame, according to the second motion vector after encoding and decoding corresponding to the reference frame, a reference frame feature of the reference frame is distorted to obtain a distorted reference frame feature;

[0049] A temporal context is determined based on each warped reference frame feature, a reference frame feature of each reference frame, a warped target reference frame, and a target reference frame.

[0050] In one implementation, the processing module is specifically configured to:

[0051] Concatenate each distorted reference frame feature, each reference frame feature of the reference frame, the distorted target reference frame, and the target reference frame to obtain a feature tensor;

[0052] Using the residual network, the feature tensor is processed to obtain the temporal context.

[0053] In one implementation, the processing module is specifically configured to:

[0054] Get the first motion vector corresponding to the current frame;

[0055] Performing motion coding processing on the first motion vector to obtain an implicit representation of the first motion vector;

[0056] quantizing the first motion vector latent representation to obtain a quantized first motion vector latent representation;

[0057] Performing entropy coding on the quantized first motion vector latent representation to obtain a first data stream;

[0058] The first data stream is entropy decoded and motion decoded to obtain a first motion vector after encoding and decoding.

[0059] In one implementation, the processing module is specifically configured to:

[0060] A motion estimation process is performed according to a target reference frame among the N reference frames and a current frame to obtain a first motion vector; the target reference frame is a coded frame of a previous historical frame of the current frame.

[0061] In one implementation, the processing module is specifically configured to:

[0062] According to the temporal context, the current frame is context-encoded to obtain the contextual latent representation;

[0063] Quantize the contextual latent representation to obtain a quantized contextual latent representation;

[0064] Performing entropy coding on the quantized contextual latent representation to obtain a second data stream;

[0065] The first data stream and the second data stream are combined and processed to obtain a target data stream.

[0066] In one implementation, the processing module is further configured to:

[0067] According to the time context, the target data stream is decoded to obtain the codec frame of the current frame;

[0068] The encoded and decoded frame of the current frame is stored in the reference frame buffer to update the reference frame buffer.

[0069] In one implementation, the processing module is specifically configured to:

[0070] Determine the previous N historical frames of the current frame;

[0071] From the reference frame buffer, the coded and decoded frame of each historical frame is obtained, and the coded and decoded frame of each historical frame is determined as the reference frame corresponding to the current frame.

[0072] In a third aspect, an embodiment of the present application provides a computing device, including:

[0073] A processor, and a memory communicatively connected to the processor;

[0074] Memory for storing computer-executable instructions;

[0075] The processor is used to execute the computer-executable instructions stored in the memory to implement the method of the first aspect.

[0076] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method of the first aspect.

[0077] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which is used to implement the method of the first aspect when the computer program is executed by a processor.

[0078] The embodiments of the present application provide a method, device and medium for processing video frames. The method includes: after obtaining the current frame to be processed, the sending device determines N reference frames corresponding to the current frame. The sending device obtains the first motion vector corresponding to the current frame, and obtains the second motion vector after encoding and decoding corresponding to each reference frame. The sending device can determine the time context based on the first motion vector after encoding and decoding, the second motion vector after encoding and decoding corresponding to each reference frame, and N reference frames. The sending device can encode the current frame according to the time context, obtain the target data stream, and send the target data stream. The method of the embodiment of the present application improves the encoding performance by mining the time context containing rich time information from multiple reference frames, the first motion vector after encoding and decoding, and the second motion vector after encoding and decoding corresponding to each reference frame, and then encoding the current frame based on the time context. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technical descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0080] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;

[0081] Figure 2a A flowchart of a first embodiment of a method for processing a video frame provided in an embodiment of the present application;

[0082] Figure 2b A schematic diagram of a video frame processing flow provided in an embodiment of the present application;

[0083] Figure 2c A network structure diagram of a motion codec provided in an embodiment of the present application;

[0084] Figure 2d A schematic diagram of the structure of a residual network provided in an embodiment of the present application;

[0085] Figure 3a A flowchart of a second embodiment of a method for processing a video frame provided in an embodiment of the present application;

[0086] Figure 3bA network structure diagram of a context codec provided in an embodiment of the present application;

[0087] Figure 4 A flowchart of a third embodiment of a method for processing a video frame provided in an embodiment of the present application;

[0088] Figure 5 A schematic diagram of the structure of a video frame processing device provided in an embodiment of the present application;

[0089] Figure 6 A structural diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0090] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments made by ordinary technicians in this field under the enlightenment of the embodiments belong to the scope of protection of the present application.

[0091] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0092] Video encoding is the process of converting the original video format file into another video format file through compression technology for transmission. Therefore, it is crucial to generate higher quality frames within a given bandwidth budget.

[0093] The end-to-end video encoding method in the related art usually uses the coded frame of the previous historical frame of the current frame to generate a predicted frame of the current frame in the pixel space, and uses the predicted frame as a condition for encoding the current frame, subtracts the current frame from the predicted frame, and encodes the residual after the subtraction and sends it to the receiving device. However, the method in the related art only uses the condition through a simple subtraction operation, resulting in that the new content generated by the motion between the video frames cannot be encoded, resulting in the method in the related art having a low video encoding performance problem.

[0094] Therefore, there is an urgent need for a video frame processing method that can improve the performance of video encoding.

[0095] Based on the above technical problems, an embodiment of the present application provides a method for processing a video frame. After obtaining the current frame to be processed, the sending device determines the N reference frames corresponding to the current frame. The sending device can obtain the first motion vector after encoding and decoding corresponding to the current frame, and obtain the second motion vector after encoding and decoding corresponding to each reference frame. The sending device can determine the time context based on the first motion vector after encoding and decoding, the second motion vector after encoding and decoding corresponding to each reference frame, and the N reference frames. The sending device can encode the current frame according to the time context, obtain the target data stream, and send the target data stream.

[0096] Through the above method, a temporal context with richer information can be learned from multiple reference frames, thereby efficiently assisting the encoding process of the current frame, thereby improving the performance of video encoding.

[0097] The following is a detailed description of the video frame processing method of the embodiment of the present application.

[0098] First, the application scenarios of the embodiments of the present application are described.

[0099] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, the application scenario includes a sending device 10 and a receiving device 20. The sending device 10 can be connected to the receiving device 20 for communication.

[0100] It should be noted that both the sending device 10 and the receiving device 20 are computing devices.

[0101] In one possible implementation, the sending device 10 may be a server. For example, from an architectural point of view, the server may be a rack server, a high-density server, a tower server, or a whole cabinet server; from a functional point of view, the server may be a general-purpose server or an artificial intelligence server (AI (artificial intelligence) server), etc. For example, the artificial intelligence server may be a graphics processing server (GPU (graphics processing unit) server).

[0102] In one implementation, the sending device 10 may also be a terminal device, and illustratively, may be a terminal device equipped with an Android operating system.

[0103] In this application scenario, the receiving device 20 can be a terminal device, such as a computer. It can also be a server; for example, from the perspective of architecture, the server can be a rack server, a high-density server, a tower server, or a whole cabinet server; from the perspective of function, the server can be a general-purpose server or an AI server, etc.

[0104] It should be noted that Figure 1 This is a schematic diagram of the application scenario provided by the embodiment of the present application. Figure 1 The actual form of the various devices included in the Figure 1 The interaction mode between devices is limited, and in the application of the solution, it can be set according to actual needs.

[0105] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0106] Figure 2a This is a flow chart of a first embodiment of a method for processing a video frame provided in an embodiment of the present application. Figure 2a , the method specifically comprises the following steps:

[0107] S201: Obtain the current frame to be processed.

[0108] In this embodiment, the sending device may obtain the current frame to be processed.

[0109] S202: Determine N reference frames corresponding to the current frame.

[0110] In this embodiment, the sending device can determine N reference frames corresponding to the current frame after obtaining the current frame to be processed. Wherein, N is a positive integer greater than 1. It should be noted that the reference frame refers to the codec frame of the historical frame of the current frame. The historical frame refers to the video frame before the current frame. It should also be noted that as the number of reference frames increases, the processing performance of the sending device for the video frame is improved, the magnitude of the improvement of the processing performance of the sending device for the video frame is reduced, and the processing time is increased. Preferably, N can be 4 to take into account the processing performance and processing time of the video frame.

[0111] It should also be noted that the number of reference frames (N) used in each video frame processing process is the same.

[0112] It should be noted that the N reference frames include the target reference frame. The target reference frame is a reference frame among the N reference frames. ) is the current frame ( )'s previous historical frame ( ) of the codec frame ( ).

[0113] Next, the process of determining the N reference frames corresponding to the current frame by the sending device is described. It should be noted that the sending device refers to a device that sends video frames. The sending device can be a mobile phone, a computer, a server, etc.

[0114] Specifically, the sending device includes a reference frame buffer, in which coded frames of a plurality of historical frames are stored.

[0115] The sending device may determine the N previous historical frames of the current frame. It should be noted that the historical frames are the video frames before the current frame. For example, when N is 4, for the current frame , the sending device can determine the 4 historical frames before the current frame: , , as well as That is, get the four video frames before the current frame.

[0116] The sending device can obtain the codec frame of each of the first N historical frames from the reference frame buffer. Exemplarily, the sending device can determine the codec frames of 4 historical frames: , , as well as .

[0117] The sending device may determine the codec frame of each historical frame as a reference frame for the current frame. , the sending device can determine the 4 reference frames corresponding to the current frame: , , as well as .

[0118] S203: Obtain a first motion vector corresponding to the current frame after coding and decoding, and obtain a second motion vector corresponding to each reference frame after coding and decoding.

[0119] In this embodiment, the sending device may obtain a first motion vector corresponding to the current frame after encoding and decoding, and obtain a second motion vector corresponding to each reference frame after encoding and decoding.

[0120] The first motion vector after encoding and decoding refers to a motion vector obtained after encoding and decoding the first motion vector.

[0121] The encoded and decoded second motion vector refers to a motion vector obtained after encoding and decoding the second motion vector.

[0122] Figure 2b A schematic diagram of a video frame processing flow provided in an embodiment of the present application. Figure 2c A network structure diagram of a motion codec provided in an embodiment of the present application.

[0123] Combine the following Figure 2b and Figure 2c , a process of determining, by a sending device, a first motion vector after encoding and decoding corresponding to a current frame is described.

[0124] Specifically, the sending device may obtain the first motion vector corresponding to the current frame ( ).

[0125] The transmitting device may ) is processed by motion coding to obtain the first motion vector implicit representation ( In one implementation, Figure 2b and Figure 2c As shown, the transmitting device can use a motion encoder to generate a first motion vector ( ) for motion coding processing.

[0126] The sending device may implicitly represent the first motion vector ( ) is quantized to obtain the implicit representation of the quantized first motion vector ( ).

[0127] The sending device may implicitly represent the quantized first motion vector ( ) performs entropy coding processing to obtain a first data stream. In one implementation, Figure 2b As shown, the sending device can use the entropy model to implicitly represent the quantized first motion vector ( ) is entropy encoded.

[0128] The sending device may perform entropy decoding on the first data stream to obtain a quantized first motion vector implicit representation ( In one implementation, Figure 2b As shown, the sending device can use the entropy model to perform entropy decoding processing on the first data stream.

[0129] The sending device may implicitly represent the quantized first motion vector ( ) motion decoding process, and obtain the first motion vector after encoding and decoding ( In one implementation, Figure 2b and Figure 2c As shown, the transmitting device can use a motion decoder to implicitly represent the quantized first motion vector ( ) to perform motion decoding processing.

[0130] In addition, the transmitting device may transmit the first motion vector ( ) is stored in the codec motion vector buffer to update the codec motion vector buffer. It should be noted that the codec motion vector buffer is stored in a storage component corresponding to the sending device. Exemplarily, the storage component can be a memory, a hard disk, etc. of the sending device.

[0131] It should be noted that the purpose of the sending device storing the first coded motion vector in the coded motion vector buffer to update the coded motion vector buffer is that when processing the next video frame of the current frame, the sending device can directly obtain the first coded motion vector from the coded frame motion vector buffer and use the first coded motion vector as a coded second motion vector corresponding to a reference frame for processing. In this way, the speed of obtaining the coded second motion vector corresponding to the reference frame can be improved.

[0132] The following describes the updating process of the coding and decoding motion vector buffer by taking the buffer capacity of the coding and decoding motion vector buffer as 4 as an example.

[0133] Specifically, when the current frame is the first video frame ( ), since the first video frame does not involve a motion vector, the sending device can update four tensors with values ​​of 0 to the codec motion vector buffer.

[0134] When the current frame is the second video frame ( ), based on the second video frame and the encoded first video frame, the encoded motion vector The sending device can convert the encoded motion vector Update to the codec motion vector buffer. After the sending device updates the codec motion vector buffer, the codec motion vector buffer stores three tensors with values ​​of 0 and a decoded motion vector .

[0135] When the current frame is the third video frame ( ), based on the third video frame and the encoded and decoded second video frame, the encoded and decoded motion vector The sending device can convert the encoded motion vector Update to the codec motion vector buffer. After the sending device updates the codec motion vector buffer, the codec motion vector buffer stores two tensors with values ​​of 0, a coded motion vector , and a decoded motion vector .

[0136] When the current frame is the fourth video frame ( ), based on the fourth video frame and the encoded and decoded third video frame, the encoded and decoded motion vector The sending device can convert the encoded motion vector Update to the codec motion vector buffer. After the sending device updates the codec motion vector buffer, the codec motion vector buffer stores a tensor with a value of 0 and a decoded motion vector , a decoded motion vector , and a decoded motion vector .

[0137] When the current frame is the fifth video frame ( ), based on the fifth video frame and the encoded and decoded fourth video frame, the encoded and decoded motion vector The sending device can convert the encoded motion vector Update to the codec motion vector buffer. After the sending device updates the codec motion vector buffer, the codec motion vector buffer stores a coded motion vector , a decoded motion vector , a decoded motion vector , and a decoded motion vector .

[0138] Next, combine Figure 2b , the process of the sending device obtaining the first motion vector corresponding to the current frame is explained.

[0139] Specifically, the sending device can obtain the target reference frame ( ), that is, the sending device can obtain the previous historical frame of the current frame ( ) of the codec frame ( ) then, according to the target reference frame ( ), and the current frame ( ), perform motion estimation processing to obtain a first motion vector corresponding to the current frame. The first motion vector can represent the motion relationship between the current frame and the target reference frame (the coded frame of the previous historical frame).

[0140] In one implementation, the sending device may use a motion estimation module in a motion module to estimate the target reference frame ( ), and the current frame ( ), perform motion estimation processing, and obtain the first motion vector corresponding to the current frame ( It should be noted that the motion estimation module can be an optical flow network, which can be based on the codec frame of the previous historical frame of the current frame ( ), and the current frame ( ), calculate the optical flow, and determine the optical flow as the first motion vector.

[0141] Next, combine Figure 2b , a process in which a sending device obtains a second motion vector corresponding to each reference frame after encoding and decoding is described.

[0142] Specifically, for each reference frame ( ), the sending device can obtain the second motion vector ( ). It should be noted that each reference frame corresponds to a second motion vector after encoding and decoding. Exemplarily, the sending device calculates the reference frame ( ) corresponds to the second motion vector after decoding ( ), the sending device can ) corresponds to the second motion vector ( ) is encoded and decoded to obtain the reference frame ( ) corresponds to the second motion vector after decoding ( ). It should be noted that the reference frame ( ) corresponds to the second motion vector ( ), is the sending device based on the target historical frame ( ), and the codec frame of the previous historical frame of the target historical frame ( ), and perform motion estimation to obtain the previous historical frame of the target historical frame ( ) of the codec frame ( ), is the reference frame ( ).

[0143] S204: Determine a temporal context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and the N reference frames.

[0144] In this embodiment, the sending device may determine the time context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and N reference frames.

[0145] Specifically, Figure 2b As shown, the sending device can use a multi-reference frame time context learning module to determine the time context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and N reference frames.

[0146] Combine the following Figure 2b , the process of determining the time context by the sending device is explained.

[0147] Specifically, for any reference frame, the transmitting device may extract the reference frame feature of the reference frame. Exemplarily, the transmitting device may use the following formula (1) to adopt a feature extraction function ( Function), extract the reference frame features of the reference frame:

[0148] (1)

[0149] in, represents the reference frame; represents the reference frame features; Indicates the interval relationship between the historical frame corresponding to the reference frame (the historical frame used for encoding and decoding to obtain the reference frame) and the current frame. When i is 1, it indicates that the historical frame corresponding to the reference frame is the previous historical frame of the current frame. It should be noted that when N is 4, i is 1, 2, 3, and 4 respectively.

[0150] The sending device can use the first motion vector after encoding and decoding ( ), for the target reference frame ( ) is distorted to obtain the distorted target reference frame ( ). It should be noted that the target reference frame ( ) is the current frame ( )'s previous historical frame ( ) of the codec frame ( ).

[0151] For example, the sending device may use the following formula (2) to adopt a distortion function ( Function), get the distorted target reference frame:

[0152] (2)

[0153] For each reference frame, the sending device may use the second motion vector ( ), the reference frame features of the reference frame ( ) is distorted to obtain the distorted reference frame features ( ).

[0154] For example, the transmitting device may use the following formula (3) based on the distortion function ( Function), get the distorted reference frame features:

[0155] (3)

[0156] It should be noted that the second motion vector ( ) is the target historical frame ( ) corresponding to the motion vector, the previous historical frame of the target historical frame ( ) of the codec frame ( ), is the reference frame ( ). It should be noted that the second motion vector after encoding and decoding is obtained by the sending device from the encoding and decoding motion vector buffer.

[0157] The transmitting device may determine the temporal context based on each warped reference frame feature, a reference frame feature of each reference frame, a warped target reference frame, and a target reference frame.

[0158] The following describes a process in which a transmitting device determines a temporal context based on each warped reference frame feature, a reference frame feature of each reference frame, a warped target reference frame, and a target reference frame.

[0159] Specifically, the sending device may concatenate each distorted reference frame feature, each reference frame feature, the distorted target reference frame, and the target reference frame to obtain a feature tensor ( ). For example, the sending device may use the following formula (4), based on the concatenation function ( Function), get the feature tensor:

[0160] (4)

[0161] Figure 2d A schematic diagram of a residual network structure provided in an embodiment of the present application. The sending device can use Figure 2d The residual network shown in FIG. 1 processes the feature tensor to obtain the temporal context. For example, the sending device can use the following formula (5) based on the residual network ( function), get the time context:

[0162] (5)

[0163] S205: Encode the current frame according to the time context to obtain a target data stream, and send the target data stream.

[0164] In this embodiment, the sending device may perform encoding processing on the current frame according to the time context to obtain a target data stream.

[0165] Specifically, Figure 2b As shown, the sending device can use the context encoder to perform context encoding on the current frame according to the time context to obtain the context implicit representation ( ).

[0166] The sending device can quantize the contextual latent representation to obtain a quantized contextual latent representation ( ).

[0167] The sending device may utilize an entropy model to perform entropy coding processing on the quantized contextual latent representation to obtain a second data stream in the target data stream.

[0168] The sending device can combine the first data stream and the second data stream to obtain the target data stream. It should be noted that the first data stream is obtained by the sending device in the process of obtaining the first motion vector after encoding and decoding. The specific implementation process has been described in S203 and will not be repeated here.

[0169] After obtaining the target data stream, the sending device may perform sending processing on the target data stream.

[0170] In one implementation, the sending device may determine the second super a priori information corresponding to the contextual latent representation. The sending device may determine the first super a priori information corresponding to the first motion vector latent representation. The sending device may perform entropy coding on the contextual latent representation according to the second super a priori information to obtain a second data stream. The sending device may perform entropy coding on the first motion vector latent representation according to the first super a priori information to obtain a first data stream.

[0171] Beneficial effects of this embodiment: The sending device can obtain the current frame to be processed. The sending device can determine the N reference frames corresponding to the current frame. The sending device can obtain the first motion vector corresponding to the current frame, and obtain the encoded second motion vector corresponding to each reference frame. The sending device can obtain the time context based on the encoded first motion vector, the encoded second motion vector corresponding to each reference frame, and the N reference frames. The sending device can encode the current frame according to the time context to obtain the target data stream. The sending device can send the target data stream. In the above manner, the time context containing rich time information can be learned from the encoded first motion vector, the encoded second motion vector corresponding to each reference frame, and multiple reference frames, thereby efficiently assisting the current frame in encoding processing, thereby improving the performance of video encoding.

[0172] Figure 3a This is a flow chart of a second embodiment of a method for processing a video frame provided in an embodiment of the present application. Figure 3a , the method specifically comprises the following steps:

[0173] S301: Obtain the current frame to be processed.

[0174] In this embodiment, the sending device may obtain the current frame to be processed ( ).

[0175] S302: Determine the previous N historical frames of the current frame.

[0176] In this embodiment, the sending device may determine the previous N historical frames of the current frame. ), the sending device can determine the 4 historical frames before the current frame: , , as well as .

[0177] It should be noted that N is a positive integer greater than 1.

[0178] Preferably, N can be 4.

[0179] It should also be noted that, for a video, the video includes multiple continuous video frames. Taking a video frame as a current frame as an example, the video frames before the current frame are historical frames of the current frame.

[0180] S303: Obtain the coded and decoded frame of each historical frame from the reference frame buffer, and determine the coded and decoded frame of each historical frame as a reference frame corresponding to the current frame.

[0181] In this embodiment, the sending device may obtain the codec frame of each historical frame from the reference frame buffer, and determine the codec frame of each historical frame as the reference frame corresponding to the current frame.

[0182] Specifically, the sending device includes a reference frame buffer, in which coded frames of a plurality of historical frames are stored.

[0183] The sending device can obtain the codec frame of each of the first N historical frames from the reference frame buffer. For example, for 4 historical frames: , , as well as , the sending device can determine the codec frame of 4 historical frames: , , as well as .

[0184] The sending device may determine the codec frame of each historical frame as a reference frame for the current frame. ), the sending device can determine the 4 reference frames corresponding to the current frame: , , as well as .

[0185] Below, taking N as 4 as an example, the process of determining the reference frame corresponding to the current frame by the sending device using the farthest copy strategy when there are no coded and decoded frames (reference frames) of N historical frames in the reference frame buffer is described.

[0186] Specifically, when the current frame is the first video frame ( ), there are no 4 historical frames of the coded frame (reference frame) in the reference frame buffer. The sending device can ) to perform encoding and decoding processing to obtain the first video frame after encoding and decoding ( The sending device can decode the first video frame ( ) to copy and process, and obtain four first video frames after encoding and decoding ( The sending device can send the four first video frames after encoding and decoding ( ), which is determined as the reference frame corresponding to the current frame. The sending device can ) to the reference frame buffer.

[0187] When the current frame is the second video frame ( ), in the reference frame buffer, there is a coded frame of the historical frame - the first video frame after coding ( The sending device can send the second video frame ( ) is encoded and decoded to obtain the second video frame after encoding and decoding ( The sending device can decode the first video frame ( ) to copy and process, and obtain three first video frames after encoding and decoding ( The sending device can send the first video frame after three encodings and decodings ( ), and a second encoded video frame ( ), determine it as the reference frame of the current frame, and update the reference frame buffer.

[0188] When the current frame is the third video frame ( ), in the reference frame buffer, there is a coded frame of the historical frame - the first video frame after coding ( ) and the second video frame after encoding and decoding ( The sending device can send the third video frame ( ) is encoded and decoded to obtain the encoded and decoded third video frame ( The sending device can decode the first video frame ( ) to copy and obtain two first video frames after encoding and decoding ( The sending device can send two first video frames after encoding and decoding ( ), a second video frame after encoding and decoding ( ), and a third encoded and decoded video frame ( ), determine it as the reference frame of the current frame, and update the reference frame buffer.

[0189] When the current frame is the fourth video frame ( ), in the reference frame buffer, there is a coded frame of the historical frame - the first video frame after coding ( )、The second video frame after encoding and decoding( ), and the third video frame after encoding and decoding ( The sending device can send the fourth video frame ( ) is encoded and decoded to obtain the fourth video frame after encoding and decoding ( The sending device can send a fourth video frame after encoding and decoding ( ), a first video frame after encoding and decoding ( ), a second video frame after encoding and decoding ( ), and a third encoded and decoded video frame ( ), determine it as the reference frame of the current frame, and update the reference frame buffer.

[0190] S304: Obtain a first motion vector corresponding to the current frame after encoding and decoding, and obtain a second motion vector corresponding to each reference frame after encoding and decoding.

[0191] In this embodiment, the sending device may obtain the first motion vector corresponding to the current frame after coding and decoding. In addition, the sending device may also obtain the second motion vector corresponding to each reference frame after coding and decoding.

[0192] The specific implementation process is the same as S203 and will not be repeated here.

[0193] S305: Determine a temporal context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and the N reference frames.

[0194] In this embodiment, the sending device may determine the time context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and N reference frames.

[0195] Specifically, the sending device can extract the reference frame features of each reference frame. The sending device can warp the target reference frame among the N reference frames according to the first motion vector after encoding and decoding to obtain the warped target reference frame. Among them, the target reference frame is the encoded and decoded frame of the previous historical frame of the current frame. For each reference frame, the sending device can warp the reference frame features of the reference frame according to the second motion vector after encoding and decoding corresponding to the reference frame to obtain the warped reference frame features. The sending device can splice each warped reference frame feature, the reference frame feature of each reference frame, the warped target reference frame, and the target reference frame to obtain a feature tensor. The sending device can use a residual network to process the feature tensor to obtain a temporal context.

[0196] It should be noted that the encoded and decoded second motion vector corresponding to each reference frame is stored in the encoded and decoded motion vector buffer.

[0197] The sending device may obtain the encoded and decoded second motion vector corresponding to each reference frame from the encoded and decoded motion vector buffer.

[0198] S306: Encode the current frame according to the time context to obtain a target data stream, and send the target data stream.

[0199] In this embodiment, the sending device may perform encoding processing on the current frame according to the time context to obtain a target data stream, and perform sending processing on the target data stream.

[0200] Specifically, the sending device can ), for the current frame ( ) is processed by context encoding to obtain the contextual latent representation ( ).

[0201] The sending device can implicitly indicate the context ( ) is quantized to obtain the quantized contextual latent representation ( ).

[0202] The sending device can implicitly represent the quantized context ( ) is entropy encoded to obtain a second data stream.

[0203] The sending device may implicitly represent the quantized first motion vector ( ) performs entropy coding processing to obtain a first data stream.

[0204] The sending device may combine the first data stream and the second data stream to obtain a target data stream.

[0205] S307: Decode the target data stream according to the time context to obtain a codec frame of the current frame.

[0206] In this embodiment, the sending device may decode the target data stream according to the time context to obtain a codec frame of the current frame.

[0207] Specifically, based on the target data stream including the first data stream and the second data stream, the sending device may perform entropy decoding processing on the second data stream in the target data stream to obtain a quantized contextual latent representation ( ), and entropy decoding is performed on the first data stream in the target data stream to obtain the quantized first motion vector implicit representation ( ).

[0208] The sending device may implicitly represent the quantized first motion vector ( ) to perform motion decoding and obtain the first motion vector after encoding and decoding ( ).

[0209] The sending device can ), the quantized contextual latent representation ( ) to perform context decoding and obtain the codec frame of the current frame ( ). It should be noted that the time context is calculated by the sending device based on S305.

[0210] Figure 3b A network structure diagram of a context codec provided in an embodiment of the present application. Figure 3b As shown, the sending device can send the current frame ( ) to perform encoding and decoding processing to obtain the encoding and decoding frame of the current frame ( ).

[0211] S308: storing the encoded and decoded frame of the current frame into the reference frame buffer to update the reference frame buffer.

[0212] In this embodiment, after obtaining the coded frame of the current frame, the sending device can store the coded frame of the current frame in the reference frame buffer to update the reference frame buffer, so that when the subsequent sending device processes the next video frame of the current frame, the coded frame of the current frame in the reference frame buffer can be directly used as a reference frame for processing.

[0213] Beneficial effects of this embodiment: after encoding the current frame and obtaining the encoded current frame, the sending device can decode the encoded current frame according to the time context to obtain the encoded and decoded frame of the current frame. The sending device can store the encoded and decoded frame of the current frame in the reference frame buffer, so that when the sending device subsequently processes the next video frame of the current frame, it can directly use the encoded and decoded frame in the reference frame buffer for processing, thereby improving the processing speed.

[0214] The following describes a process of decoding a video frame by a receiving device through method embodiment 3.

[0215] Figure 4 This is a flow chart of a third embodiment of a method for processing a video frame provided in an embodiment of the present application. Figure 4 , the method specifically comprises the following steps:

[0216] S401: Acquire target data stream.

[0217] In this embodiment, the receiving device may obtain a target data stream (bit stream), wherein the target data stream includes a first data stream and a second data stream.

[0218] S402: Perform entropy decoding on the target data stream to obtain a quantized first motion vector latent representation and a quantized context latent representation.

[0219] In this embodiment, the receiving device may perform entropy decoding on the second data stream in the target data stream to obtain a quantized context implicit representation. The receiving device may perform entropy decoding on the first data stream in the target data stream to obtain a quantized first motion vector implicit representation.

[0220] S403: Perform motion decoding processing on the quantized first motion vector implicit representation to obtain the encoded and decoded first motion vector.

[0221] In this embodiment, the receiving device may use a motion decoder to implicitly represent the quantized first motion vector ( ) to perform motion decoding and obtain the first motion vector after encoding and decoding ( ).

[0222] S404: Obtain N reference frames corresponding to the current frame, and obtain the encoded and decoded second motion vector corresponding to each reference frame.

[0223] In this embodiment, the receiving device may obtain N reference frames corresponding to the current frame from the reference frame buffer.

[0224] Specifically, based on the fact that the receiving device has not obtained the current frame, the receiving device can directly determine that the previous N historical frames of the current frame are respectively .

[0225] The receiving device can obtain the codec frame of each historical frame from the reference frame buffer. .

[0226] The receiving device may determine the codec frame of each historical frame as N reference frames corresponding to the current frame.

[0227] In addition, the receiving device may obtain the encoded and decoded second motion vector corresponding to each reference frame from the encoded and decoded motion vector buffer.

[0228] S405: Determine a temporal context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and the N reference frames.

[0229] In this embodiment, the receiving device may determine the time context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and N reference frames.

[0230] It should be noted that the process by which the receiving device determines the time context based on the first coded motion vector, the second coded motion vector corresponding to each reference frame, and N reference frames is the same as the process by which the sending device determines the time context based on the first coded motion vector, the second coded motion vector corresponding to each reference frame, and N reference frames, and will not be repeated here.

[0231] S406: Perform context decoding processing on the quantized context latent representation according to the temporal context to obtain a coded and decoded current frame.

[0232] In this embodiment, the receiving device may perform context decoding processing on the quantized context latent representation according to the time context to obtain the encoded and decoded current frame.

[0233] Specifically, the receiving device may utilize a context decoder to perform context decoding processing on the quantized context latent representation according to the time context to obtain the encoded and decoded current frame.

[0234] S407: Display the encoded and decoded current frame.

[0235] In this embodiment, the receiving device may display the current frame after encoding and decoding.

[0236] Beneficial effects of this embodiment: The receiving device can perform entropy decoding processing on the acquired target data stream to obtain a quantized first motion vector implicit representation and a quantized context implicit representation. The receiving device can perform motion decoding processing on the quantized first motion vector implicit representation to obtain the encoded and decoded first motion vector. The receiving device can obtain N reference frames corresponding to the current frame, and obtain the encoded and decoded second motion vector corresponding to each reference frame. The receiving device can determine the time context based on the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and the N reference frames, and perform context decoding processing on the quantized context implicit representation based on the time context to obtain the encoded and decoded current frame. The receiving device can display the encoded and decoded current frame. In the above manner, the effect of reconstructing the current frame can be improved.

[0237] The sending device processes the current frame according to the DVCM (Deep Video Compression with Multi-frame Temporal Context Learning) model to obtain the target data stream. The training process of the DVCM model is described below through the fourth method embodiment.

[0238] It should be noted that the DVCM model includes a motion module, a multi-reference frame temporal context learning module, and a context codec module. The motion module includes a motion estimation module, a motion encoder, and a motion decoder. The context codec module includes a context encoder and a context decoder.

[0239] First, the training sample set is explained.

[0240] In an embodiment of the present application, a sending device may obtain a training sample set. In one implementation, the training sample set may be a Vimeo-90k data set. In one implementation, the training sample set may be a sample set in RGB format. It should be noted that, in the case where the training sample set is a sample set in YUV format, the sending device may convert the sample set in YUV format into a sample set in RGB format. In one implementation, the length and width of each training sample in the training sample set may both be integer multiples of 64. In one implementation, in the case where the length and width of each training sample in the training sample set are not integer multiples of 64, the sending device may crop each training sample in the training sample set.

[0241] In addition, in one implementation, the sending device may perform enhancement processing on the training sample set. Specifically, the sending device may cut each training sample in the training sample set into a sample of 256×256 pixels, and randomly perform flip processing on the training sample.

[0242] Next, the process of training the DVCM model using the training sample set is described.

[0243] Specifically, the sending device may train the DVCM model through a loss function until the value of the loss function meets a preset condition.

[0244] In one implementation, the sending device may use a rate-distortion function as a loss function to jointly train the DVCM model.

[0245]

[0246] in, Indicates the current frame The current frame after encoding and decoding The distortion between the two images can be determined by calculating the mean square error (MSE) or by calculating the multiscale structural similarity (MS-SSIM). This embodiment of the present application is not limited to this. In addition, Indicates based on , and the first super-prior information, calculate the bit rate consumption. Indicates based on , and the second super-prior information, calculate the bit rate consumption. represents the Lagrange multiplier, which is used to control the distortion and bit rate consumption The trade-off between.

[0247] It should be noted that during the training process, the following formula (6) can be used to obtain :

[0248] (6)

[0249] During the training process, the following formula (7) can be used to obtain :

[0250] (7)

[0251] During the test, the following formula (8) can be used to obtain :

[0252] (8)

[0253] During the test, the following formula (9) can be used to obtain :

[0254] (9)

[0255] During the training process, the sending device may adopt a multi-stage training method to train the DVCM model based on Table 1. Table 1 is a multi-stage training strategy.

[0256] Step 1: Warm up the motion estimation module in the motion module. is the warped frame in the pixel domain, using the first motion vector right Obtained by distortion processing.

[0257] Step 2: Train all submodules in the motion module, including the motion estimation module, motion encoder, and motion decoder. In Table 1, is the warped frame in the pixel domain, using the first motion vector after encoding and decoding right Obtained by distortion processing.

[0258] Step 3: Train other modules except the motion module. It should be noted that in this step, the parameters of the motion module are frozen, that is, the parameters of the motion module do not change.

[0259] Step 4: In this step, the parameters of the motion module continue to be frozen. It should be noted that this step takes into account and the bit rate consumption of encoding the second super prior information .

[0260] Step 5: Unfreeze the parameters of the motion module and train all modules in the DVCM model.

[0261] Steps 6, 7, 8, 9, 10: Gradually increase the number of frames to train all modules in the DVCM model.

[0262] Step 11: Reduce the learning rate to 1e-5 to fine-tune all modules in the DVCM model.

[0263] Table 1 Multi-stage training strategy

[0264]

[0265] In addition, after completing the training of the DVCM model, the sending device may use the test sample set to test the DVCM model, and after the test passes, use the DVCM model to process the current frame to be processed to obtain the target data stream.

[0266] In one implementation, the test sample set may be a High Efficiency Video Coding (HEVC) data set.

[0267] In one implementation, the test sample set may be a sample set in RGB format. It should be noted that, when the test sample set is a sample set in YUV format, the sending device may convert the sample set in YUV format into a sample set in RGB format.

[0268] In one implementation, the length and width of each test sample in the test sample set may both be integer multiples of 64. In one implementation, when the length and width of each test sample in the test sample set are not integer multiples of 64, the sending device may crop each test sample in the test sample set.

[0269] Beneficial effects of this embodiment: This embodiment of the application adopts a multi-stage training method to train the DVCM model. Through the above multi-stage training method, the training stability can be improved and the imbalance of training can be avoided.

[0270] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0271] Figure 5 The structure diagram of a video frame processing device provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the video frame processing device 50 includes an acquisition module 51 and a processing module 52.

[0272] An acquisition module 51 is used to acquire a current frame to be processed;

[0273] The processing module 52 is used to determine N reference frames corresponding to the current frame; N is a positive integer greater than 1;

[0274] The processing module 52 is further used to obtain a first motion vector after coding and decoding corresponding to the current frame, and obtain a second motion vector after coding and decoding corresponding to each reference frame; wherein the video frame before the current frame is a historical frame of the current frame, and the coded and decoded frame of the historical frame is a reference frame;

[0275] The processing module 52 is further configured to determine a temporal context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and the N reference frames;

[0276] The processing module 52 is further used to encode the current frame according to the time context to obtain a target data stream, and send the target data stream.

[0277] The video frame processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0278] In one implementation, the processing module 52 is specifically configured to:

[0279] extracting reference frame features for each reference frame;

[0280] According to the first motion vector after coding and decoding, a target reference frame among the N reference frames is distorted to obtain a distorted target reference frame; the target reference frame is a coded frame of a previous historical frame of the current frame;

[0281] For each reference frame, according to the second motion vector after encoding and decoding corresponding to the reference frame, a reference frame feature of the reference frame is distorted to obtain a distorted reference frame feature;

[0282] A temporal context is determined based on each warped reference frame feature, a reference frame feature of each reference frame, a warped target reference frame, and a target reference frame.

[0283] The video frame processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0284] In one implementation, the processing module 52 is specifically configured to:

[0285] Concatenate each distorted reference frame feature, each reference frame feature of the reference frame, the distorted target reference frame, and the target reference frame to obtain a feature tensor;

[0286] Using the residual network, the feature tensor is processed to obtain the temporal context.

[0287] The video frame processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0288] In one implementation, the processing module 52 is specifically configured to:

[0289] Get the first motion vector corresponding to the current frame;

[0290] Performing motion coding processing on the first motion vector to obtain an implicit representation of the first motion vector;

[0291] quantizing the first motion vector latent representation to obtain a quantized first motion vector latent representation;

[0292] Performing entropy coding on the quantized first motion vector latent representation to obtain a first data stream;

[0293] The first data stream is entropy decoded and motion decoded to obtain a first motion vector after encoding and decoding.

[0294] The video frame processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0295] In one implementation, the processing module 52 is specifically configured to:

[0296] A motion estimation process is performed according to a target reference frame among the N reference frames and a current frame to obtain a first motion vector; the target reference frame is a coded frame of a previous historical frame of the current frame.

[0297] The video frame processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0298] In one implementation, the processing module 52 is specifically configured to:

[0299] According to the temporal context, the current frame is context-encoded to obtain the contextual latent representation;

[0300] Quantize the contextual latent representation to obtain a quantized contextual latent representation;

[0301] Performing entropy coding on the quantized contextual latent representation to obtain a second data stream;

[0302] The first data stream and the second data stream are combined and processed to obtain a target data stream.

[0303] The video frame processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0304] In one implementation, the processing module 52 is further configured to:

[0305] According to the time context, the target data stream is decoded to obtain the codec frame of the current frame;

[0306] The encoded and decoded frame of the current frame is stored in the reference frame buffer to update the reference frame buffer.

[0307] The video frame processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0308] In one implementation, the processing module 52 is specifically configured to:

[0309] Determine the previous N historical frames of the current frame;

[0310] From the reference frame buffer, the coded and decoded frame of each historical frame is obtained, and the coded and decoded frame of each historical frame is determined as the reference frame corresponding to the current frame.

[0311] The video frame processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0312] Figure 6 This is a structural diagram of a computing device provided in an embodiment of the present application. Figure 6 As shown, the computing device 60 includes a processor 61 and a memory 62. The processor 61 is in communication connection with the memory 62, and the memory 62 is used to store computer-executable instructions; the processor 61 is configured to execute the technical solution in any of the above method embodiments by executing the computer-executable instructions stored in the memory 62.

[0313] Optionally, the memory 62 may be independent or integrated with the processor 61. Optionally, when the memory 62 is a device independent of the processor 61, the computing device 60 may further include: a bus 63 for connecting the above devices.

[0314] The computing device is used to execute the technical solution in any of the aforementioned method embodiments, and its implementation principle and technical effects are similar and will not be repeated here.

[0315] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the technical solution provided by any of the aforementioned method embodiments.

[0316] An embodiment of the present application also provides a computer program product, including a computer program, which is used to implement the technical solution provided by the aforementioned method embodiment when executed by a processor.

[0317] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0318] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing a video frame, characterized in that: The method comprises: Get the current frame to be processed; Determine N reference frames corresponding to the current frame; N is a positive integer greater than 1; Obtaining a first motion vector after encoding and decoding corresponding to the current frame, and obtaining a second motion vector after encoding and decoding corresponding to each reference frame; wherein the video frame before the current frame is a historical frame of the current frame, and the encoded and decoded frame of the historical frame is the reference frame; Determine a temporal context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and the N reference frames; According to the time context, the current frame is encoded to obtain a target data stream, and the target data stream is sent; The determining of the temporal context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and the N reference frames includes: extracting reference frame features for each reference frame; According to the first motion vector after encoding and decoding, a target reference frame among the N reference frames is distorted to obtain a distorted target reference frame; the target reference frame is a coded frame of a previous historical frame of the current frame; For each reference frame, according to the encoded and decoded second motion vector corresponding to the reference frame, a reference frame feature of the reference frame is distorted to obtain a distorted reference frame feature; Determining the temporal context based on each warped reference frame feature, the reference frame feature of each reference frame, the warped target reference frame, and the target reference frame; The determining the temporal context according to each warped reference frame feature, the reference frame feature of each reference frame, the warped target reference frame, and the target reference frame comprises: Concatenate each of the warped reference frame features, the reference frame features of each reference frame, the warped target reference frame, and the target reference frame to obtain a feature tensor; The feature tensor is processed using a residual network to obtain the temporal context.

2. The method according to claim 1, characterized in that The obtaining the first motion vector corresponding to the current frame after encoding and decoding includes: Obtaining a first motion vector corresponding to the current frame; Performing motion coding processing on the first motion vector to obtain a first motion vector implicit representation; quantizing the first motion vector implicit representation to obtain a quantized first motion vector implicit representation; Performing entropy coding processing on the quantized first motion vector latent representation to obtain a first data stream; Perform entropy decoding and motion decoding on the first data stream to obtain the encoded and decoded first motion vector.

3. The method according to claim 2, characterized in that The obtaining of the first motion vector corresponding to the current frame includes: Motion estimation processing is performed according to a target reference frame among the N reference frames and the current frame to obtain the first motion vector; the target reference frame is a coded frame of a previous historical frame of the current frame.

4. The method according to claim 2, characterized in that: The encoding process of the current frame according to the time context to obtain a target data stream includes: According to the temporal context, performing context encoding processing on the current frame to obtain a contextual latent representation; quantizing the contextual latent representation to obtain a quantized contextual latent representation; Performing entropy coding on the quantized contextual latent representation to obtain a second data stream; The first data stream and the second data stream are combined and processed to obtain the target data stream.

5. The method according to any one of claims 1 to 4, characterized in that: Also includes: Decoding the target data stream according to the time context to obtain a codec frame of the current frame; The encoded and decoded frame of the current frame is stored in a reference frame buffer to update the reference frame buffer.

6. The method according to claim 5, characterized in that The determining N reference frames corresponding to the current frame includes: Determine the previous N historical frames of the current frame; The coded and decoded frame of each of the historical frames is obtained from the reference frame buffer, and the coded and decoded frame of each of the historical frames is determined as a reference frame corresponding to the current frame.

7. A video frame processing device, characterized in that: include: An acquisition module, used to acquire the current frame to be processed; A processing module, used to determine N reference frames corresponding to the current frame; N is a positive integer greater than 1; The processing module is further used to obtain a first motion vector after coding and decoding corresponding to the current frame, and obtain a second motion vector after coding and decoding corresponding to each reference frame; wherein the video frame before the current frame is a historical frame of the current frame, and the coded and decoded frame of the historical frame is the reference frame; The processing module is further configured to determine a temporal context according to the encoded and decoded first motion vector, the encoded and decoded second motion vector corresponding to each reference frame, and the N reference frames; The processing module is further used to encode the current frame according to the time context to obtain a target data stream, and send the target data stream; The processing module is specifically used for: extracting reference frame features for each reference frame; According to the first motion vector after encoding and decoding, a target reference frame among the N reference frames is distorted to obtain a distorted target reference frame; the target reference frame is a coded frame of a previous historical frame of the current frame; For each reference frame, according to the encoded and decoded second motion vector corresponding to the reference frame, a reference frame feature of the reference frame is distorted to obtain a distorted reference frame feature; Determining the temporal context based on each warped reference frame feature, the reference frame feature of each reference frame, the warped target reference frame, and the target reference frame; The processing module, when determining the temporal context according to each warped reference frame feature, the reference frame feature of each reference frame, the warped target reference frame, and the target reference frame, is specifically configured to: Concatenate each of the warped reference frame features, the reference frame features of each reference frame, the warped target reference frame, and the target reference frame to obtain a feature tensor; The feature tensor is processed using a residual network to obtain the temporal context.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method according to any one of claims 1 to 6.