Video encoding method, device, computer equipment, and medium

By flexibly selecting filtered frames and reference frames during the video encoding process, and determining weights based on the time domain layer for time domain filtering, the video encoding speed and compression efficiency problems affected by noise are solved, and more efficient video encoding is achieved.

CN116527940BActive Publication Date: 2025-08-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310417449.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-07
Publication Date
2025-08-19
Estimated Expiration
2043-04-07

AI Technical Summary

Technical Problem

During the video encoding process, the video encoding speed and compression efficiency are affected by the defects of the video acquisition equipment and the noise caused by the angle or light during shooting.

Method used

By obtaining the image encoding group and encoding scene indication information of the video to be processed, the filtered frame and reference frame are flexibly selected, and the weight is determined according to the time domain layer to perform time domain filtering, including motion estimation and motion compensation processing, the filtered image encoding group is obtained, and finally the encoding process is performed.

Benefits of technology

Improves video encoding speed and compression efficiency, and reduces the bandwidth required for video transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116527940B_ABST
    Figure CN116527940B_ABST
Patent Text Reader

Abstract

The present application discloses a video encoding method, apparatus, computer equipment, and medium. The method includes: obtaining an image encoding group and encoding scene indication information of a video to be processed, and determining at least one filter frame and at least one reference frame of each filter frame based on the encoding scene indication information; determining a first weight of each filter frame based on the time domain layer in which each filter frame is located, and determining a second weight of each reference frame corresponding to each filter frame based on the positional relationship between each filter frame and each corresponding reference frame; processing each filter frame and the compensation frame corresponding to at least one reference frame of each filter frame based on the first weight of each filter frame and the second weight of each reference frame corresponding to each filter frame to obtain a filtered image encoding group, and encoding the filtered image encoding group to obtain an encoding result of the video to be processed. By using this method, the video encoding speed and video compression efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a video encoding method, a video encoding apparatus, a computer device, and a computer-readable storage medium. Background Art

[0002] The purpose of video coding is to convert a video signal from one format to another. This is usually done to enable the video to be played on different devices, or to convert the video from one format to another for storage or transmission.

[0003] During video capture, noise is inevitable due to inherent flaws in the video capture equipment and the angle or lighting conditions of the shot. However, this noise significantly impacts video encoding speed and compression efficiency. Therefore, improving video encoding speed and compression efficiency has become a pressing technical challenge. Summary of the Invention

[0004] The embodiments of the present application provide a video encoding method, apparatus, computer equipment, and medium, which can flexibly select filter frames, filter frames, and weights according to different scenarios to implement time domain filtering, thereby improving video encoding speed and compression efficiency.

[0005] On one hand, an embodiment of the present application discloses a method for processing video coding information, the method comprising:

[0006] Obtaining an image coding group and coding scene indication information of a video to be processed, and determining at least one filtering frame and at least one reference frame of each filtering frame from the image coding group according to the coding scene indication information;

[0007] Determining a first weight of each filtered frame according to a temporal layer in which each filtered frame is located, and determining a second weight of each reference frame corresponding to each filtered frame according to a positional relationship between each filtered frame and each corresponding reference frame;

[0008] Processing each filtered frame and a compensated frame corresponding to at least one reference frame of each filtered frame according to the first weight of each filtered frame and the second weight of each reference frame corresponding to each filtered frame to obtain a filtered image coding group, wherein the compensated frame corresponding to the at least one reference frame of each filtered frame is obtained by performing motion estimation and motion compensation on each filtered frame and at least one reference frame of each filtered frame;

[0009] The filtered image coding group is coded to obtain a coding result of the video to be processed.

[0010] In one aspect, an embodiment of the present application discloses a video encoding device, the device comprising:

[0011] an acquisition unit, configured to acquire an image coding group and coding scene indication information of a video to be processed, and determine at least one filtering frame and at least one reference frame of each filtering frame from the image coding group according to the coding scene indication information;

[0012] a determining unit, configured to determine a first weight of each filtered frame according to a temporal layer in which each filtered frame is located, and determine a second weight of each reference frame corresponding to each filtered frame according to a positional relationship between each filtered frame and each corresponding reference frame;

[0013] a processing unit, configured to process each filtered frame and a compensated frame corresponding to at least one reference frame of each filtered frame according to a first weight of each filtered frame and a second weight of each reference frame corresponding to each filtered frame, to obtain a filtered image coding group, wherein the compensated frame corresponding to at least one reference frame of each filtered frame is obtained by performing motion estimation and motion compensation on each filtered frame and at least one reference frame of each filtered frame;

[0014] The processing unit is further configured to perform encoding processing on the filtered image encoding group to obtain an encoding result of the video to be processed.

[0015] On the one hand, an embodiment of the present application discloses a computer device, which includes a processor suitable for implementing one or more computer programs; and a computer storage medium, wherein the computer storage medium stores one or more computer programs, and the one or more computer programs are suitable for being loaded and executed by the processor in accordance with the above-mentioned video encoding method.

[0016] In one aspect, the present application discloses a computer-readable storage medium storing one or more computer programs, wherein the one or more computer programs are suitable for being loaded by a processor and executing the above-mentioned video encoding method.

[0017] In one aspect, an embodiment of the present application discloses a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the above-mentioned video encoding method.

[0018] In an embodiment of the present application, an image coding group and coding scene indication information of a video to be processed are obtained, and at least one filter frame and at least one reference frame of each filter frame are determined from the image coding group based on the coding scene indication information; motion estimation and motion compensation are performed on each filter frame and at least one reference frame of each filter frame to obtain a compensation frame corresponding to at least one reference frame of each filter frame; a first weight of each filter frame is determined based on the temporal layer in which each filter frame is located, and a second weight of each reference frame corresponding to each filter frame is determined based on the positional relationship between each filter frame and each corresponding reference frame; then, each filter frame and the compensation frame corresponding to at least one reference frame of each filter frame are filtered based on the first weight of each filter frame and the second weight of each reference frame corresponding to each filter frame to obtain a filtered image coding group; finally, the filtered image coding group is encoded to obtain an encoding result of the video to be processed. In this process, the filter frame, filter frame, and weight can be flexibly selected based on the coding scene indication information to implement temporal filtering, which can not only improve the video encoding speed, but also improve the video compression efficiency while meeting the video encoding speed, thereby reducing the bandwidth used for video transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0020] Figure 1 This is a schematic diagram of the network architecture of a video encoding system disclosed in an embodiment of the present application;

