Time-domain Filtering Method, Device, Equipment and Medium Based on Inter-frame Difference of Video

By adjusting temporal filtering strength based on frame differences, the method optimizes video encoding to prevent code stream size increases and enhance filtering efficiency.

CN120050419BActive Publication Date: 2025-07-15MALANSHAN AUDIO & VIDEO LABORATORY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510526396.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-07-15
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

Time domain filtering in existing video encoders suffers performance losses in some scenarios, resulting in the problem of code stream rising instead of falling.

Method used

By obtaining the video blocks of the frame to be filtered and the reference frame, compute the inter-frame difference, determine the filter weight according to the difference threshold, adjust the intensity of the time domain filtering, and perform time domain filtering of the filtered frame with a suitable filtering intensity.

Benefits of technology

The time domain filtering capability is improved, the phenomenon of code stream rising instead of falling, and the encoding efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050419B_ABST
    Figure CN120050419B_ABST
Patent Text Reader

Abstract

The present application discloses a temporal filtering method, apparatus, device and medium based on inter-frame differences of video, which relates to the technical field of video coding. The method includes: obtaining a frame to be filtered and a reference frame corresponding to the frame to be filtered, and partitioning the frame to be filtered and the reference frame to obtain video blocks; determining the inter-frame difference corresponding to each video block in the frame to be filtered; the inter-frame difference is the difference between two video blocks at the same position in the frame to be filtered and the reference frame; determining the filtering weight corresponding to the inter-frame difference according to a difference threshold, and performing temporal filtering on the corresponding video blocks in the frame to be filtered based on the filtering weight. It can be seen that by combining the inter-frame difference to determine the filtering weight, the intensity of temporal filtering can be adjusted according to the inter-frame difference, so as to perform temporal filtering on the frame to be filtered with an appropriate filtering intensity, improve the ability of temporal filtering, and avoid the phenomenon that the bitstream does not decrease but increases instead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video coding, and particularly relates to a temporal filtering method, device, equipment and medium based on the difference between video frames. Background Technique

[0002] Audio and video coding standards are technical specifications for compressing and encoding audio and video data, aiming to reduce the amount of data for storage and transmission while ensuring a certain quality. Common audio and video coding standards include AVS3 (AudioVideo Standard 3, the third-generation audio and video coding standard), H.265 / HEVC, H.266 / VVC, etc. An audio and video encoder is a software or hardware tool that implements the video compression algorithm of an audio and video coding standard, and is used to compress the original uncompressed video signal into a bitstream of a specific format for storage or transmission.

[0003] Temporal filtering (TF for short) is a common tool in various encoders. By filtering the image that is more likely to be referenced in inter-frame coding in the temporal domain (note: whether a certain frame is easy to be referenced is specified artificially before coding), the residual of the frame encoded with this image as a reference is reduced later, so as to achieve the purpose of saving bitrate. For example, there is a sequence of two frames to be encoded, the first frame is A and the second frame is B. Then in the encoding process, frame B will be encoded with frame A as a reference. Before the formal encoding, TF will filter frame A with frame B at a filtering strength, that is, part of the information in frame B is fused into frame A. In the subsequent encoding, frame B will be predicted and encoded with frame A as a reference. Since frame A already has some information of frame B at this time, the residual remaining after the predictive coding will be reduced, so that higher compression efficiency can be achieved in the subsequent transformation, quantization, and entropy coding, that is, saving the bitstream. However, TF in the current encoder will have performance loss problems in some scenarios, and the phenomenon that the bitstream does not decrease but increases occurs. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a temporal filtering method, device, equipment and medium based on the difference between video frames, which can adjust the strength of temporal filtering according to the difference between frames, so as to perform temporal filtering on the frame to be filtered with an appropriate filtering strength and improve the ability of temporal filtering. The specific solutions are as follows:

[0005] In the first aspect, the present application discloses a temporal filtering method based on the difference between video frames, including:

[0006] Obtain the frame to be filtered and the reference frame corresponding to the frame to be filtered, and divide the frame to be filtered and the reference frame into video blocks;

[0007] Determine the inter-frame difference corresponding to each video block in the frame to be filtered; the inter-frame difference is the difference between two video blocks at the same position in the frame to be filtered and the reference frame;

