Time domain filtering method and device based on video inter-frame difference, equipment and medium
By using a time domain filtering method based on video frame differences in the encoder to adjust the filtering intensity, the problem of time domain filtering performance loss is solved, and more efficient code stream compression is achieved.
Patent Information
- Application Number
- CN202510526396.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-04-25
AI Technical Summary
Time domain filtering in existing encoders will suffer performance losses in some scenarios, resulting in the problem of code stream rising instead of falling.
The time domain filtering method based on the difference between video frames is adopted. By obtaining the frames to be filtered and the reference frames, dividing them into video blocks, calculating the inter-frame difference, and determining the filter weight according to the difference threshold, and adjusting the intensity of the time domain filtering.
The time domain filtering capability is improved, the phenomenon of code stream rising instead of falling, and higher compression efficiency is achieved.
Smart Images

Figure CN120050419A_ABST
Abstract
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 inter-frame difference of videos. Background Art
[0002] Audio and video coding standards are technical specifications for compressing and encoding audio and video data, aiming to reduce the data volume 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, used to compress the original uncompressed video signal into a bitstream in 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 likely to be referenced is artificially specified before coding), the residual of the frame encoded with this image as a reference is reduced subsequently, 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 formal encoding, TF will filter frame A with frame B at a filtering strength, that is, fuse part of the information in frame B into frame A. In subsequent encoding, frame B will perform predictive coding with frame A as a reference. Since frame A already has some information of frame B at this time, the residual after predictive coding will be reduced, enabling higher compression efficiency in subsequent transformation, quantization, and entropy coding, that is, saving the bitstream. However, TF in current encoders has a problem of performance loss 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 inter-frame difference of videos, which can adjust the strength of temporal filtering according to the inter-frame difference, 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 scheme is as follows:
[0005] In the first aspect, the present application discloses a temporal filtering method based on the inter-frame difference of videos, 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 to obtain 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 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 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 corresponding relationship 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 a 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 divide the frame to be filtered and the reference frame into 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; the 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 those of ordinary skill in the art can also obtain other drawings 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. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. 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, time-domain filtering in an encoder may have a problem of performance loss in some scenarios, resulting in a phenomenon that the bitstream does not decrease but increases. To overcome the above technical problems, the present 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 the present 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 the frame to be filtered. The reference frame may be multiple frames. For example, use the 8 frames adjacent to the frame to be filtered (4 forward frames and 4 backward frames) as the reference frame. If some of the forward or backward frames do not exist, these frames will be ignored. And perform the same-scale division on the frame to be filtered and the reference frame to obtain video blocks. 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 first video block and the second video block have the same position in the frame; according to the absolute value of the pixel difference, obtaining the inter-frame difference of the first video block. By analogy, it is necessary to determine the inter-frame difference of each video block in the frame to be filtered. Specifically, the formula for calculating 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 encoding 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 above 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 a first parameter and the target bit depth; the target bit depth is the bit depth used 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 a 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 used 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 the inter-frame difference of video. 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 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;
[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 greater 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 by 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 regarded 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 the present 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 requirements, and no specific limitations are made here.
[0084] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a 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 may be temporary storage or permanent storage.
[0085] Among them, the operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222 to implement the operation and processing of a large amount of data 223 in the memory 22 by the processor 21, and it may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the time-domain filtering method based on video frame difference executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks.
[0086] Furthermore, an embodiment of the present application also discloses a computer storage medium. The computer storage medium stores computer-executable instructions, and 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 combination with the embodiments disclosed herein can be directly implemented by 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 text, 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 such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant 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 inter-frame differences of video 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 and its core idea of the present invention; 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 temporal filtering method based on video frame difference, characterized in that: include: 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; 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 to-be-filtered frame 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 a corresponding video block in the frame to be filtered based on the filtering weight.
2. The temporal filtering method based on video frame difference according to claim 1, characterized in that: Determining the inter-frame difference corresponding to each video block in the frame to be filtered includes: Calculating a pixel difference between an average pixel value of a first video block in the frame to be filtered and an average pixel value of a second video block in the reference frame; the first video block and the second video block are located at the same position in the frame; An inter-frame difference of the first video block is obtained according to the absolute value of the pixel difference.
3. The temporal filtering method based on video frame difference according to claim 1, characterized in that: Determining a filtering weight corresponding to the inter-frame difference includes: The filtering weight corresponding to the inter-frame difference is determined by querying the correspondence between the inter-frame difference and the filtering weight that is pre-constructed based on the difference threshold.
4. The temporal filtering method based on video frame difference according to claim 3, characterized in that: Determining a filtering weight corresponding to the inter-frame difference includes: If the inter-frame difference is less than the difference threshold of the target multiple, the filter weight is configured to be 1; the target multiple is less than 1; If the inter-frame difference is greater than the difference threshold, configuring the filter weight to be 0; If the inter-frame difference is greater than the target multiple difference threshold and less than the difference threshold, the filter weight corresponding to the inter-frame difference is determined according to a filter weight calculation formula; the filter 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 filter weight.
5. The temporal filtering method based on video frame difference according to claim 1, characterized in that: The inter-frame difference includes one or more of a first inter-frame difference under a luminance channel, a second inter-frame difference under a first chrominance channel, and a third inter-frame difference under 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.
6. The temporal filtering method based on video frame difference according to claim 5, characterized in that: Determining a 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 brightness channel threshold; the brightness channel threshold is determined based on the first parameter and a target bit depth; the target bit depth is a bit depth used 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 a chroma channel threshold; and the chroma channel threshold is determined based on a second parameter and the target bit depth.
7. The temporal filtering method based on video frame difference according to any one of claims 1 to 6, characterized in that: Performing time domain filtering on the corresponding video block in the to-be-filtered frame based on the filtering weights includes: A final filtering strength is obtained based on the filtering weight and the original filtering strength, and the final filtering strength is used to perform time domain filtering on the corresponding video block in the frame to be filtered.
8. A temporal filtering device based on video frame difference, characterized in that: include: A frame acquisition module, used 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, used 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 to-be-filtered frame and the reference frame; The filtering module is used to determine the filtering weight corresponding to the inter-frame difference according to the difference threshold, and perform time-domain filtering on the corresponding video block in the frame to be filtered based on the filtering weight.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the time domain filtering method based on video frame difference according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein when the computer programs are executed by a processor, the time domain filtering method based on video frame differences as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image noise reduction method and device, filtering data processing method and device and computer equipment
CN115131229A
Method and apparatus for video filtering
CN115336270A
Apparatus and method for improving video encoding
EP4418651A1
Summed signal strength based reference signal filtering
US20190109733A1
Video encoder
WO2016114788A1
Cited By
Image filtering processing method and system, storage medium and electronic equipment
CN120355582A
Image filtering processing method, system, storage medium and electronic device
CN120355582B