[0021] Figure 2 This is a flow chart of a video encoding method disclosed in an embodiment of the present application;

[0022] Figure 3 This is a schematic diagram of the structure of an image coding group disclosed in an embodiment of the present application;

[0023] Figure 4a This is a method for determining a filtering frame disclosed in an embodiment of the present application;

[0024] Figure 4b This is another method for determining a filtering frame disclosed in an embodiment of the present application;

[0025] Figure 5a This is a method for determining a reference frame disclosed in an embodiment of the present application;

[0026] Figure 5bThis is another method for determining a reference frame disclosed in the embodiments of this application;

[0027] Figure 6 This is a flow chart of another video encoding method disclosed in an embodiment of the present application;

[0028] Figure 7 This is a flowchart of another video encoding method disclosed in an embodiment of the present application;

[0029] Figure 8 This is a schematic structural diagram of a video encoding device disclosed in an embodiment of the present application;

[0030] Figure 9 It is a structural diagram of a computer device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0032] Due to inherent defects in video capture equipment and the angle or lighting during shooting, noise in video images is inevitable. However, the noise in these images significantly affects the efficiency of video encoding and compression. Therefore, the embodiments of the present application propose a video encoding method. This method mainly targets the pre-processing process of video encoding - time domain filtering. The method can flexibly select time domain filtering frames, reference frames, and weights for time domain filtering according to different scenes, thereby achieving the effect of improving video encoding speed and compression efficiency.

[0033] In one possible implementation, the video encoding method provided in the embodiment of the present application can be implemented based on cloud technology and / or blockchain technology. Specifically, it may involve one or more of cloud storage, cloud database, and big data in cloud technology. For example, the data required to execute the video encoding method (such as the video to be processed, the image encoding group of the video to be processed, and the encoding scene indication information, etc.) is obtained from the cloud database. For another example, the data required to execute the video encoding method can be stored in the form of blocks on the blockchain; the data generated by executing the video encoding method (such as the filtered image encoding group, the encoding result of the video to be processed, etc.) can be stored in the form of blocks on the blockchain; in addition, the data processing device that executes the video encoding method can be a node device in the blockchain network.

[0034] Specifically, cloud technology refers to a managed technology that unifies hardware, software, and network resources within a wide or local area network (WAN) to enable data computing, storage, processing, and sharing. Cloud technology encompasses network, information technology, integration, management platform, and application technologies used in the cloud computing business model. It can form a resource pool for on-demand, flexible, and convenient use. Cloud computing technology will become a crucial support. Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereafter referred to as a storage system) uses clustering, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (also known as storage nodes) across a network through application software or application interfaces to work collaboratively, providing data storage and service access. A database, in short, can be thought of as an electronic filing cabinet—a place where electronic files are stored, where users can add, query, update, and delete data. A "database" is a collection of data stored in a specific manner, shared by multiple users, with minimal redundancy, and independent of applications.

[0035] See Figure 1 , Figure 1 This is a schematic diagram of a network architecture of a video encoding system according to an embodiment of the present application. Figure 1As shown, the video encoding system 100 may include at least a server 101, at least one first terminal device 102, and at least one second terminal device 103. The server 101 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. This embodiment of the application does not limit this. The first terminal device 102 and the second terminal device 103 may be the same terminal device or different terminal devices. The first terminal device 102 and the second terminal device 103 can both be smart phones, tablet computers, laptop computers, desktop computers, intelligent voice interaction devices, smart watches, vehicle-mounted terminals, smart home appliances, aircraft, etc., but are not limited to these; the server 101, the first terminal device 102 and the second terminal device 103 can establish a direct communication connection between each other through wired communication, or can establish an indirect communication connection through wireless communication. Specifically, the server 101 and the first terminal device 102 can establish a communication connection, the server 101 and the second terminal device 103 can establish a communication connection, and the first terminal device 102 and the second terminal device 103 can also establish a communication connection. The embodiments of the present application do not limit this.

[0036] in, Figure 1 The network architecture diagram of the video coding system is only an example and does not limit it. Figure 1 The server 101 can be deployed as a node in the blockchain network, or the server 101 can be connected to the blockchain network, so that the server 101 can upload the filtered image coding group and the coding result of the video to be processed to the blockchain network for storage to prevent internal data from being tampered with, thereby ensuring data security. In an embodiment of the present application, the first terminal device 102 and the second terminal device are used to send and receive the video to be processed. For example, the first terminal device 102 sends the video to be processed to the server 101, and the server 101 encodes the video to be processed using the video encoding method of the embodiment of the present application. After obtaining the coding result of the video to be processed, the encoding result is sent to the second terminal device 103 so that the second terminal device 103 performs a playback operation. The server 101 is mainly used to process the video to be processed, first performing time domain filtering, then encoding, and finally obtaining the coding result of the video to be processed.

[0037] based on Figure 1In a video encoding system, an embodiment of the present application provides a video encoding method that may include: a first terminal device 102 sends a video to be processed to a server 101, the server 101 obtains an image encoding group and encoding scene indication information of the video to be processed, and determines at least one filter frame and at least one reference frame of each filter frame from the image encoding group according to the encoding scene indication information; performs motion estimation and motion compensation on each filter frame and at least one reference frame of each filter frame to obtain a compensation frame corresponding to at least one reference frame of each filter frame; then determines a first weight of each filter frame according to the time domain layer in which each filter frame is located, and determines a second weight of each reference frame corresponding to each filter frame according to the positional relationship between each filter frame and the corresponding reference frames; then, based on the first weight of each filter frame and the second weight of each reference frame corresponding to each filter frame, performs filtering on each filter frame and the compensation frame corresponding to at least one reference frame of each filter frame to obtain a filtered image encoding group; finally, performs encoding on the filtered image encoding group to obtain an encoding result of the video to be processed. Further, the encoding result of the video to be processed is sent to the second terminal device 103.

[0038] In an embodiment of the present application, the server 101 can flexibly select filter frames, filter frames and weights to implement time domain filtering based on the encoding scene indication information, which can not only improve the video encoding speed, but also improve the video compression efficiency while meeting the video encoding speed, thereby reducing the bandwidth used for video transmission.