[0008] Determine the filtering weight corresponding to the inter-frame difference according to the difference threshold, and perform temporal filtering on the corresponding video block in the frame to be filtered based on the filtering weight.

[0009] Optionally, the determining the inter-frame difference corresponding to each video block in the frame to be filtered includes:

[0010] Calculate the pixel difference between the pixel average value of the first video block in the frame to be filtered and the pixel average value of the second video block in the reference frame; the first video block and the second video block are at the same position in the frame;

[0011] Obtain the inter-frame difference of the first video block according to the absolute value of the pixel difference.

[0012] Optionally, the determining the filtering weight corresponding to the inter-frame difference includes:

[0013] Determine the filtering weight corresponding to the inter-frame difference by querying the correspondence between the inter-frame difference and the filtering weight pre-constructed based on the difference threshold.

[0014] Optionally, the determining the filtering weight corresponding to the inter-frame difference includes:

[0015] If the inter-frame difference is less than the difference threshold of the target multiple, configure the filtering weight to be 1; the target multiple is less than 1;

[0016] If the inter-frame difference is greater than the difference threshold, configure the filtering weight to be 0;

[0017] If the inter-frame difference is greater than the difference threshold of the target multiple and less than the difference threshold, determine the filtering weight corresponding to the inter-frame difference according to the filtering weight calculation formula; the filtering weight calculation formula is constructed based on the inter-frame difference and the difference threshold, and the larger the ratio of the inter-frame difference to the difference threshold, the smaller the filtering weight.

[0018] Optionally, the inter-frame difference includes one or more of the first inter-frame difference in the luminance channel, the second inter-frame difference in the first chrominance channel, and the third inter-frame difference in the second chrominance channel;

[0019] The first inter-frame difference is the difference between two video blocks at the same position in the luminance channel frame of the frame to be filtered and the luminance channel frame of the reference frame; the second inter-frame difference is the difference between two video blocks at the same position in the first chrominance channel frame of the frame to be filtered and the first chrominance channel frame of the reference frame; the third inter-frame difference is the difference between two video blocks at the same position in the second chrominance channel frame of the frame to be filtered and the second chrominance channel frame of the reference frame.

[0020] Optionally, determining the filtering weight corresponding to the inter-frame difference according to the difference threshold includes:

[0021] If the inter-frame difference is the first inter-frame difference, the difference threshold is the luminance channel threshold; the luminance channel threshold is determined based on a first parameter and the target bit depth; the target bit depth is the bit depth used by the encoder when performing image encoding;

[0022] If the inter-frame difference is the second inter-frame difference or the third inter-frame difference, the difference threshold is the chrominance channel threshold; the chrominance channel threshold is determined based on a second parameter and the target bit depth.

[0023] Optionally, performing temporal filtering on the corresponding video block in the frame to be filtered based on the filtering weight includes:

[0024] Obtaining a final filtering intensity based on the filtering weight and the original filtering intensity, and performing temporal filtering on the corresponding video block in the frame to be filtered by using the final filtering intensity.

[0025] In a second aspect, the present application discloses a temporal filtering device based on video inter-frame differences, including:

[0026] A frame acquisition module, configured to acquire a frame to be filtered and a reference frame corresponding to the frame to be filtered, and partition the frame to be filtered and the reference frame to obtain video blocks;

[0027] An inter-frame difference determination module, configured to determine the inter-frame difference corresponding to each video block in the frame to be filtered; the inter-frame difference is the difference between two video blocks at the same position in the frame to be filtered and the reference frame;

[0028] A filtering module, configured to determine the filtering weight corresponding to the inter-frame difference according to the difference threshold, and perform temporal filtering on the corresponding video block in the frame to be filtered based on the filtering weight.

[0029] In a third aspect, the present application discloses an electronic device, including:

[0030] A memory, configured to store a computer program;

[0031] A processor for executing the computer program to implement the foregoing time-domain filtering method based on the difference between video frames.

[0032] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein when the computer program is executed by a processor, the foregoing time-domain filtering method based on the difference between video frames is implemented.

