Video filtering method and device, electronic equipment and computer program product
By adjusting the bit weight according to the reference frame number, filter distortion and compression distortion of the video frame in video encoding, the inconsistency problem of code rate control and encoded video introduced by MCTF is solved, and the encoding efficiency is improved.
Patent Information
- Application Number
- CN202411814212.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-25
AI Technical Summary
The inconsistency of bit rate control and real-coded videos caused by the introduction of motion compensation time domain filtering (MCTF), which leads to inaccurate bit weight factor.
By obtaining the reference frame number, filter distortion and compression distortion of the video frame to be processed, the frame bit weight and the unit bit weight of the encoding unit are determined respectively for use in the second filtering process of the video.
The optimization and adjustment of the bit weight of the video frame to be processed is realized, and the weight factor error introduced by the filtering operation is corrected, and the compression efficiency of video encoding is improved.
Smart Images

Figure CN119697365A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of video coding technology, and in particular to a video filtering method, a video filtering device, an electronic device and a computer program product. Background Art
[0002] Motion Compensated Temporal Filter (MCTF) and Adaptive Loop Filter (ALF) are two filtering algorithms widely used by many coding standards, such as High Efficiency Video Coding (HEVC) standard, Versatile Video Coding (VVC) standard, Audio Video Coding Standard (AVS), etc. The algorithm is used to remove temporal noise of the video before encoding, thereby improving the overall encoding compression rate of the video.
[0003] MCTF is a pre-processing filtering algorithm, which is used to remove the temporal noise of the video before encoding, thereby improving the correlation between the video images to be filtered, and thus effectively compressing the video images during the encoding process. ALF is an in-loop filtering algorithm within the encoding, which is used to filter and enhance the compressed video images, thereby effectively improving the quality of the compressed video images. The MCTF filtering process does not need to generate any bit information that needs to be written into the bitstream. ALF is in the entire encoding process, so the encoder needs to write the filtering information generated during its filtering process into the bitstream. During the encoding process, the rate-distortion cost is used to determine the optimal encoding information for each algorithm. Summary of the invention
[0004] The present disclosure provides a video filtering method, device, electronic device, computer-readable storage medium and computer program product to at least solve the problem in the related art that the introduction of MCTF leads to inconsistency between the bit rate control and the actual encoded video, thereby leading to inaccurate bit weight factors. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a video filtering method is provided, comprising: obtaining a video frame to be processed, the video frame to be processed comprising a plurality of encoding units; determining a first filtered video frame and a filtering distortion obtained after the video frame to be processed is subjected to a first filtering process, and determining a compression distortion generated after image encoding process is performed on the first filtered video frame; obtaining a reference frame number corresponding to the video frame to be processed; and determining a frame bit weight of the video frame to be processed and a unit bit weight of the encoding unit respectively according to the reference frame number, the filtering distortion and the compression distortion, wherein the frame bit weight and the unit bit weight are used for a second filtering process of the video.
[0006] In an exemplary embodiment of the present disclosure, the filtering distortion includes frame filtering distortion, and the determining of the first filtered video frame and the filtering distortion obtained after the to-be-processed video frame is subjected to the first filtering processing includes: performing the first filtering processing on the to-be-processed video frame to obtain the first filtered video frame; determining the original frame pixel value corresponding to the to-be-processed video frame, and the filtered frame pixel value corresponding to the first filtered video frame; and determining the frame filtering distortion according to the original frame pixel value and the filtered frame pixel value.
[0007] In an exemplary embodiment of the present disclosure, the filtering distortion includes a unit filtering distortion corresponding to the coding unit, the video frame to be processed includes an original coding unit, and the first filtered video frame includes a filtered coding unit; the determining of the first filtered video frame and the filtering distortion obtained after the video frame to be processed is subjected to the first filtering processing also includes: determining an original unit size and an original unit starting point coordinate corresponding to the original coding unit; determining an original unit pixel value corresponding to the original coding unit, and a filtered unit pixel value corresponding to the filtered coding unit; determining the unit filtering distortion according to the original unit size, the original unit starting point coordinate, the original unit pixel value and the filtered unit pixel value.
[0008] In an exemplary embodiment of the present disclosure, the compression distortion includes frame compression distortion, and the determination of the compression distortion generated after the first filtered video frame is subjected to image coding processing includes: performing image coding processing on the first filtered video frame to obtain an encoded video frame; and determining the frame compression distortion based on a filtered frame pixel value corresponding to the first filtered video frame and an encoded frame pixel value of the encoded video frame.
[0009] In an exemplary embodiment of the present disclosure, the compression distortion includes unit compression distortion, the first filtered video frame includes a filtering coding unit, and the coded video frame includes a compression coding unit; the determination of the compression distortion generated after the first filtered video frame is subjected to image coding processing includes: obtaining the filtering unit size, the filtering unit starting point coordinates and the filtering unit pixel value corresponding to the filtering coding unit; determining the compression unit pixel value corresponding to the compression coding unit; and determining the unit compression distortion based on the filtering unit size, the filtering unit starting point coordinates, the filtering unit pixel value and the compression unit pixel value.
[0010] In an exemplary embodiment of the present disclosure, the frame bit weight of the video frame to be processed and the unit bit weight of the coding unit are determined respectively according to the reference frame number, the filtering distortion and the compression distortion, including: determining a frame weight reference value based on the reference frame number; obtaining a preconfigured frame weight limiting function, and determining an initial frame weight value corresponding to the video frame to be processed according to the frame weight limiting function and the frame weight reference value; obtaining frame filtering distortion and frame compression distortion, and determining a filtering compression distortion ratio according to the frame filtering distortion and the frame compression distortion; and determining a frame bit weight according to the filtering compression distortion ratio.
[0011] In an exemplary embodiment of the present disclosure, the frame bit weight of the video frame to be processed and the unit bit weight of the coding unit are determined respectively according to the reference frame number, the filtering distortion and the compression distortion, and also includes: obtaining the image frame size and frame filtering distortion corresponding to the video frame to be processed; determining the frame mean square error of the video frame to be processed according to the image frame size and the frame filtering distortion; obtaining the original unit size and unit filtering distortion corresponding to the original coding unit; determining the unit mean square error corresponding to the original coding unit according to the original unit size and the unit filtering distortion; and determining the unit bit weight based on the frame mean square error and the unit mean square error.
[0012] In an exemplary embodiment of the present disclosure, determining the unit bit weight based on the frame mean square error and the unit mean square error includes: determining a unit weight adjustment factor according to the frame mean square error and the unit mean square error; obtaining a pre-configured initial unit bit weight; and determining the unit bit weight according to the unit weight adjustment factor and the initial unit bit weight.
[0013] According to a second aspect of an embodiment of the present disclosure, a video filtering device is provided, comprising: a video frame acquisition module, used to acquire a video frame to be processed, wherein the video frame to be processed includes multiple encoding units; a distortion determination module, used to determine a first filtered video frame and a filtering distortion obtained after the video frame to be processed is subjected to a first filtering process, and to determine a compression distortion generated after image encoding processing is performed on the first filtered video frame; a reference frame number determination module, used to acquire a reference frame number corresponding to the video frame to be processed; a bit weight determination module, used to determine a frame bit weight of the video frame to be processed and a unit bit weight of the encoding unit according to the reference frame number, the filtering distortion and the compression distortion, respectively, wherein the frame bit weight and the unit bit weight are used for a second filtering process of the video.
[0014] In an exemplary embodiment of the present disclosure, the filtering distortion includes frame filtering distortion, and the distortion determination module includes a frame filtering distortion determination unit, which is used to: perform a first filtering process on the video frame to be processed to obtain the first filtered video frame; determine the original frame pixel value corresponding to the video frame to be processed, and the filtered frame pixel value corresponding to the first filtered video frame; determine the frame filtering distortion according to the original frame pixel value and the filtered frame pixel value.
[0015] In an exemplary embodiment of the present disclosure, the filtering distortion includes a unit filtering distortion corresponding to the coding unit, the video frame to be processed includes an original coding unit, and the first filtered video frame includes a filtered coding unit; the distortion determination module also includes a unit filtering distortion determination unit, which is used to: determine an original unit size and an original unit starting point coordinate corresponding to the original coding unit; determine an original unit pixel value corresponding to the original coding unit, and a filtered unit pixel value corresponding to the filtered coding unit; determine the unit filtering distortion according to the original unit size, the original unit starting point coordinates, the original unit pixel value and the filtered unit pixel value.
[0016] In an exemplary embodiment of the present disclosure, the compression distortion includes frame compression distortion, and the distortion determination module includes a frame compression distortion determination unit, which is used to: determine the compression distortion generated after the first filtered video frame is subjected to image coding processing, including: performing image coding processing on the first filtered video frame to obtain an encoded video frame; and determining the frame compression distortion according to the filtered frame pixel value corresponding to the first filtered video frame and the encoded frame pixel value of the encoded video frame.
[0017] In an exemplary embodiment of the present disclosure, the compression distortion includes unit compression distortion, the first filtered video frame includes a filtering coding unit, and the encoded video frame includes a compression coding unit; the distortion determination module includes a unit compression distortion determination unit, which is used to: obtain the filtering unit size, filtering unit starting point coordinates and filtering unit pixel value corresponding to the filtering coding unit; determine the compression unit pixel value corresponding to the compression coding unit; and determine the unit compression distortion based on the filtering unit size, the filtering unit starting point coordinates, the filtering unit pixel value and the compression unit pixel value.
[0018] In an exemplary embodiment of the present disclosure, the bit weight determination module includes a frame bit weight determination unit, which is used to: determine a frame weight reference value based on the reference frame number; obtain a pre-configured frame weight limiting function, and determine an initial frame weight value corresponding to the video frame to be processed according to the frame weight limiting function and the frame weight reference value; obtain frame filtering distortion and frame compression distortion, and determine a filtering compression distortion ratio according to the frame filtering distortion and the frame compression distortion; and determine a frame bit weight according to the filtering compression distortion ratio.
[0019] In an exemplary embodiment of the present disclosure, the bit weight determination module includes a unit bit weight determination unit, which is used to: obtain the image frame size and frame filtering distortion corresponding to the video frame to be processed; determine the frame mean square error of the video frame to be processed based on the image frame size and the frame filtering distortion; obtain the original unit size and unit filtering distortion corresponding to the original coding unit; determine the unit mean square error corresponding to the original coding unit based on the original unit size and the unit filtering distortion; determine the unit bit weight based on the frame mean square error and the unit mean square error.
[0020] In an exemplary embodiment of the present disclosure, the unit bit weight determination unit includes a unit bit weight determination sub-unit, which is used to: determine a unit weight adjustment factor based on the frame mean square error and the unit mean square error; obtain a pre-configured initial unit bit weight; and determine the unit bit weight based on the unit weight adjustment factor and the initial unit bit weight.
[0021] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement any one of the above-described video filtering methods.
[0022] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the video filtering methods described above.
[0023] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, which implements any one of the above-mentioned video filtering methods when executed by a processor.
[0024] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0025] On the one hand, through the three effective characteristics of the reference frame number, filtering distortion and compression distortion of the video frame to be processed, the frame bit weight and unit bit weight of the video frame to be processed can be optimized and adjusted; on the other hand, the present invention fully considers the impact of the filtering process on the video frame, and corrects the problem of errors in the weight factors used in the subsequent filtering process due to the introduction of the filtering operation.
[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0028] Figure 1 It is a schematic diagram of a video coding framework.
[0029] Figure 2 The figure is a flow chart of a video filtering method according to an exemplary embodiment.
[0030] Figure 3 It is a schematic diagram of the MCTF principle.
[0031] Figure 4 The figure is a block diagram of a video filtering device according to an exemplary embodiment.
[0032] Figure 5 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0033] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0035] refer to Figure 1 , Figure 1 It is a schematic diagram of a video coding framework. Figure 1 I0, I1, I n and I f Respectively represent the original video image, the image after MCTF filtering, the image before ALF filtering, and the image after compression. In the process of video encoding using the above video coding framework, the rate-distortion cost is used to determine the optimal coding information for each algorithm. The rate-distortion cost RDCost is calculated as: RDCost = Distortion + lambda*R; where R is the number of bits consumed when the algorithm takes effect, lambda is the bit weight factor, and Distortion is the distortion of the image before and after the algorithm takes effect. Figure 1 As shown, the bit rate control module can generate lambda corresponding to each module to control the algorithm processing granularity of each module.
[0036] Since MCTF is located after the bit rate control module, the source video has been modified by the filtering process after MCTF, which results in the lambda derived from the source video to control the compression quality of the source image being used in the video image after MCTF filtering, which results in a certain error in lambda. Both ALF and MCTF perform filtering on images, and this error will have a greater impact on the filtering effect of ALF, thereby affecting the overall coding compression efficiency.
[0037] Based on this, according to the embodiments of the present disclosure, a video filtering method, a video filtering device, an electronic device, a computer-readable storage medium, and a computer program product are proposed.
[0038] Figure 2 is a flow chart of a video filtering method according to an exemplary embodiment. Figure 2As shown, the video filtering method can be used in a computer device, wherein the computer device described in the present disclosure may include mobile terminal devices such as mobile phones, tablet computers, laptop computers, PDAs, and fixed terminal devices such as desktop computers. This exemplary embodiment uses the method applied to a computer device as an example, and it can be understood that the method can also be applied to a server, and can also be applied to a system including a computer device and a server, and is implemented through the interaction between the computer device and the server. Specifically, the following steps are included.
[0039] Step S210: obtaining a video frame to be processed, where the video frame to be processed includes a plurality of encoding units.
[0040] Step S220, determining a first filtered video frame and filtering distortion obtained after the to-be-processed video frame is subjected to the first filtering process, and determining compression distortion generated after image coding processing is performed on the first filtered video frame.
[0041] Step S230, obtaining the reference frame number corresponding to the video frame to be processed.
[0042] Step S240, determining the frame bit weight of the video frame to be processed and the unit bit weight of the coding unit according to the reference frame number, filtering distortion and compression distortion, respectively, and the frame bit weight and the unit bit weight are used for the second filtering process of the video.
[0043] According to the video filtering method in this example embodiment, on the one hand, through the three effective characteristics of the reference frame number, filtering distortion and compression distortion of the video frame to be processed, it is possible to achieve optimization adjustment of the frame bit weight and unit bit weight of the video frame to be processed; on the other hand, the present disclosure fully considers the impact of the filtering process on the video frame, and corrects the problem of errors in the weight factors used in the subsequent filtering process due to the introduction of the filtering operation.
[0044] The video filtering method in this exemplary embodiment will be further described below.
[0045] In step S210, a video frame to be processed is obtained, where the video frame to be processed includes a plurality of coding units.
[0046] In an exemplary embodiment of the present disclosure, the video frame to be processed may be an image frame contained in the video to be processed during the video encoding process. The coding unit may be a processing unit obtained by dividing the video frame to be processed. The coding unit, also known as the coding tree unit (CTU), may include a coding unit (CU) or be cut into multiple smaller coding units.
[0047] Get the video frame to be processed, using Figure 1 The video encoding framework shown performs video encoding processing on the video frame to be processed. The video encoding process is usually performed based on multiple encoding units obtained after the video frame to be processed is divided into blocks.
[0048] In step S220, a first filtered video frame and filtering distortion obtained after the to-be-processed video frame is subjected to the first filtering process are determined, and compression distortion generated after the first filtered video frame is subjected to image coding process is determined.
[0049] In an exemplary embodiment of the present disclosure, the first filtering process may be a process of performing motion compensated time domain filtering on the video frame to be processed. The first filtered video frame may be a video frame obtained after the first filtering process is performed on the video frame to be processed. The filtering distortion may be an image distortion generated after the first filtering process is performed on the video frame to be processed. The image coding process may be a process of performing compression coding on the first filtered video frame. The compression distortion may be an image distortion generated after the image coding process is performed on the first filtered video frame.
[0050] Continue to refer Figure 1 ,use Figure 1 The video encoding framework performs encoding processing on the video frame to be processed, and the video frame to be processed can be the original video initially input, represented by I0. After the video frame to be processed I0 passes through the bit rate control module, it is subjected to a first filtering process (such as MCTF processing) to obtain a corresponding first filtered video frame I1. Since the video frame to be processed I0 undergoes video filtering processing (such as MCTF processing), corresponding filtering distortion will be generated, and the filtering distortion generated by the first filtered video frame I1 generated after the video frame to be processed I0 undergoes MCTF processing is determined.
[0051] Then, the obtained first filtered video frame I1 is input into the image encoding module to obtain the encoded image frame I1 generated after the image encoding process. n , and determine that the first filtered video frame I1 generates a coded image frame I after image coding processing n In some other exemplary embodiments of the present disclosure, the first filtering process may also be other filtering processes, and the specific filtering algorithm may be set according to specific video processing requirements, and the present disclosure does not make any special limitation on this.
[0052] In an exemplary embodiment of the present disclosure, for step S220, determining a first filtered video frame and filtering distortion obtained after the video frame to be processed is subjected to a first filtering process, including: performing a first filtering process on the video frame to be processed to obtain a first filtered video frame; determining an original frame pixel value corresponding to the video frame to be processed, and a filtered frame pixel value corresponding to the first filtered video frame; and determining a frame filtering distortion based on the original frame pixel value and the filtered frame pixel value.
[0053] The original frame pixel value may be an image pixel value contained in the video frame to be processed. The filtered frame pixel value may be an image pixel value contained in the first filtered video frame. The frame filtering distortion may be a frame-level filtering distortion generated after the video frame to be processed is subjected to the first filtering process.
[0054] refer to Figure 3 , Figure 3 It is a schematic diagram of the MCTF principle. When the video frame to be processed is subjected to MCTF processing, in the motion compensation module, block-level motion estimation is performed based on the reference frame of the video frame to be processed. In the motion compensation module, the video frame to be processed can be used as the current frame and marked as I t , at this time I t The reference frames are usually four adjacent forward and backward frames (forward: I t-4 ,I t-3 ,I t-2 ,I t-1 , Backward: I t+1 ,I t+2 ,I t+3 ,I t+4 ) and then t Block-level motion estimation is performed with the adjacent 8 frames to search for I t The most similar matching block of each 8x8 image block in 8 reference frames, the position offset of the matching block relative to the current block is the motion vector (MV).
[0055] It should be noted that Figure 3 Just for the sake of understanding, 4 frames in front and 4 frames in back are used to illustrate the reference frame example. In practical applications, the number of forward and backward reference frames of MCTF is not limited. For example, the number of reference frames can be defined as NM, where NM is a natural number greater than or equal to 1.
[0056] Before determining the frame filtering distortion, the original frame pixel value corresponding to the video frame to be processed can be obtained, and the filtered frame pixel value corresponding to the first filtered video frame can be obtained after the first filtering process. The specific calculation method is as follows: in the motion estimation process, after searching for a matching block of the 8x8 current block, the block error E between the current block and the matching block is calculated. The calculation method of the block error E is shown in Formula 1.
[0057]
[0058] Among them, E may represent the block error between the current block and the matching block; SSD may represent the matching error between the current block and the matching block, that is, the sum of square differences (SSD); and V may represent the variance of the current block.
[0059] The specific calculation methods of the matching error SSD and the variance V of the current block are shown in Formula 2 and Formula 3 respectively.
[0060]
[0061] Where W and H are the width and height of the image block. For example, for an 8x8 image block, W and H are both equal to 8. I1 and I2 represent the current block and the matching block respectively, and (i, j) represents the pixel coordinates.
[0062]
[0063] Wherein, μ represents the pixel average value of the current image I1 (ie, the first filtered video frame), ie, the filtered frame pixel value.
[0064] After obtaining the filtered frame pixel value, the frame filter distortion generated by the MCTF processing of the video frame to be processed can be calculated based on the original frame pixel value and the filtered frame pixel value. The frame filter distortion can be used as a data basis for calculating the frame bit weight. Specifically, the frame-level MCTF filter distortion (i.e., frame filter distortion) can be calculated according to Formula 5.
[0065]
[0066] Among them, SSD frameMCTF It can represent frame filtering distortion; W and H represent the width and height of the video frame (including the video frame to be processed and the first filtered video frame), respectively, and the width and height of the video frame to be processed are the same as those of the first filtered video frame; (x, y) can represent the coordinates in the image; I0 can represent the video frame to be processed (that is, the original video frame); I1 can represent the first filtered video frame.
[0067] In an exemplary embodiment of the present disclosure, determining the filtering distortion generated after the to-be-processed video frame undergoes the first filtering process also includes: determining the original unit size and the original unit starting point coordinates corresponding to the original coding unit; determining the original unit pixel value corresponding to the original coding unit, and the filtering unit pixel value corresponding to the filtering coding unit; determining the unit filtering distortion according to the original unit size, the original unit starting point coordinates, the original unit pixel value and the filtering unit pixel value.
[0068] Among them, the original coding unit may be a coding unit included in the video frame to be processed. The filtered coding unit may be a coding unit included in the first filtered video frame. The original unit size may be the size of the original coding unit, for example, the original unit size may be 8x8. The original unit starting point coordinates may be the starting point position coordinates corresponding to the original coding unit. The original unit pixel value may be the specific value of each pixel in the original coding unit. The filtered unit pixel value may be the specific value of each pixel in the filtered coding unit. The unit filtering distortion may be the image distortion at the coding unit level generated after each coding unit is processed by the first filtering.
[0069] After calculating the frame-level filtering distortion corresponding to the video frame to be processed, the CTU-level filtering distortion corresponding to the video frame to be processed is determined. The filtering distortion of each CTU (which can be represented by t) can be calculated by Formula 6. Formula 6 can represent that the SSD of all pixels in the t-th CTU in the first filtered video frame I1 and the video frame to be processed I0 is calculated one by one, and the unit filtering distortion is obtained by adding them together.
[0070]
[0071] in, It can represent the unit filter distortion corresponding to each coding unit t; W t and H t Represents the width and height of CTU respectively, (x t ,y t ) represents the coordinates within the CTU, (sx t ,sy t ) represents the starting point coordinates of the CTU, that is, the original unit starting point coordinates. The unit filtering distortion calculated through the above steps can be used as a data basis for determining the unit bit weight.
[0072] In an exemplary embodiment of the present disclosure, for step S220, determining the compression distortion generated after the first filtered video frame is subjected to image coding processing includes: determining that an encoded video frame is generated after the first filtered video frame is subjected to image coding processing; and determining the frame compression distortion based on the original frame pixel value of the original image frame and the encoded frame pixel value of the encoded video frame.
[0073] The encoded video frame may be a video frame obtained by performing image encoding processing on the first filtered video frame, and the frame compression distortion may be a frame-level image distortion generated by performing image encoding processing on the first filtered video frame.
[0074] Continue to refer Figure 1After obtaining the first filtered video frame I1, the first filtered video frame I1 will be further subjected to image coding processing. In the image coding process, corresponding compression distortion will be generated. The video frame after image coding processing is used as the coded video frame I1. < The following will calculate the first filtered video frame I1 from the input encoding to the encoded video frame I before ALF filtering < The coding compression distortion between is also divided into frame level and CTU level. The calculation process of compression distortion is consistent with the calculation method of filtering distortion. Specifically, the calculation process of frame compression distortion is shown in Formula 7.
[0075]
[0076] Among them, SSD frameencode It can represent frame compression distortion; W and H represent the width and height of the video frame (including the encoded video frame and the first filtered video frame), respectively. The encoded video frame and the first filtered video frame have the same width and height; (x, y) can represent the coordinates in the image; I < I1 may represent a coded video frame; I2 may represent a first filtered video frame. The frame compression distortion calculated through the above steps may also be used as a data basis for determining the frame bit weight.
[0077] In an exemplary embodiment of the present disclosure, for step S220, the compression distortion generated after the first filtered video frame is processed by image encoding is determined, including: obtaining the filtering unit size, filtering unit starting point coordinates and filtering unit pixel value corresponding to the filtering coding unit; determining the compression unit pixel value corresponding to the compression coding unit; determining the unit compression distortion according to the filtering unit size, filtering unit starting point coordinates, filtering unit pixel value and compression unit pixel value.
[0078] Among them, the unit compression distortion can be the image distortion at the coding unit level generated by each coding unit after the first filtered video frame is subjected to image coding processing. The compressed coding unit can be the coding unit contained in the encoded video frame. The filtering unit size can be the size of the filtering coding unit. The starting point coordinates of the filtering unit can be the starting point position coordinates corresponding to the filtering coding unit. Generally speaking, the filtering unit size is the same as the original unit size, and the starting point coordinates of the filtering unit are the same as the starting point coordinates of the original unit. The compressed unit pixel value can be the specific value of each pixel in the compressed coding unit.
[0079] For the unit compression distortion at the CTU level, for each CTU (denoted by t), the unit compression distortion of each CTU can be calculated using Formula 8.
[0080]
[0081] in, Can represent unit compression distortion; W t and H t Represents the width and height of CTU respectively, (x t ,y t ) represents the coordinates within the CTU, (sx t ,sy t ) represents the starting point coordinates of the CTU, that is, the original unit starting point coordinates. The unit compression distortion calculated by the above steps can also be used as a data basis for determining the unit bit weight.
[0082] In step S230, the reference frame number corresponding to the video frame to be processed is obtained.
[0083] In an exemplary embodiment of the present disclosure, the number of reference frames may be the number of reference frames used when performing the first filtering process on the video frame to be processed.
[0084] according to Figure 3 It can be seen from the MCTF processing process that the video frame to be processed has multiple reference frames, and the specific number of the multiple reference frames corresponding to the video frame to be processed is obtained as the number of reference frames, which is recorded as NM.
[0085] In step S240, the frame bit weight of the video frame to be processed and the unit bit weight of the coding unit are determined according to the reference frame number, filtering distortion and compression distortion, and the frame bit weight and the unit bit weight are used for the second filtering process of the video.
[0086] In an exemplary embodiment of the present disclosure, the frame bit weight may be a frame-level bit weight factor for the second filtering process during video encoding. The unit bit weight may be a coding unit-level bit weight factor for the second filtering process during video encoding.
[0087] After determining the number of reference frames and calculating the filtering distortion at the frame level and CTU level, as well as the compression distortion at the frame level and CTU level, the frame bit weight of the video frame to be processed can be determined based on the filtering distortion at the frame level and the compression distortion at the frame level; then, the unit bit weight of the video frame to be processed is determined according to the filtering distortion at the CTU level and the compression distortion at the CTU level, so that the calculated frame bit weight and unit bit weight can be used in the subsequent ALF processing of the video.
[0088] In an exemplary embodiment of the present disclosure, for step S240, the frame bit weight of the video frame to be processed and the unit bit weight of the coding unit are respectively determined according to the reference frame number, filtering distortion and compression distortion, including: determining a frame weight reference value based on the reference frame number; obtaining a pre-configured frame weight limiting function, and determining an initial frame weight value corresponding to the video frame to be processed according to the frame weight limiting function and the frame weight reference value; obtaining frame filtering distortion and frame compression distortion, and determining a filtering compression distortion ratio according to the frame filtering distortion and the frame compression distortion; and determining the frame bit weight according to the filtering compression distortion ratio.
[0089] Among them, the frame weight reference value may be a reference value of a pre-configured frame bit weight, and the frame weight reference value may include a maximum reference value and a minimum reference value. The frame weight limiting function may be a function used to limit the value of the frame bit weight within a specific range. The initial frame weight value may be a specific value of the frame bit weight determined based on the frame weight limiting function and the frame weight reference value. The filtering compression distortion ratio may be a ratio of the filtering distortion to the compression distortion, and the filtering compression distortion ratio may be used as an adjustment factor for the frame bit weight. The frame bit weight may be a specific value of the frame bit weight obtained by adjusting the initial frame weight value according to the filtering compression distortion ratio, and the frame bit weight is used in the subsequent second filtering process.
[0090] According to the frame-level and CTU-level distortions calculated in the above process and the number of filtered frames of MCTF, the frame-level and CTU-level lambda of ALF are adjusted. frame ), the adjustment logic is as follows.
[0091] First, generate lambda according to the number of reference frames NM of the video frame to be processed in the MCTF process frame The weight to be adjusted, that is, the frame adjustment weight frame , which is calculated as shown in Formula 9.
[0092] weight frame = (0.8 – 0.025 * NM) (Formula 9)
[0093] Among them, weight frame It can represent the frame adjustment weight; NM can represent the number of reference frames.
[0094] Determine the frame adjustment weight based on the number of reference frames frame After that, the frame weight limit function can be further used to adjust the frame weight weight frame The specific value of is adjusted so that the value is within a specified value range. The specific value is shown in formula 10.
[0095] weight frame =weight frame <0.2?0.2:weight frame (Formula 10)
[0096] Among them, formula 10 can be expressed as if weight frame If it is less than 0.2, the weight frame Reset to 0.2.
[0097] Further, the frame filtering distortion and the frame compression distortion are obtained, and the frame adjustment weights of the frame filtering distortion and the frame compression distortion are determined according to the above steps. frame To make adjustments, first determine the filtering compression distortion ratio based on the frame filtering distortion and the frame compression distortion, as specifically shown in Formula 11.
[0098] ratio=SSD frameMCTF / SSD frameencode (Formula 11)
[0099] Among them, ratio can represent the ratio of filtering compression distortion; SSD frameMCTF Can indicate frame filtering distortion; / SSD frameencode Can indicate frame compression artifacts.
[0100] Then, according to the filtering compression distortion ratio, the weight of the frame is adjusted frame Further adjustments are made to adjust the frame Determine the frame bit weight and adjust the weight of the frame frame The specific process of adjustment is shown in Formula 12.
[0101] weight frame =weight frame >ratio? ratio:weight frame (Formula 12)
[0102] Among them, ratio can represent the ratio of filtering compression distortion; weight frame It can represent the frame adjustment weight; Formula 12 can represent if weight frame If it is greater than ratio, then weight frame Set to ratio, otherwise weight frameNo adjustment is required. The frame adjustment weight calculated by the above steps can be used to adjust the initially set frame-level bit weight factor, such as multiplying the obtained frame adjustment weight with the pre-configured frame bit weight factor to obtain the adjusted frame bit weight, so that the adjusted frame bit weight is used in the subsequent loop filtering process.
[0103] In an exemplary embodiment of the present disclosure, for step S240, the frame bit weight of the video frame to be processed and the unit bit weight of the coding unit are determined respectively according to the number of reference frames, filtering distortion and compression distortion, and also include: obtaining the image frame size and frame filtering distortion corresponding to the video frame to be processed; determining the frame mean square error of the video frame to be processed according to the image frame size and the frame filtering distortion; obtaining the original unit size and unit filtering distortion corresponding to the original coding unit; determining the unit mean square error corresponding to the original coding unit according to the original unit size and the unit filtering distortion; and determining the unit bit weight based on the frame mean square error and the unit mean square error.
[0104] The image frame size may be the size of the video frame to be processed. The frame mean square error may be the mean square error of the filter distortion at the frame level corresponding to the video frame to be processed. The unit mean square error may be the mean square error of the filter distortion at the coding unit level corresponding to the video frame to be processed.
[0105] For each CTU (denoted by t), the bit weight factor, i.e., the unit bit weight The adjustment logic is: first calculate the mean square error MSE of the MCTF filtering distortion at the frame level and CTU level according to Formula 5 and Formula 6, as shown in Formula 13 and Formula 14.
[0106]
[0107] Among them, MSE frameMCTF It can represent the mean square error of frame filtering distortion; It can represent the mean square error of unit filter distortion; SSD frameMCTF It can represent frame filtering distortion; It can represent the unit filter distortion corresponding to each coding unit t; W and H can represent the width and height of the video frame, W t and H t is the width and height of the current CTU (represented by t). Then, the frame mean square error and unit mean square error calculated according to the above steps are applied to the process of determining the unit bit weight. The above steps provide a calculation scheme for calculating the unit bit weight.
[0108] It is easy for those skilled in the art to understand that, in the entire video encoding process, the frame sizes of the to-be-processed video frame, the first filtered video frame and the encoded video frame are the same, and the unit sizes of the original encoding unit, the filtered encoding unit and the compressed encoding unit are also the same. The above expressions are used in the present disclosure only to distinguish video frames and encoding units at different processing stages.
[0109] In an exemplary embodiment of the present disclosure, a unit bit weight is determined based on a frame mean square error and a unit mean square error, including: determining a unit weight adjustment factor according to the frame mean square error and the unit mean square error; obtaining a preconfigured initial unit bit weight; and determining the unit bit weight according to the unit weight adjustment factor and the initial unit bit weight.
[0110] The unit weight adjustment factor may be an adjustment factor for numerically trimming the initial unit bit weight. The initial unit bit weight may be a specific value of the unit bit weight factor pre-configured for the encoding unit during the video encoding process.
[0111] According to the calculation results of formula 13 and formula 14, the bit weight factor (i.e., unit bit weight) of the current CTU (represented by t) is adjusted. First, the unit weight adjustment factor ctuRatio is determined. t , as shown in Formula 15.
[0112]
[0113] Among them, ctuRatio t Can represent the unit weight adjustment factor; MSE frameMCTF It can represent the mean square error of frame filtering distortion; It can represent the mean square error of unit filter distortion. It should be noted that ctuRatio t Cannot be greater than 1, so when the calculated ctuRatio t When greater than 1, ctuRatio t will be forced to 1; if ctuRatio t If it is not greater than 1, its value remains unchanged.
[0114] Adjustment factor ctuRatio according to unit weight t right Make adjustments, and the adjustment logic is shown in Formula 16.
[0115]
[0116] Among them, ctuRatio t It can represent the unit weight adjustment factor; can represent the unit bit weight; where, The initial unit bit weight can be expressed; The unit bit weight can be expressed as: The initial unit bit weight is adjusted by the unit weight adjustment factor to determine the final unit bit weight, so that the calculated unit bit weight is more accurate.
[0117] After obtaining the above frame bit weight and unit bit weight, the ALF algorithm will be used to further process the encoded compressed video. Figure 1 ALF is the last module of the whole encoding process, which is used to filter the compressed image to further improve its compression quality. In the encoder, ALF can generate up to 25 types of filters, and the parameters of these filters can be written into the bitstream. These filters are determined by rate-distortion cost, and the specific decision formula is shown in Formula 17.
[0118] RDCost frame =Distrotion frame +lambda frame *R frame (Formula 17)
[0119] Among them, RDCost frame It can represent the rate distortion cost after ALF uses these filters. frame It can represent the distortion of the entire image after filtering, R frame It can represent the number of bits required to write these filter information into the bitstream, lambda frame It can represent the frame-level bit weight factor of ALF.
[0120] ALF stipulates that each CTU of the image can independently decide whether it needs to be filtered by ALF. Therefore, for each CTU, the rate-distortion cost can also be used to decide whether ALF filtering is needed. The specific decision process is shown in Formula 18.
[0121]
[0122] in, It can represent the rate distortion cost of the Kth CTU after ALF filtering. frame It can represent the distortion after filtering of the Kth CTU. It can indicate the number of bits required to write the information of whether the Kth CTU needs ALF filtering into the bitstream. It can represent the bit weight factor of the Kth CTU of ALF.
[0123] Compared with the related scheme without bit weight optimization, the above bit weight optimization scheme can improve the performance of the system by analyzing the rate distortion index ( rate), which is used to evaluate the RD (rate-Rate, distortion-Distortion) performance indicators of different video encoders. It is found that the benefits that can be obtained are: BDSSIM611 benefits of about 0.45%, where SSIM in BDSSIM611 can represent structural similarity (SSIM), 611 can represent the color coding model YUV components with a ratio of 6:1:1, Y represents brightness, U represents the first chrominance component, and V represents the second chrominance component; BDPSNR611 benefits of about 0.2%, where PSNR can represent peak signal-to-noise ratio (Peak signal-to-noise ratio, often abbreviated as PSNR).
[0124] In summary, the video filtering method disclosed in the present invention obtains a video frame to be processed, and the video frame to be processed includes multiple coding units; determines the first filtered video frame and the filtering distortion obtained after the video frame to be processed is subjected to the first filtering process, and determines the compression distortion generated after the first filtered video frame is subjected to the image coding process; obtains the reference frame number corresponding to the video frame to be processed; and determines the frame bit weight of the video frame to be processed and the unit bit weight of the coding unit according to the reference frame number, the filtering distortion and the compression distortion, respectively, and the frame bit weight and the unit bit weight are used for the second filtering process of the video. On the one hand, through the three effective features of the reference frame number, the filtering distortion and the compression distortion of the video frame to be processed, the frame bit weight and the unit bit weight of the video frame to be processed can be optimized and adjusted; on the other hand, the present invention fully considers the influence of the filtering process on the video frame, and corrects the problem that the weight factor used in the subsequent filtering process has errors due to the introduction of the filtering operation. On the other hand, the optimization result of the bit weight factor is used in the subsequent filtering process, which can improve the subsequent video filtering effect and improve the overall coding compression efficiency.
[0125] Figure 4 is a block diagram of a video filtering device according to an exemplary embodiment. Figure 4 The video filtering device 400 includes: a video frame acquisition module 410, a distortion determination module 420, a reference frame number determination module 430 and a bit weight determination module 440.
[0126] Specifically, the video frame acquisition module 410 is used to acquire the video frame to be processed, which includes multiple encoding units; the distortion determination module 420 is used to determine the first filtered video frame and the filtering distortion obtained after the video frame to be processed is subjected to the first filtering processing, and determine the compression distortion generated after the first filtered video frame is subjected to image coding processing; the reference frame number determination module 430 is used to acquire the reference frame number corresponding to the video frame to be processed; the bit weight determination module 440 is used to determine the frame bit weight of the video frame to be processed and the unit bit weight of the encoding unit according to the reference frame number, the filtering distortion and the compression distortion, and the frame bit weight and the unit bit weight are used for the second filtering processing of the video.
[0127] In an exemplary embodiment of the present disclosure, filtering distortion includes frame filtering distortion, and the distortion determination module 420 includes a frame filtering distortion determination unit, which is used to: perform a first filtering process on the video frame to be processed to obtain a first filtered video frame; determine the original frame pixel value corresponding to the video frame to be processed, and the filtered frame pixel value corresponding to the first filtered video frame; determine the frame filtering distortion based on the original frame pixel value and the filtered frame pixel value.
[0128] In an exemplary embodiment of the present disclosure, the filtering distortion includes a unit filtering distortion corresponding to the coding unit, the video frame to be processed includes the original coding unit, and the first filtered video frame includes the filtered coding unit; the distortion determination module 420 also includes a unit filtering distortion determination unit, which is used to: determine the original unit size and the original unit starting point coordinates corresponding to the original coding unit; determine the original unit pixel value corresponding to the original coding unit, and the filtered unit pixel value corresponding to the filtered coding unit; determine the unit filtering distortion according to the original unit size, the original unit starting point coordinates, the original unit pixel value and the filtered unit pixel value.
[0129] In an exemplary embodiment of the present disclosure, the compression distortion includes frame compression distortion, and the distortion determination module 420 includes a frame compression distortion determination unit, which is used to: determine the compression distortion generated after the first filtered video frame is subjected to image coding processing, including: performing image coding processing on the first filtered video frame to obtain an encoded video frame; and determining the frame compression distortion according to the filtered frame pixel value corresponding to the first filtered video frame and the encoded frame pixel value of the encoded video frame.
[0130] In an exemplary embodiment of the present disclosure, the compression distortion includes unit compression distortion, the first filtered video frame includes a filtering coding unit, and the encoded video frame includes a compression coding unit; the distortion determination module 420 includes a unit compression distortion determination unit, which is used to: obtain the filtering unit size, filtering unit starting point coordinates and filtering unit pixel value corresponding to the filtering coding unit; determine the compression unit pixel value corresponding to the compression coding unit; determine the unit compression distortion based on the filtering unit size, filtering unit starting point coordinates, filtering unit pixel value and compression unit pixel value.
[0131] In an exemplary embodiment of the present disclosure, the bit weight determination module 440 includes a frame bit weight determination unit, which is used to: determine a frame weight reference value based on a reference frame number; obtain a pre-configured frame weight limiting function, and determine an initial frame weight value corresponding to the video frame to be processed according to the frame weight limiting function and the frame weight reference value; obtain frame filtering distortion and frame compression distortion, and determine a filtering compression distortion ratio according to the frame filtering distortion and the frame compression distortion; and determine the frame bit weight according to the filtering compression distortion ratio.
[0132] In an exemplary embodiment of the present disclosure, the bit weight determination module 440 includes a unit bit weight determination unit, which is used to: obtain the image frame size and frame filtering distortion corresponding to the video frame to be processed; determine the frame mean square error of the video frame to be processed based on the image frame size and the frame filtering distortion; obtain the original unit size and unit filtering distortion corresponding to the original coding unit; determine the unit mean square error corresponding to the original coding unit based on the original unit size and the unit filtering distortion; and determine the unit bit weight based on the frame mean square error and the unit mean square error.
[0133] In an exemplary embodiment of the present disclosure, the unit bit weight determination unit includes a unit bit weight determination sub-unit, which is used to: determine the unit weight adjustment factor based on the frame mean square error and the unit mean square error; obtain a pre-configured initial unit bit weight; and determine the unit bit weight based on the unit weight adjustment factor and the initial unit bit weight.
[0134] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0135] Refer to the following Figure 5 hereinafter describes an electronic device 500 according to such an embodiment of the present disclosure. Figure 5 The electronic device 500 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0136] like Figure 5As shown, the electronic device 500 is in the form of a general computing device. The components of the electronic device 500 may include but are not limited to: at least one processing unit 510, at least one storage unit 520, a bus 530 connecting different system components (including the storage unit 520 and the processing unit 510), and a display unit 540.
[0137] The storage unit stores program codes, which can be executed by the processing unit 510, so that the processing unit 510 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0138] The storage unit 520 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 521 and / or a cache memory unit 522 , and may further include a read-only memory unit (ROM) 523 .
[0139] The storage unit 520 may also include a program / utility 524 having a set (at least one) of program modules 525, such program modules 525 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0140] Bus 530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0141] The electronic device 500 may also communicate with one or more external devices 570 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 500, and / or may communicate with any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 550. Furthermore, the electronic device 500 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 560. As shown, the network adapter 560 communicates with other modules of the electronic device 500 via a bus 530. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0142] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of the device to perform the above video filtering method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0143] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the video filtering method described in any one of the above is implemented.
[0144] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0145] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A video filtering method, characterized in that: include: Acquire a video frame to be processed, where the video frame to be processed includes a plurality of encoding units; Determine a first filtered video frame and filtering distortion obtained after the to-be-processed video frame is subjected to a first filtering process, and determine compression distortion generated after image coding processing is performed on the first filtered video frame; Obtaining the reference frame number corresponding to the video frame to be processed; According to the reference frame number, the filtering distortion and the compression distortion, the frame bit weight of the video frame to be processed and the unit bit weight of the encoding unit are determined respectively, and the frame bit weight and the unit bit weight are used for the second filtering processing of the video.
2. The method according to claim 1, characterized in that The filtering distortion includes frame filtering distortion, and the determining of a first filtered video frame obtained after the to-be-processed video frame is subjected to a first filtering process and the filtering distortion includes: Performing a first filtering process on the video frame to be processed to obtain the first filtered video frame; Determining an original frame pixel value corresponding to the to-be-processed video frame and a filtered frame pixel value corresponding to the first filtered video frame; The frame filtering distortion is determined according to the original frame pixel value and the filtered frame pixel value.
3. The method according to claim 2, characterized in that The filtering distortion includes the unit filtering distortion corresponding to the encoding unit, the video frame to be processed includes the original encoding unit, and the first filtered video frame includes the filtering encoding unit; the determining the first filtered video frame and the filtering distortion obtained after the video frame to be processed is subjected to the first filtering process, further comprising: Determine the original unit size and the original unit starting point coordinates corresponding to the original coding unit; Determine an original unit pixel value corresponding to the original coding unit and a filtering unit pixel value corresponding to the filtering coding unit; The unit filtering distortion is determined according to the original unit size, the original unit starting point coordinates, the original unit pixel value and the filtering unit pixel value.
4. The method according to claim 1, characterized in that: The compression distortion includes frame compression distortion, and the determining of the compression distortion generated after performing image encoding processing on the first filtered video frame includes: Performing image coding processing on the first filtered video frame to obtain a coded video frame; The frame compression distortion is determined according to the filtered frame pixel value corresponding to the first filtered video frame and the encoded frame pixel value of the encoded video frame.
5. The method according to claim 4, characterized in that The compression distortion comprises a unit compression distortion, the first filtered video frame comprises a filtered coding unit, and the coded video frame comprises a compression coding unit; The determining of compression distortion generated after image encoding processing is performed on the first filtered video frame includes: Obtaining the filter unit size, filter unit starting point coordinates and filter unit pixel value corresponding to the filter coding unit; Determining a compression unit pixel value corresponding to the compression coding unit; The unit compression distortion is determined according to the filter unit size, the filter unit starting point coordinates, the filter unit pixel value and the compression unit pixel value.
6. The method according to claim 1, characterized in that The determining, according to the reference frame number, the filtering distortion and the compression distortion, respectively, the frame bit weight of the to-be-processed video frame and the unit bit weight of the encoding unit comprises: determining a frame weight reference value based on the reference frame number; Obtaining a preconfigured frame weight clipping function, and determining an initial frame weight value corresponding to the to-be-processed video frame according to the frame weight clipping function and the frame weight reference value; Obtaining frame filtering distortion and frame compression distortion, and determining a filtering compression distortion ratio according to the frame filtering distortion and the frame compression distortion; The frame bit weight is determined according to the filtering compression distortion ratio.
7. The method according to claim 1 or 6, characterized in that: The step of determining the frame bit weight of the video frame to be processed and the unit bit weight of the coding unit according to the reference frame number, the filtering distortion and the compression distortion respectively further includes: Obtaining an image frame size and a frame filtering distortion corresponding to the video frame to be processed; Determining a frame mean square error of the video frame to be processed according to the image frame size and the frame filtering distortion; Obtaining the original unit size and unit filtering distortion corresponding to the original coding unit; Determining a unit mean square error corresponding to the original coding unit according to the original unit size and the unit filtering distortion; The unit bit weight is determined based on the frame mean square error and the unit mean square error.
8. The method according to claim 7, characterized in that The determining the unit bit weight based on the frame mean square error and the unit mean square error includes: Determining a unit weight adjustment factor according to the frame mean square error and the unit mean square error; Obtaining a preconfigured initial unit bit weight; The unit bit weight is determined according to the unit weight adjustment factor and the initial unit bit weight.
9. A video filtering device, characterized in that: include: A video frame acquisition module, used to acquire a video frame to be processed, wherein the video frame to be processed includes a plurality of encoding units; A distortion determination module, used to determine a first filtered video frame obtained after the to-be-processed video frame is subjected to a first filtering process and a filtering distortion, and to determine a compression distortion generated after image coding processing is performed on the first filtered video frame; A reference frame number determination module, used to obtain the reference frame number corresponding to the video frame to be processed; A bit weight determination module is used to determine the frame bit weight of the video frame to be processed and the unit bit weight of the encoding unit according to the reference frame number, the filtering distortion and the compression distortion, and the frame bit weight and the unit bit weight are used for the second filtering processing of the video.
10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the video filtering method as described in any one of claims 1 to 8.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the video filtering method according to any one of claims 1 to 8 is implemented.