[0039] In feasible embodiments, the video encoding method provided in the embodiments of the present application can be applied to various scenarios: 1. For scenes to be played on different playback devices, in which case we prioritize video encoding speed; 2. For transmission or storage of videos to be processed, in which case we prioritize video compression efficiency. The video encoding method provided in the embodiments of the present application can use one method for time domain filtering to achieve video encoding speed and another method for time domain filtering to achieve video compression efficiency. This can also be understood as the two methods selecting different filtering frames and reference frames.

[0040] It can be understood that the video encoding method described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of system architecture and the emergence of new business scenarios, the technical solution provided by the embodiment of the present application is also applicable to similar technical problems.

[0041] It should be noted that in the various embodiments of this application, the relevant data such as the video to be processed, when the various embodiments of this application are applied to specific products or technologies, need to obtain the permission or consent of the object, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0042] See Figure 2 , is a flow chart of a video encoding method disclosed in an embodiment of the present application. The video encoding method mainly describes the time domain filtering process of the video to be processed. The video encoding method can be executed by a computer device, which can be Figure 1 Corresponding to the server 101 shown, the video encoding method may include but is not limited to the following steps:

[0043] S201: Acquire an image coding group and coding scene indication information of a video to be processed, and determine at least one filtering frame and at least one reference frame of each filtering frame from the image coding group according to the coding scene indication information.

[0044] The video to be processed can be sent by the terminal device to the server, or it can be obtained from a database (including local storage and Internet storage) when the server receives a video transmission request. The type and length of the video to be processed are not limited.

[0045] In one possible implementation, after the server obtains the video to be processed, it may send the video to be processed or store it. Therefore, we need to encode the video to be processed before encoding in order to improve the encoding speed or encoding compression efficiency. The present application first performs time domain filtering on the video to be processed, and then encodes the filtered video. Specifically, the image coding group (Group of Pictures, GOP) of the video to be processed is first determined. A video to be processed can be divided into multiple image coding groups, each of which includes N image frames, where N can be 16, 32 or 64, etc. Among them, the order of the N image frames is not necessarily arranged in the order in which the video to be processed is played.

[0046] Each image coding group is divided according to the time domain layer. For example, when an image coding group includes 16 image frames, the structure of the corresponding image coding group can be as follows: Figure 3 As shown in the figure, it includes 5 layers, from temporal layer 0 to temporal layer 4, and each layer includes non-repeating image frames. Similarly, if an image coding group includes 32 image frames, the image coding group can be divided into 6 temporal layers, namely, from temporal layer 0 to temporal layer 5. Similarly, the more image frames an image coding group includes, the more temporal layers it has.

[0047] At the same time as obtaining the image coding group to be processed, coding scene indication information can also be obtained. The coding scene indication information can be included in the video coding request. Prior to performing the step of determining at least one filtered frame and at least one reference frame for each filtered frame from the image coding group, the target coding scene indicated by the coding scene indication information is first determined. The coding scene indication information can be indicated by a unique identifier (whose value is 0 or 1, with 0 representing one scene and 1 representing another scene), allowing the server to identify the specific target coding scene. Alternatively, the coding scene indication information can also include a first indicator and a second indicator, with the first indicator indicating the coding speed and the second indicator indicating the compression efficiency. The specific target coding scene is then determined based on the specific values of the first and second indicators. If the first indicator is greater than a speed threshold, the target coding scene is determined to be a coding speed-focused scene; if the second indicator is greater than a compression threshold, the target coding scene is determined to be a coding speed-focused scene. Therefore, in embodiments of the present application, the target coding scene can include one or more of a coding speed-focused scene and a compression efficiency-focused scene. Different methods can be used to determine the filtering frames and corresponding reference frames for different target coding scenarios.

[0048] The following describes how to determine the filter frame and reference frame in different target coding scenarios:

[0049] 1. When the target encoding scenario is a scenario that focuses on encoding speed, starting from the starting image frame of the image encoding group, a filter frame is determined every preset number of image frames to obtain at least one filter frame, and the preset number is less than 4, thereby determining at least one reference frame for each filter frame from the image encoding group. The starting image frame of the image encoding group may refer to the first frame of the image encoding group, or may refer to the previous frame of the first frame of the image encoding group, that is, the 0th frame, which is equivalent to a flag. Compared with the solution of setting a filter frame every 4 frames, in order to further improve the encoding speed, the present application may set a smaller interval, such as determining a filter frame every 1 frame or every 2 frames.

[0050] For example, Figure 4a As shown, this is a method for determining a filtering frame disclosed in an embodiment of the present application, from Figure 4a It can be seen that this image coding group includes 16 image frames, including 5 time domain layers, among which layers 0 to 3 are all filtered frames. Except for frame 0, the corresponding filtered frames are the even-numbered frames in these 16 frames, such as frame 2, frame 4, frame 8, and so on.

[0051] 2. When the target coding scenario is a scenario focusing on compression efficiency, each image frame in the image coding group is used as a filtering frame to obtain at least one filtering frame.

[0052] For example, Figure 4b As shown, another method for determining the filtering frame disclosed in the embodiment of the present application is as follows. Figure 4b It can be seen that this image coding group includes 16 image frames, including 5 time domain layers, among which the 0th layer to the 4th layer are all filtered frames, that is, each frame is filtered.

[0053] Furthermore, after determining the filtered frames in the image coding group, the reference frame corresponding to each filtered frame is determined. As described above, after determining the image coding group, the image frames included in the image coding group have been divided into time domain layers, and each image coding group includes M time domain layers. In determining the reference frame for each filtered frame, the first time domain layer in which each filtered frame is located is first determined from the M time domain layers. Then, based on the first time domain layer in which each filtered frame is located and the preset distance corresponding to each filtered frame, at least one reference frame for each filtered frame is determined from the M time domain layers. It can be understood that the preset distances for filtered frames in different time domain layers are different, while the same preset distance can be set for filtered frames in the same layer. The preset distance refers to the absolute value of the distance between the reference frame and the filtered frame. For example, a preset distance of 2 means that the two frames before and after the filtered frame are used as the reference frames for the filtered frame, meaning that there are four reference frames.

[0054] For example, Figure 5a As shown, this is a method for determining a reference frame disclosed in an embodiment of the present application, corresponding to Figure 4a The filtering frame of this reference frame is the one that focuses on the encoding speed. Figure 5a It can be seen that for different filter frames, the reference frames selected are different. For example, for the 8th frame, the filter frame with a preset distance of 4 is selected as the reference frame of the 8th frame, that is, the 4 frames before and after the 8th frame; for the 4th frame, the filter frame with a preset distance of 3 is selected as the reference frame of the 4th frame, that is, the 3 frames before and after the 4th frame. The arrow points to the filter frame, from Figure 5a It can be seen that a filtering frame includes one or more reference frames. There is no limit on the number of reference frames for each filtering frame, and the number can be selected according to specific circumstances.