[0033] In the present application, a frame to be filtered and a reference frame corresponding to the frame to be filtered are obtained, and the frame to be filtered and the reference frame are divided into video blocks; the inter-frame difference corresponding to each video block in the frame to be filtered is determined; the inter-frame difference is the difference between two video blocks at the same position in the frame to be filtered and the reference frame; a filtering weight corresponding to the inter-frame difference is determined according to a difference threshold, and time-domain filtering is performed on the corresponding video blocks in the frame to be filtered based on the filtering weight. It can be seen that by determining the filtering weight in combination with the inter-frame difference, the intensity of time-domain filtering can be adjusted according to the inter-frame difference, so as to perform time-domain filtering on the frame to be filtered with an appropriate filtering intensity, improve the ability of time-domain filtering, and avoid the phenomenon that the bitstream does not decrease but increases instead. Description of the Drawings

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0035] Figure 1 It is a flowchart of a time-domain filtering method based on the difference between video frames provided by the present application;

[0036] Figure 2 It is a flowchart of a specific time-domain filtering method based on the difference between video frames provided by the present application;

[0037] Figure 3 It is a schematic structural diagram of a time-domain filtering device based on the difference between video frames provided by the present application;

[0038] Figure 4 It is a structural diagram of an electronic device provided by the present application. Detailed Embodiments

[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0040] In the prior art, in some scenarios, the time-domain filtering in an encoder may have the problem of performance loss, resulting in the phenomenon that the code stream does not decrease but increases. To overcome the above technical problems, this application proposes a time-domain filtering method based on the inter-frame difference of video, which can adjust the intensity of time-domain filtering according to the inter-frame difference, so as to perform time-domain filtering on the frame to be filtered with an appropriate filtering intensity and improve the ability of time-domain filtering.

[0041] An embodiment of this application discloses a time-domain filtering method based on the inter-frame difference of video. Refer to Figure 1 As shown, the method may include the following steps:

[0042] Step S11: Obtain the frame to be filtered and the reference frame corresponding to the frame to be filtered, and divide the frame to be filtered and the reference frame to obtain video blocks.

[0043] Obtain a frame to be filtered and the reference frame corresponding to it. The reference frame can be multiple frames. For example, use the 8 adjacent frames (4 forward frames and 4 backward frames) of the frame to be filtered as the reference frame. If some of the forward or backward frames do not exist, these frames will be ignored. And divide the frame to be filtered and the reference frame into video blocks of the same scale. For example, divide the frame to be filtered and the reference frame into 8x8 small blocks.

[0044] Step S12: Determine the inter-frame difference corresponding to each video block in the frame to be filtered; the inter-frame difference is the difference between two video blocks at the same position in the frame to be filtered and the reference frame.

[0045] For each video block in the frame to be filtered, its corresponding inter-frame difference needs to be calculated. The inter-frame difference is the difference between two video blocks at the same position in the frame to be filtered and the reference frame. That is to say, it is necessary to sequentially determine the difference between two video blocks at the same position in the frame to be filtered and the first reference frame, the difference between two video blocks at the same position in the frame to be filtered and the second reference frame, until all reference frames are traversed.

[0046] Specifically, determining the inter-frame difference corresponding to each video block in the frame to be filtered includes: calculating the pixel difference between the average pixel value of the first video block in the frame to be filtered and the average pixel value of the second video block in the reference frame; the positions of the first video block and the second video block in the frame are the same; according to the absolute value of the pixel difference, the inter-frame difference of the first video block is obtained. By analogy, it is necessary to determine the inter-frame difference of each video block in the frame to be filtered. Specifically, the calculation formula for the inter-frame difference (BLOCK_DIFF) is:

[0047] BLOCK_DIFF = abs(AVG(cur_block_pixel_value) - AVG(ref_block_pixel_value)); where abs represents taking the absolute value, AVG represents the average value, AVG(cur_block_pixel_value) represents the average pixel value of the first video block in the frame to be filtered, and AVG(ref_block_pixel_value) represents the average pixel value of the second video block in the reference frame. The obtained inter-frame difference is the mean difference between the block in the frame to be filtered and the corresponding block in the reference frame.

[0048] Step S13: Determine the filtering weight corresponding to the inter-frame difference according to the difference threshold, and perform temporal filtering on the corresponding video block in the frame to be filtered based on the filtering weight.

[0049] After determining the inter-frame difference, determine the filtering weight corresponding to the inter-frame difference according to the difference threshold (BLOCK_THR), so as to perform temporal filtering on the corresponding video block in the frame to be filtered based on the filtering weight. Specifically, to determine the filtering weight corresponding to the inter-frame difference, the corresponding relationship between the inter-frame difference and the filtering weight pre-constructed based on the difference threshold can be queried to determine the filtering weight corresponding to the inter-frame difference.