[0055] For example, Figure 5b As shown, another method for determining a reference frame disclosed in an embodiment of the present application corresponds to Figure 4b That is to say, this reference frame determination method corresponds to the scene that focuses on compression efficiency. Figure 5bIt can be seen that for different filter frames, the selected reference frames are also different. For example, for the 8th frame, the filter frame with a preset distance of 4 is selected as the reference frame of the 8th frame, that is, the 4 frames before and after the 8th frame; for the 4th frame, the filter frame with a preset distance of 3 is selected as the reference frame of the 4th frame, that is, the 3 frames before and after the 4th frame; for the 3rd frame, the filter frame with a preset distance of 1 is selected as the reference frame of the 3rd frame, that is, the 1 frame before and after the 3rd frame. Among them, the arrow points to the filter frame, and the bidirectional arrows indicate that they are reference frames to each other, such as the reference frame of the 3rd frame includes the 2nd frame, and the reference frame of the 2nd frame includes the 3rd frame. Similarly, from Figure 5b It can be seen that a filtering frame includes one or more reference frames. There is no limit on the number of reference frames for each filtering frame, and the number can be selected according to specific circumstances.

[0056] from Figure 5a and Figure 5b As can be seen, for different scenes and processing different time-domain filter frames, reference frames can be flexibly selected. The selection of reference frames is also more flexible and the number of reference frames is not limited. Therefore, temporal filtering can be better implemented, thereby improving video encoding speed and compression efficiency.

[0057] S202: Determine a first weight of each filtered frame according to the time domain layer in which each filtered frame is located, and determine a second weight of each reference frame corresponding to each filtered frame according to a positional relationship between each filtered frame and each corresponding reference frame.

[0058] Obtaining weights is used for weighted averaging to generate the filtering result. These weights include the weight of the filtered frame itself, as well as the weights of each reference frame. They also include weights corresponding to matching errors during motion estimation and motion compensation.

[0059] The following describes how to determine the first weight of each filtered frame and the second weight of each reference frame:

[0060] In one possible implementation, the process of determining the first weight of each filtered frame may include: first determining the number of time domain layers corresponding to the image coding group, then obtaining a first weight table from at least one weight table based on the number of time domain layers, and then determining the first weight of each filtered frame from the first weight table based on the time domain layer in which each filtered frame is located. In other words, the first weight table corresponding to different numbers of time domain layers is also different. For example, if the number of time domain layers is 6, the first weight table includes 6 weight values, that is, one weight value corresponds to one time domain layer. For another example, if the number of time domain layers is 5, the first weight table includes 5 weight values. For different weight tables, the weight values of the same time domain layer can be the same or different, and this is not limited here. These weight tables are summarized based on a large amount of experimental data, so better results can be achieved during filtering.

[0061] As shown in Table 1, a first weight table is shown. As can be seen from Table 1, this is a first weight table corresponding to an image coding group including 5 time domain layers, including layer 0 to layer 4. The higher the number of layers, the smaller the corresponding weight.

[0062] Table 1

[0063] Time Domain Layer 0 Time Domain Layer 1 Time Domain Layer 2 Time Domain Layer 3 Time Domain Layer 4 Weight 1.3 0.8 0.6 0.3 0.003

[0064] In a possible implementation, determining the second weights of each reference frame corresponding to each filtered frame may include: obtaining a second weight table, the second weight table including weights corresponding to different distances and different numbers of reference frames. The different numbers of reference frames correspond to the preset distances described above, and the number of reference frames is 4, that is, the preset distance is 4, which is the 4 frames before and after the current filtered frame. At present, the number of reference frames of the relatively mature technical filtering frame is only four frames before and after, but in this application, the number of reference frames of the filtering frame can include 8 frames before and after, or even 16 frames before and after, etc. Then, determine the first distance between each filtered frame and the corresponding reference frames, and at the same time determine the number of reference frames corresponding to each filtered frame. Finally, determine the second weights of the reference frames corresponding to each filtered frame from the second weight table based on the first distance and the number of reference frames.

[0065] Table 2 shows a second weighting table. Table 2 only illustrates some weight values. A reference frame number of 1 indicates taking one frame before and after the filtered frame, and a reference frame number of 3 indicates taking three frames before and after the filtered frame. A reference frame distance of 1 refers to a distance of 1 from the filtered frame, and a reference frame distance of 3 refers to a distance of 3 from the filtered frame. For example, for the eighth filtered frame, we take a reference frame number of 4, meaning the four frames before and after the eighth frame. The first four frames are frames 4, 5, 6, and 7, and the last four frames are frames 9, 10, 11, and 12. Since the number of reference frames is 4, the distance between frames 7 and 9 and the filtered frame is 1. From Table 2, we can conclude that the weights for frames 7 and 9 are 0.95. Similarly, from Table 2, we can conclude that the weights for frames 6 and 10 are 0.75, the weights for frames 5 and 11 are 0.6, and the weights for frames 4 and 12 are 0.55.

[0066] Table 2

[0067] Number of reference frames 1 Number of reference frames 3 Number of reference frames: 4 Number of reference frames: 8 Reference frame distance 1 0.85 0.85 0.95 0.95 Reference frame distance 2 - 0.35 0.75 0.66 Reference frame distance 3 - 0.15 0.6 0.58 Reference frame distance 4 - - 0.55 0.53 Reference frame distance 5 - - - 0.52 Reference frame distance 6 - - - 0.43 Reference frame distance 7 - - - 0.4 Reference frame distance 8 - - - 0.38

[0068] S203. Process each filtered frame and the compensation frame corresponding to at least one reference frame of each filtered frame according to the first weight of each filtered frame and the second weight of each reference frame corresponding to each filtered frame to obtain a filtered image coding group. The compensation frame corresponding to at least one reference frame of each filtered frame is obtained by performing motion estimation and motion compensation processing on each filtered frame and at least one reference frame of each filtered frame.