[0050] In some embodiments, determining the filtering weight corresponding to the inter-frame difference may include: if the inter-frame difference is less than the difference threshold of the target multiple, configure the filtering weight to be 1; the target multiple is less than 1; if the inter-frame difference is greater than the difference threshold, configure the filtering weight to be 0; if the inter-frame difference is greater than the difference threshold of the target multiple and less than the difference threshold, determine the filtering weight corresponding to the inter-frame difference according to the filtering weight calculation formula; the filtering weight calculation formula is constructed based on the inter-frame difference and the difference threshold, and the larger the ratio of the inter-frame difference to the difference threshold, the smaller the filtering weight. Thus, the filtering weight is adjusted using the inter-frame difference degree, reducing the filtering intensity until turning off the filtering when the difference degree is too large, and increasing the filtering intensity when the difference degree is small, thereby avoiding the problem of large performance loss in temporal filtering in some scenarios.

[0051] For exampleFigure 2 As shown, if BLOCK_DIFF > BLOCK_THR, then set the filtering weight PRE_WEIGHT to 0; if , then set PRE_WEIGHT to 1. Otherwise, calculate PRE_WEIGHT using the following formula:

[0052] ; where exp() represents the exponential function with the real number e as the base.

[0053] In some embodiments, the performing temporal filtering on the corresponding video block in the frame to be filtered based on the filtering weight may include: obtaining a final filtering intensity based on the filtering weight and the original filtering intensity, and performing temporal filtering on the corresponding video block in the frame to be filtered using the final filtering intensity. For example, obtain the final filtering intensity according to the product of the filtering weight and the original filtering intensity, perform temporal filtering on the corresponding video block in the frame to be filtered using the final filtering intensity. The original filtering intensity refers to the filtering intensity adopted by existing encoders in various coding standards during temporal filtering, to obtain the filtered frame corresponding to the frame to be filtered, replace the finally obtained filtered frame at the position where the frame to be filtered is located, and enter the formal coding process.

[0054] In some embodiments, the frame to be filtered and the reference frame are YUV (luminance, chrominance) format data, that is, one frame contains 3 channels: Y channel (luminance channel), U channel (first chrominance channel), and V channel (second chrominance channel). The operations of steps S12 and S13 above can be performed for each channel.

[0055] Specifically, the inter-frame difference includes one or more of the first inter-frame difference in the luminance channel, the second inter-frame difference in the first chrominance channel, and the third inter-frame difference in the second chrominance channel; the first inter-frame difference is the difference between two video blocks at the same position in the luminance channel frame of the frame to be filtered and the luminance channel frame of the reference frame; the second inter-frame difference is the difference between two video blocks at the same position in the first chrominance channel frame of the frame to be filtered and the first chrominance channel frame of the reference frame; the third inter-frame difference is the difference between two video blocks at the same position in the second chrominance channel frame of the frame to be filtered and the second chrominance channel frame of the reference frame.

[0056] Correspondingly, determining the filtering weight corresponding to the inter-frame difference according to the difference threshold includes: if the inter-frame difference is the first inter-frame difference, the difference threshold is the luminance channel threshold; the luminance channel threshold is determined based on the first parameter and the target bit depth; the target bit depth is the bit depth adopted by the encoder when performing image encoding; if the inter-frame difference is the second inter-frame difference or the third inter-frame difference, the difference threshold is the chrominance channel threshold; the chrominance channel threshold is determined based on the second parameter and the target bit depth.

[0057] For example, for the Y channel, the calculation formula for the luminance channel threshold is:

[0058] ; where internal_bit_depth is the bit depth adopted by the encoder when performing image encoding; for the U and V channels, the calculation formula for the chrominance channel threshold is:

[0059] .

[0060] Correspondingly, determining the filtering weight corresponding to the inter-frame difference according to the difference threshold and performing temporal filtering on the corresponding video block in the frame to be filtered based on the filtering weight includes: if the inter-frame difference is the first inter-frame difference, determining the first filtering weight corresponding to the first inter-frame difference according to the luminance channel threshold, and performing temporal filtering on the corresponding video block in the frame to be filtered in the luminance channel based on the first filtering weight. If the inter-frame difference is the second inter-frame difference, determining the second filtering weight corresponding to the second inter-frame difference according to the chrominance channel threshold, and performing temporal filtering on the corresponding video block in the frame to be filtered in the first chrominance channel based on the second filtering weight. If the inter-frame difference is the third inter-frame difference, determining the third filtering weight corresponding to the third inter-frame difference according to the chrominance channel threshold, and performing temporal filtering on the corresponding video block in the frame to be filtered in the second chrominance channel based on the third filtering weight.

[0061] As can be seen from the above, in this embodiment, the frame to be filtered and the reference frame corresponding to the frame to be filtered are obtained, and the video blocks are obtained by dividing the frame to be filtered and the reference frame; the inter-frame difference corresponding to each video block in the frame to be filtered is determined; the inter-frame difference is the difference between two video blocks at the same position in the frame to be filtered and the reference frame; the filtering weight corresponding to the inter-frame difference is determined according to the difference threshold, and temporal filtering is performed on the corresponding video block in the frame to be filtered based on the filtering weight. It can be seen that by combining the inter-frame difference to determine the filtering weight, the intensity of temporal filtering can be adjusted according to the inter-frame difference, so as to perform temporal filtering on the frame to be filtered with an appropriate filtering intensity, improve the ability of temporal filtering, and avoid the phenomenon that the bitstream does not decrease but increases instead.

[0062] Correspondingly, an embodiment of the present application also discloses a time-domain filtering device based on inter-frame difference of video frames. Refer to Figure 3 as shown. The device includes:

[0063] A frame acquisition module 11, configured to acquire a frame to be filtered and a reference frame corresponding to the frame to be filtered, and divide the frame to be filtered and the reference frame to obtain video blocks;

[0064] An inter-frame difference determination module 12, configured to determine the inter-frame difference corresponding to each video block in the frame to be filtered; the inter-frame difference is the difference between two video blocks at the same position in the frame to be filtered and the reference frame;

[0065] A filtering module 13, configured to determine a filtering weight corresponding to the inter-frame difference according to a difference threshold, and perform time-domain filtering on the corresponding video block in the frame to be filtered based on the filtering weight.

[0066] As can be seen from the above, in this embodiment, a frame to be filtered and a reference frame corresponding to the frame to be filtered are acquired, and the frame to be filtered and the reference frame are divided to obtain video blocks; the inter-frame difference corresponding to each video block in the frame to be filtered is determined; the inter-frame difference is the difference between two video blocks at the same position in the frame to be filtered and the reference frame; a filtering weight corresponding to the inter-frame difference is determined according to a difference threshold, and time-domain filtering is performed on the corresponding video block in the frame to be filtered based on the filtering weight. It can be seen that by combining the inter-frame difference to determine the filtering weight, the intensity of time-domain filtering can be adjusted according to the inter-frame difference, so as to perform time-domain filtering on the frame to be filtered with an appropriate filtering intensity, improve the ability of time-domain filtering, and avoid the phenomenon that the bitstream does not decrease but increases instead.

[0067] In some specific embodiments, the inter-frame difference determination module 12 may specifically include:

[0068] A pixel difference calculation unit, configured to calculate the pixel difference between the pixel average value of the first video block in the frame to be filtered and the pixel average value of the second video block in the reference frame; the first video block and the second video block are at the same position in the frame;

[0069] An inter-frame difference determination unit, configured to obtain the inter-frame difference of the first video block according to the absolute value of the pixel difference.

[0070] In some specific embodiments, the filtering module 13 may specifically include:

[0071] A filtering weight determination unit, configured to determine the filtering weight corresponding to the inter-frame difference by querying the corresponding relationship between the inter-frame difference and the filtering weight pre-constructed based on the difference threshold.

[0072] In some specific embodiments, the filtering module 13 may specifically include:

[0073] A first configuration unit, configured to configure the filtering weight as 1 if the inter-frame difference is less than a difference threshold of a target multiple; the target multiple is less than 1;

[0074] A second configuration unit, configured to configure the filtering weight as 0 if the inter-frame difference is greater than the difference threshold;

[0075] A third configuration unit, configured to determine the filtering weight corresponding to the inter-frame difference according to a filtering weight calculation formula if the inter-frame difference is greater than the difference threshold of the target multiple and less than the difference threshold; the filtering weight calculation formula is constructed based on the inter-frame difference and the difference threshold, and the larger the ratio of the inter-frame difference to the difference threshold, the smaller the filtering weight.