[0069] In one possible implementation, after determining at least one filtered frame and at least one reference frame for each filtered frame from the image coding group in step S201, block-by-block motion estimation and motion compensation are first performed on the filtered frame. Specifically, the filtered frame is divided into blocks, matching blocks are searched for in each reference frame, and a corresponding compensated frame is generated for each reference frame. Each filtered frame and the compensated frame corresponding to at least one of its reference frames are then processed based on a first weight for each filtered frame and a second weight for each reference frame corresponding to each filtered frame, thereby obtaining a filtered image coding group.

[0070] Filtering using the first and second weights is essentially a weighted averaging process, which can include determining the target weights of each reference frame based on the first weight of each filtered frame and the second weights of each reference frame corresponding to each filtered frame. In addition to the first weight of the filtered frame and the second weight of the reference frame, the target weight of each reference frame also includes other weight values, such as the weight determined by the matching noise during the matching process between the filtered frame and the reference frame, and the weight value determined by the video channel of the video to be processed. The target weight is obtained by multiplying all the weight values. The first pixel value is then determined based on the pixel value of the compensation frame corresponding to at least one reference frame and the target weights of each reference frame. Finally, the pixel value of each filtered frame and the first pixel value are normalized to obtain a filtered image coding group. This process adjusts the original pixel value of the filtered frame using the weight value in real time to obtain a better pixel value for the filtered frame.

[0071] Assume that the input of the nth filter frame is Iin and the output is I out , and the reference frame of the nth filtered frame includes the 4 frames before and after the nth frame, then after filtering the nth filtered frame according to the above description, the filtering result can be expressed by the following formula:

[0072]

[0073] Among them, I r(i) represents the pixel value of the compensated frame corresponding to the i-th reference frame, ω(i) represents the target weight corresponding to the i-th reference frame, and this target weight is obtained after processing multiple weight values (including the first weight of the n-th filtered frame, the second weight value of the i-th reference frame, and some other weight values, such as the weight determined by the matching noise in the matching process of the filtered frame and the reference frame, and the weight value determined by the video channel of the video to be processed, etc.).

[0074] S204 , performing encoding processing on the filtered image encoding group to obtain an encoding result of the video to be processed.

[0075] Step S204 is a conventional processing step for video encoding. The filtered image encoding group is directly input into the encoder for encoding to obtain the encoding result of the video to be processed. The encoding process adopts a conventional encoding method, which will not be elaborated on here.

[0076] In an embodiment of the present application, an image coding group and coding scene indication information of a video to be processed are obtained, and at least one filter frame and at least one reference frame of each filter frame are determined from the image coding group based on the coding scene indication information; motion estimation and motion compensation are performed on each filter frame and at least one reference frame of each filter frame to obtain a compensation frame corresponding to at least one reference frame of each filter frame; a first weight of each filter frame is determined based on the temporal layer in which each filter frame is located, and a second weight of each reference frame corresponding to each filter frame is determined based on the positional relationship between each filter frame and each corresponding reference frame; then, each filter frame and the compensation frame corresponding to at least one reference frame of each filter frame are filtered based on the first weight of each filter frame and the second weight of each reference frame corresponding to each filter frame to obtain a filtered image coding group; finally, the filtered image coding group is encoded to obtain an encoding result of the video to be processed. In this process, the filter frame, filter frame, and weight can be flexibly selected according to the coding scene indication information to implement temporal filtering, which can not only improve the video encoding speed, but also improve the video compression efficiency while meeting the video encoding speed, thereby reducing the bandwidth used for video transmission.

[0077] The following are respectively Figure 6 and Figure 7 The two scenarios described in the embodiments of this application are described separately, see Figure 6 , is a schematic diagram of another video encoding process disclosed in an embodiment of the present application, Figure 6 This is a flowchart for video encoding that focuses on encoding speed. For the selection of filter frames, see Figure 4a , the choice of reference frame can be found in Figure 5a The video encoding may include the following steps:

[0078] S601: Obtain an image coding group of a video to be processed.

[0079] S602 : Starting from the starting image frame of the image coding group, a filtering frame is determined every other image frame to obtain at least one filtering frame.

[0080] S603: Determine at least one reference frame for each filtered frame from the image coding group.

[0081] S604 : Perform motion estimation and motion compensation processing based on each filtered frame and at least one reference frame of each filtered frame to obtain a compensated frame corresponding to the at least one reference frame of each filtered frame.

[0082] S605 : Perform time domain layer division on the image frames included in the image coding group to obtain M time domain layers.

[0083] S606 : Determine a first weight table corresponding to the image coding group according to M, and determine a first weight for each filtered frame according to the time domain layer where each filtered frame is located.

[0084] S607 : Determine second weights of the reference frames corresponding to each filtered frame according to the distance between each filtered frame and the corresponding reference frames and the number of reference frames corresponding to each filtered frame.

[0085] S608 : Process each filtered frame and the compensation frame corresponding to at least one reference frame of each filtered frame according to the first weight of each filtered frame and the second weights of each reference frame corresponding to each filtered frame to obtain a filtered image coding group.

[0086] S609: Perform encoding processing on the filtered image encoding group to obtain an encoding result of the video to be processed.

[0087] See Figure 7 , is a schematic diagram of another video encoding process disclosed in an embodiment of the present application, Figure 7 This is a flowchart for video encoding that focuses on compression efficiency. For the selection of filter frames, see Figure 4b , the choice of reference frame can be found in Figure 5b The video encoding method may include the following steps:

[0088] S701: Obtain an image coding group of a video to be processed.

[0089] S702: Use each image frame in the image coding group as a filtering frame to obtain at least one filtering frame.

[0090] S703: Determine at least one reference frame for each filtered frame from the image coding group.

[0091] S704 : Perform motion estimation and motion compensation processing based on each filtered frame and at least one reference frame of each filtered frame to obtain a compensated frame corresponding to the at least one reference frame of each filtered frame.

[0092] S705 : Perform time domain layer division on the image frames included in the image coding group to obtain M time domain layers.

[0093] S706 : Determine a first weight table corresponding to the image coding group according to M, and determine a first weight for each filtered frame according to the time domain layer where each filtered frame is located.

[0094] S707 : Determine second weights of the reference frames corresponding to each filtered frame according to the distance between each filtered frame and the corresponding reference frames and the number of reference frames corresponding to each filtered frame.

[0095] S708 : Process each filtered frame and the compensation frame corresponding to at least one reference frame of each filtered frame according to the first weight of each filtered frame and the second weights of each reference frame corresponding to each filtered frame to obtain a filtered image coding group.

[0096] S709 , performing encoding processing on the filtered image encoding group to obtain an encoding result of the video to be processed.

[0097] pass Figure 6 and Figure 7 It can be seen that this is for video encoding in two different scenarios. In different encoding scenarios, the method of determining the filter frame is different, and correspondingly, the method of determining the reference frame is also different. Therefore, through the video encoding method of the embodiment of the present application, the filter frame, filter frame and weight can be flexibly selected according to the encoding scenario indication information to implement time domain filtering, which can not only increase the video encoding speed, but also improve the video compression efficiency while meeting the video encoding speed, thereby reducing the bandwidth used for video transmission.

[0098] See Figure 8 , Figure 8 It is a structural diagram of a video encoding device provided in an embodiment of the present application. The video encoding device can be set in the computer device provided in an embodiment of the present application. The computer device can be the server 101 mentioned in the above method embodiment. Figure 8 The video encoding device shown may be a computer program (including program code) running in a computer device, and the video encoding device may be used to perform Figure 2 、 Figure 6 as well as Figure 7 Some or all of the steps in the method embodiment shown. Figure 8 , the video encoding device may include the following units:

[0099] An acquiring unit 801 is configured to acquire an image coding group and coding scene indication information of a video to be processed, and determine at least one filtered frame and at least one reference frame for each filtered frame from the image coding group according to the coding scene indication information;

[0100] a determining unit 802 configured to determine a first weight of each filtered frame according to the temporal layer in which each filtered frame is located, and determine a second weight of each reference frame corresponding to each filtered frame according to a positional relationship between each filtered frame and each corresponding reference frame;

[0101] a processing unit 803 configured to process each filtered frame and a compensated frame corresponding to at least one reference frame of each filtered frame according to the first weight of each filtered frame and the second weight of each reference frame corresponding to each filtered frame, to obtain a filtered image coding group, wherein the compensated frame corresponding to the at least one reference frame of each filtered frame is obtained by performing motion estimation and motion compensation on each filtered frame and the at least one reference frame of each filtered frame;

[0102] The processing unit 803 is further configured to perform encoding processing on the filtered image encoding group to obtain an encoding result of the video to be processed.

[0103] In a possible implementation, when the determining unit 802 determines at least one filtered frame and at least one reference frame of each filtered frame from the image coding group according to the coding scene indication information, it is specifically configured to perform the following steps:

[0104] Determining a target coding scene indicated by the coding scene indication information;

[0105] If the target encoding scenario is a coding speed-focused scenario, starting from the starting image frame of the image encoding group, a filtering frame is determined every preset number of image frames to obtain at least one filtering frame, where the preset number is less than 4;

[0106] At least one reference frame for each filtered frame is determined from the image coding group.

[0107] In a possible implementation, when the determining unit 802 determines at least one filtered frame and at least one reference frame of each filtered frame from the image coding group according to the coding scene indication information, it is further configured to perform the following steps:

[0108] If the target encoding scenario is a compression efficiency-focused scenario, each image frame in the image encoding group is used as a filtering frame to obtain at least one filtering frame.

[0109] In a possible implementation, when the determining unit 802 determines at least one reference frame for each filtered frame from the image coding group, it is specifically configured to perform the following steps:

[0110] Acquire image frames included in the image coding group, and perform time domain layer division on the image frames included in the image coding group to obtain M time domain layers, where M is determined by the number of image frames included in the image coding group;

[0111] Determine a first time domain layer at which each filtered frame is located from the M time domain layers;

[0112] At least one reference frame of each filtered frame is determined from the M time domain layers based on the first time domain layer where each filtered frame is located and a preset distance corresponding to each filtered frame.

[0113] In a possible implementation, when the determining unit 802 determines the first weight of each filtered frame according to the time domain layer in which each filtered frame in the at least one filtered frame is located, it is specifically configured to perform the following steps:

[0114] Obtaining the number of time domain layers corresponding to the image coding group;

[0115] Acquire a first weight table from at least one weight table according to the number of time domain layers;

[0116] The first weight of each filtered frame is determined from the first weight table according to the time domain layer where each filtered frame is located.

[0117] In a possible implementation, when the determining unit 802 determines the second weights of the reference frames corresponding to each filtered frame according to the positional relationship between each filtered frame and the corresponding reference frames, it is specifically configured to perform the following steps:

[0118] Obtaining a second weight table, wherein the second weight table includes weights corresponding to different distances and different numbers of reference frames;

[0119] Determining a first distance between each filtered frame and corresponding reference frames, and determining the number of reference frames corresponding to each filtered frame;

[0120] The second weight of each reference frame corresponding to each filtered frame is determined from the second weight table according to the first distance and the number of reference frames.

[0121] In a possible implementation, the processing unit 803 processes each filtered frame and the compensated frame corresponding to at least one reference frame of each filtered frame according to the first weight of each filtered frame and the second weights of the reference frames corresponding to each filtered frame, to obtain a filtered image coding group, specifically for performing the following steps:

[0122] Determining a target weight of each reference frame according to the first weight of each filtered frame and the second weight of each reference frame corresponding to each filtered frame;

[0123] Determine a first pixel value according to a pixel value of a compensation frame corresponding to the at least one reference frame and a target weight of each reference frame;

[0124] Normalization is performed on the pixel values of each filtered frame and the first pixel value to obtain a filtered image coding group.

[0125] According to another embodiment of the present application, Figure 8 The various units in the video encoding device shown can be individually or all combined into one or several other units to form, or one (or some) of the units can be further divided into multiple smaller units in function to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In actual applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the video encoding device can also include other units. In actual applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0126] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory (RAM), a read-only memory (ROM) and other processing elements and storage elements. Figure 2 、 Figure 6 as well as Figure 7 A computer program (including program code) for each step involved in part or all of the methods shown in the figure is used to construct a computer program (including program code) for each step involved in part or all of the methods shown in the figure. Figure 8 The video encoding device shown in and the video encoding method of the embodiment of the present application are implemented. The computer program can be recorded on, for example, a computer-readable storage medium, and loaded into the above-mentioned computing device through the computer-readable storage medium and run therein.