[0076] In some specific embodiments, the inter-frame difference includes one or more of a first inter-frame difference in a luminance channel, a second inter-frame difference in a first chrominance channel, and a third inter-frame difference in a second chrominance channel;

[0077] The first inter-frame difference is the difference between two video blocks at the same position in the luminance channel frame of the frame to be filtered and the luminance channel frame of the reference frame; the second inter-frame difference is the difference between two video blocks at the same position in the first chrominance channel frame of the frame to be filtered and the first chrominance channel frame of the reference frame; the third inter-frame difference is the difference between two video blocks at the same position in the second chrominance channel frame of the frame to be filtered and the second chrominance channel frame of the reference frame.

[0078] In some specific embodiments, if the inter-frame difference is the first inter-frame difference, the difference threshold is a luminance channel threshold; the luminance channel threshold is determined based on a first parameter and a target bit depth; the target bit depth is the bit depth used by the encoder to perform image encoding; if the inter-frame difference is the second inter-frame difference or the third inter-frame difference, the difference threshold is a chrominance channel threshold; the chrominance channel threshold is determined based on a second parameter and the target bit depth.

[0079] In some specific embodiments, the filtering module 13 may specifically include:

[0080] A final filtering intensity determination unit, configured to obtain a final filtering intensity based on the filtering weight and the original filtering intensity, and perform temporal filtering on the corresponding video block in the frame to be filtered using the final filtering intensity.

[0081] Furthermore, an embodiment of the present application also discloses an electronic device. Refer to Figure 4As shown, the content in the figure should not be considered as any limitation on the scope of use of this application.

[0082] Figure 4 FIG. 4 is a schematic structural diagram of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the time-domain filtering method based on video frame difference disclosed in any of the foregoing embodiments.

[0083] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of this application, and specific limitations are not imposed here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and specific limitations are not imposed here.

[0084] In addition, as a carrier for resource storage, the memory 22 can be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon include an operating system 221, a computer program 222, and data 223 including frame differences, etc., and the storage method can be temporary storage or permanent storage.

[0085] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20 to implement the operation and processing of the massive data 223 in the memory 22 by the processor 21, and it can be Windows Server, Netware, Unix, Linux, etc. The computer program 222 may further include a computer program capable of completing other specific tasks in addition to the computer program capable of implementing the time-domain filtering method based on video frame difference executed by the electronic device 20 disclosed in any of the foregoing embodiments.

[0086] Furthermore, an embodiment of the present application also discloses a computer storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the steps of the time-domain filtering method based on video frame difference disclosed in any of the foregoing embodiments are implemented.

[0087] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.

[0088] The steps of the methods or algorithms described in connection with the embodiments disclosed herein can be implemented directly in hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0089] Finally, it should also be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.

[0090] The above has introduced in detail a time-domain filtering method, device, equipment and medium based on video inter-frame difference provided by the present invention. Specific examples are used herein to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A time-domain filtering method based on the difference between video frames, characterized in that, Including: Obtain a frame to be filtered and a reference frame corresponding to the frame to be filtered, and divide the frame to be filtered and the reference frame to obtain video blocks; Determine the inter-frame difference corresponding to each video block in the frame to be filtered; The inter-frame difference is the difference between two video blocks at the same position in the frame to be filtered and the reference frame; Determine the filtering weight corresponding to the inter-frame difference according to a difference threshold, and perform temporal filtering on the corresponding video blocks in the frame to be filtered based on the filtering weight; Wherein, the inter-frame difference includes one or more of a first inter-frame difference in the luminance channel, a second inter-frame difference in a first chrominance channel, and a third inter-frame difference in a second chrominance channel; the first inter-frame difference is the difference between two video blocks at the same position in the luminance channel frame of the frame to be filtered and the luminance channel frame of the reference frame; the second inter-frame difference is the difference between two video blocks at the same position in the first chrominance channel frame of the frame to be filtered and the first chrominance channel frame of the reference frame; the third inter-frame difference is the difference between two video blocks at the same position in the second chrominance channel frame of the frame to be filtered and the second chrominance channel frame of the reference frame; Wherein, determining the filtering weight corresponding to the inter-frame difference according to a difference threshold includes: If the inter-frame difference is the first inter-frame difference, the difference threshold is a luminance channel threshold; the luminance channel threshold is determined based on a first parameter and a target bit depth; the target bit depth is the bit depth used when the encoder performs image encoding; If the inter-frame difference is the second inter-frame difference or the third inter-frame difference, the difference threshold is a chrominance channel threshold; the chrominance channel threshold is determined based on a second parameter and the target bit depth.