[0127] In an embodiment of the present application, an image coding group and coding scene indication information of a video to be processed are obtained, and at least one filter frame and at least one reference frame of each filter frame are determined from the image coding group based on the coding scene indication information; motion estimation and motion compensation are performed on each filter frame and at least one reference frame of each filter frame to obtain a compensation frame corresponding to at least one reference frame of each filter frame; a first weight of each filter frame is determined based on the temporal layer in which each filter frame is located, and a second weight of each reference frame corresponding to each filter frame is determined based on the positional relationship between each filter frame and each corresponding reference frame; then, each filter frame and the compensation frame corresponding to at least one reference frame of each filter frame are filtered based on the first weight of each filter frame and the second weight of each reference frame corresponding to each filter frame to obtain a filtered image coding group; finally, the filtered image coding group is encoded to obtain an encoding result of the video to be processed. In this process, the filter frame, filter frame, and weight can be flexibly selected based on the coding scene indication information to implement temporal filtering, which can not only improve the video encoding speed, but also improve the video compression efficiency while meeting the video encoding speed, thereby reducing the bandwidth used for video transmission.

[0128] Based on the above method and device embodiments, the present application embodiment provides a computer device, which may be the server 101 mentioned above. Figure 9 , Figure 9 It is a structural diagram of a computer device provided in an embodiment of the present application. Figure 9 The computer device shown includes at least a processor 901, an input interface 902, an output interface 903, and a computer-readable storage medium 904. The processor 901, the input interface 902, the output interface 903, and the computer-readable storage medium 904 may be connected via a bus or other means.

[0129] The computer-readable storage medium 904 can be stored in the memory of a computer device. The computer-readable storage medium 904 is used to store a computer program, which includes computer instructions. The processor 901 is used to execute the program instructions stored in the computer-readable storage medium 904. The processor 901 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device. It is suitable for implementing one or more computer instructions, and is specifically suitable for loading and executing one or more computer instructions to implement a corresponding method flow or corresponding function.

[0130] The embodiment of the present application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the computer device. In addition, one or more computer instructions suitable for being loaded and executed by the processor are also stored in the storage space. These computer instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.

[0131] In some embodiments, the processor 901 may load and execute one or more computer instructions stored in the computer-readable storage medium 904 to implement the above-mentioned Figure 2 、 Figure 6 as well as Figure 7 In a specific implementation, the computer instructions in the computer-readable storage medium 904 are loaded by the processor 901 and execute the following steps:

[0132] Obtaining an image coding group and coding scene indication information of a video to be processed, and determining at least one filtering frame and at least one reference frame of each filtering frame from the image coding group according to the coding scene indication information;

[0133] Determining a first weight of each filtered frame according to a temporal layer in which each filtered frame is located, and determining a second weight of each reference frame corresponding to each filtered frame according to a positional relationship between each filtered frame and each corresponding reference frame;

[0134] Processing each filtered frame and a compensated frame corresponding to at least one reference frame of each filtered frame according to the first weight of each filtered frame and the second weight of each reference frame corresponding to each filtered frame to obtain a filtered image coding group, wherein the compensated frame corresponding to the at least one reference frame of each filtered frame is obtained by performing motion estimation and motion compensation on each filtered frame and at least one reference frame of each filtered frame;

[0135] The filtered image coding group is coded to obtain a coding result of the video to be processed.

[0136] In a possible implementation, when the processor 901 determines at least one filtered frame and at least one reference frame of each filtered frame from the image coding group according to the coding scene indication information, it is specifically configured to perform the following steps:

[0137] Determining a target coding scene indicated by the coding scene indication information;

[0138] If the target encoding scenario is a coding speed-focused scenario, starting from the starting image frame of the image encoding group, a filtering frame is determined every preset number of image frames to obtain at least one filtering frame, where the preset number is less than 4;

[0139] At least one reference frame for each filtered frame is determined from the image coding group.

[0140] In a possible implementation, when the processor 901 determines at least one filtered frame and at least one reference frame of each filtered frame from the image coding group according to the coding scene indication information, it is further configured to perform the following steps:

[0141] If the target encoding scenario is a compression efficiency-focused scenario, each image frame in the image encoding group is used as a filtering frame to obtain at least one filtering frame.

[0142] In a possible implementation, when the processor 901 determines at least one reference frame for each filtered frame from the image coding group, it is specifically configured to perform the following steps:

[0143] Acquire image frames included in the image coding group, and perform time domain layer division on the image frames included in the image coding group to obtain M time domain layers, where M is determined by the number of image frames included in the image coding group;

[0144] Determine a first time domain layer at which each filtered frame is located from the M time domain layers;

[0145] At least one reference frame of each filtered frame is determined from the M time domain layers based on the first time domain layer where each filtered frame is located and a preset distance corresponding to each filtered frame.

[0146] In a possible implementation, when the processor 901 determines the first weight of each filtered frame according to the time domain layer in which each filtered frame in the at least one filtered frame is located, it is specifically configured to perform the following steps:

[0147] Obtaining the number of time domain layers corresponding to the image coding group;

[0148] Acquire a first weight table from at least one weight table according to the number of time domain layers;

[0149] The first weight of each filtered frame is determined from the first weight table according to the time domain layer where each filtered frame is located.

[0150] In a possible implementation, when the processor 901 determines the second weights of the reference frames corresponding to each filtered frame according to the positional relationship between each filtered frame and the corresponding reference frames, it is specifically configured to perform the following steps:

[0151] Obtaining a second weight table, wherein the second weight table includes weights corresponding to different distances and different numbers of reference frames;

[0152] Determining a first distance between each filtered frame and corresponding reference frames, and determining the number of reference frames corresponding to each filtered frame;

[0153] The second weight of each reference frame corresponding to each filtered frame is determined from the second weight table according to the first distance and the number of reference frames.

[0154] In a possible implementation, the processor 901 processes each filtered frame and the compensated frame corresponding to at least one reference frame of each filtered frame according to the first weight of each filtered frame and the second weights of the reference frames corresponding to each filtered frame, to obtain a filtered image coding group, specifically for performing the following steps:

[0155] Determining a target weight of each reference frame according to the first weight of each filtered frame and the second weight of each reference frame corresponding to each filtered frame;

[0156] Determine a first pixel value according to a pixel value of a compensation frame corresponding to the at least one reference frame and a target weight of each reference frame;

[0157] Normalization is performed on the pixel values of each filtered frame and the first pixel value to obtain a filtered image coding group.