2. The time-domain filtering method based on the difference between video frames according to claim 1, characterized in that Determining the inter-frame difference corresponding to each video block in the frame to be filtered includes: Calculate the pixel difference between the pixel average value of a first video block in the frame to be filtered and the pixel average value of a second video block in the reference frame; the first video block and the second video block are at the same position in the frame; Obtain the inter-frame difference of the first video block according to the absolute value of the pixel difference.

3. The time domain filtering method based on the inter-frame difference of video frames according to claim 1, characterized in that Determining the filtering weight corresponding to the inter-frame difference includes: Determine the filtering weight corresponding to the inter-frame difference by querying the corresponding relationship between the inter-frame difference and the filtering weight constructed in advance based on the difference threshold.

4. The time-domain filtering method based on inter-frame differences of video frames according to claim 3, wherein, Determining the filtering weight corresponding to the inter-frame difference includes: If the inter-frame difference is less than a difference threshold of a target multiple, configure the filtering weight to be 1; the target multiple is less than 1; If the inter-frame difference is greater than the difference threshold, configure the filtering weight to be 0; If the inter-frame difference is greater than the difference threshold of the target multiple and less than the difference threshold, determine the filtering weight corresponding to the inter-frame difference according to a filtering weight calculation formula; the filtering weight calculation formula is constructed based on the inter-frame difference and the difference threshold, and the larger the ratio of the inter-frame difference to the difference threshold, the smaller the filtering weight.

5. The time-domain filtering method based on the inter-frame difference of video frames according to any one of claims 1 to 4, characterized in that, Performing temporal filtering on the corresponding video blocks in the frame to be filtered based on the filtering weight includes: Obtain the final filtering strength based on the filtering weight and the original filtering strength, and perform temporal filtering on the corresponding video block in the frame to be filtered by using the final filtering strength.

6. A time-domain filtering device based on inter-frame differences of video frames, characterized in that, It includes: A frame acquisition module, configured to acquire a frame to be filtered and a reference frame corresponding to the frame to be filtered, and divide the frame to be filtered and the reference frame to obtain video blocks; An inter-frame difference determination module, configured to determine the inter-frame difference corresponding to each video block in the frame to be filtered; The inter-frame difference is the difference between two video blocks at the same position in the frame to be filtered and the reference frame; A filtering module, configured to determine the filtering weight corresponding to the inter-frame difference according to a difference threshold, and perform temporal filtering on the corresponding video block in the frame to be filtered based on the filtering weight; Wherein, the inter-frame difference includes one or more of a first inter-frame difference in the luminance channel, a second inter-frame difference in a first chrominance channel, and a third inter-frame difference in a second chrominance channel; the first inter-frame difference is the difference between two video blocks at the same position in the luminance channel frame of the frame to be filtered and the luminance channel frame of the reference frame; the second inter-frame difference is the difference between two video blocks at the same position in the first chrominance channel frame of the frame to be filtered and the first chrominance channel frame of the reference frame; the third inter-frame difference is the difference between two video blocks at the same position in the second chrominance channel frame of the frame to be filtered and the second chrominance channel frame of the reference frame; Wherein, the filtering module is configured to, if the inter-frame difference is the first inter-frame difference, the difference threshold is a luminance channel threshold; the luminance channel threshold is determined based on a first parameter and a target bit depth; the target bit depth is the bit depth used by the encoder to perform image encoding; if the inter-frame difference is the second inter-frame difference or the third inter-frame difference, the difference threshold is a chrominance channel threshold; the chrominance channel threshold is determined based on a second parameter and the target bit depth.

7. An electronic device, characterized in that, It includes: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the temporal filtering method based on video inter-frame difference according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, For storing a computer program; wherein the computer program, when executed by a processor, implements the temporal filtering method based on video inter-frame difference according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image noise reduction method and device, filtering data processing method and device and computer equipment

    CN115131229A