[0158] In an embodiment of the present application, an image coding group and coding scene indication information of a video to be processed are obtained, and at least one filter frame and at least one reference frame of each filter frame are determined from the image coding group based on the coding scene indication information; motion estimation and motion compensation are performed on each filter frame and at least one reference frame of each filter frame to obtain a compensation frame corresponding to at least one reference frame of each filter frame; a first weight of each filter frame is determined based on the temporal layer in which each filter frame is located, and a second weight of each reference frame corresponding to each filter frame is determined based on the positional relationship between each filter frame and each corresponding reference frame; then, each filter frame and the compensation frame corresponding to at least one reference frame of each filter frame are filtered based on the first weight of each filter frame and the second weight of each reference frame corresponding to each filter frame to obtain a filtered image coding group; finally, the filtered image coding group is encoded to obtain an encoding result of the video to be processed. In this process, the filter frame, filter frame, and weight can be flexibly selected based on the coding scene indication information to implement temporal filtering, which can not only improve the video encoding speed, but also improve the video compression efficiency while meeting the video encoding speed, thereby reducing the bandwidth used for video transmission.

[0159] According to one aspect of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the video encoding method provided in any of the above-described optional embodiments.

[0160] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0161] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules described above is merely a logical functional division. In actual implementation, other division methods may be used. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not implemented.

[0162] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A video encoding method, characterized in that: The method comprises: Obtaining an image coding group and coding scene indication information of a video to be processed, and determining at least one filtering frame and at least one reference frame of each filtering frame from the image coding group according to the coding scene indication information; Determining a first weight of each filtered frame according to a temporal layer in which each filtered frame is located, and determining a second weight of each reference frame corresponding to each filtered frame according to a positional relationship between each filtered frame and each corresponding reference frame; processing each filtered frame and a compensated frame corresponding to at least one reference frame of each filtered frame according to the first weight of each filtered frame and the second weight of each reference frame corresponding to each filtered frame to obtain a filtered image coding group, wherein the compensated frame corresponding to the at least one reference frame of each filtered frame is obtained by performing motion estimation and motion compensation on each filtered frame and at least one reference frame of each filtered frame; The filtered image coding group is coded to obtain a coding result of the video to be processed.

2. The method according to claim 1, characterized in that The determining, from the image coding group according to the coding scene indication information, at least one filtering frame and at least one reference frame for each filtering frame comprises: Determining a target coding scene indicated by the coding scene indication information; If the target encoding scenario is a coding speed-focused scenario, starting from the starting image frame of the image encoding group, a filtering frame is determined every preset number of image frames to obtain at least one filtering frame, where the preset number is less than 4; At least one reference frame for each filtered frame is determined from the image coding group.

3. The method according to claim 2, characterized in that The determining, from the image coding group according to the coding scene indication information, at least one filtering frame and at least one reference frame for each filtering frame further comprises: If the target encoding scenario is a compression efficiency-focused scenario, each image frame in the image encoding group is used as a filtering frame to obtain at least one filtering frame.

4. The method according to claim 2, characterized in that The determining of at least one reference frame for each filtered frame from the image coding group comprises: Acquire image frames included in the image coding group, and perform time domain layer division on the image frames included in the image coding group to obtain M time domain layers, where M is determined by the number of image frames included in the image coding group; Determine a first time domain layer at which each filtered frame is located from the M time domain layers; At least one reference frame of each filtered frame is determined from the M time domain layers based on the first time domain layer where each filtered frame is located and a preset distance corresponding to each filtered frame.

5. The method according to any one of claims 1 to 4, characterized in that The determining, according to the time domain layer at which each of the at least one filtering frame is located, a first weight of each filtering frame comprises: Obtaining the number of time domain layers corresponding to the image coding group; Acquire a first weight table from at least one weight table according to the number of time domain layers; The first weight of each filtered frame is determined from the first weight table according to the time domain layer where each filtered frame is located.

6. The method according to any one of claims 1 to 4, characterized in that The determining, according to the positional relationship between each filtered frame and the corresponding reference frames, the second weights of the reference frames corresponding to each filtered frame includes: Obtaining a second weight table, wherein the second weight table includes weights corresponding to different distances and different numbers of reference frames; Determining a first distance between each filtered frame and corresponding reference frames, and determining the number of reference frames corresponding to each filtered frame; The second weight of each reference frame corresponding to each filtered frame is determined from the second weight table according to the first distance and the number of reference frames.

7. The method according to any one of claims 1 to 4, characterized in that The step of processing each filtered frame and the compensation frame corresponding to at least one reference frame of each filtered frame according to the first weight of each filtered frame and the second weight of each reference frame corresponding to each filtered frame to obtain a filtered image coding group includes: Determining a target weight of each reference frame according to the first weight of each filtered frame and the second weight of each reference frame corresponding to each filtered frame; Determine a first pixel value according to a pixel value of a compensation frame corresponding to the at least one reference frame and a target weight of each reference frame; Normalization is performed on the pixel values of each filtered frame and the first pixel value to obtain a filtered image coding group.

8. A video encoding device, characterized in that: The device comprises: an acquisition unit, configured to acquire an image coding group and coding scene indication information of a video to be processed, and determine at least one filtering frame and at least one reference frame of each filtering frame from the image coding group according to the coding scene indication information; a determining unit, configured to determine a first weight of each filtered frame according to a temporal layer in which each filtered frame is located, and determine a second weight of each reference frame corresponding to each filtered frame according to a positional relationship between each filtered frame and each corresponding reference frame; a processing unit, configured to process each filtered frame and a compensated frame corresponding to at least one reference frame of each filtered frame according to a first weight of each filtered frame and a second weight of each reference frame corresponding to each filtered frame, to obtain a filtered image coding group, wherein the compensated frame corresponding to at least one reference frame of each filtered frame is obtained by performing motion estimation and motion compensation on each filtered frame and at least one reference frame of each filtered frame; The processing unit is further configured to perform encoding processing on the filtered image encoding group to obtain an encoding result of the video to be processed.

9. A computer device, characterized in that: The computer device comprises: a processor adapted to execute one or more computer programs; and A computer storage medium storing one or more computer programs, wherein the one or more computer programs are suitable for being loaded by the processor and executing the video encoding method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores one or more computer programs, and the one or more computer programs are suitable for being loaded by a processor and executing the video encoding method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Multiple base layer reference pictures for SHVC

    CN105052139A

  • Time domain filtering method and device for video, storage medium and electronic equipment

    CN114302137A