Image filtering processing method, system, device and storage medium

Through Lookahead precoding and dynamic adjustment of filter strength, the problem of loss of video coding compression efficiency caused by time domain filtering is solved and the overall compression efficiency is improved.

CN118573902BActive Publication Date: 2024-10-25SHANGHAI HODE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410888609.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-10-25
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

The loss of compression efficiency caused by temporal filtering in video coding, especially when the intra-frame prediction distortion is low, the filtering loss cannot be avoided, resulting in a decrease in overall compression efficiency.

Method used

The intra-frame prediction cost is collected through Lookahead precoding, and the filtering intensity is adjusted according to the intra-frame and inter-frame prediction cost during the filtering process. The intensity correction coefficient is used to adjust the weight of the filtered reference frame, and the filtering intensity is reduced or enhanced to reduce the effects of erroneous filtering. loss of compression efficiency.

Benefits of technology

It effectively reduces the loss of compression efficiency caused by temporal filtering, improves the overall compression efficiency of the video, and optimizes the encoding process by dynamically adjusting the filtering intensity according to the prediction cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118573902B_ABST
    Figure CN118573902B_ABST
Patent Text Reader

Abstract

The present application discloses an image filtering processing method, which includes: performing Lookahead pre-coding on the image to be processed, and collecting the Lookahead intra-frame prediction cost of the area covered by the current filtering unit before filtering begins; performing filtering processing on the filtering unit, wherein the inter-frame prediction cost during the filtering process is obtained, and the filtering strength of the filtering unit is adjusted according to the size of the intra-frame prediction cost and the inter-frame prediction cost. The present application also discloses an image filtering processing system, an electronic device, and a computer-readable storage medium. Thus, it is possible to estimate the possibility of intra-frame prediction and inter-frame prediction in the area in actual coding, thereby adjusting the intensity of the time domain filtering of the current filtering unit accordingly, reducing the compression efficiency loss caused by erroneous filtering, and improving the compression efficiency as a whole.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video coding technology, and in particular to an image filtering processing method, system, electronic device and computer-readable storage medium. Background Art

[0002] The current video coding standards are all based on a hybrid coding framework. Under this framework, each frame in the video is first divided into a fixed-size largest coding unit (LCU), and may be further divided into coding units (CU) of indefinite size. Each CU first uses inter-frame or intra-frame prediction technology to obtain a predicted image. The difference between the predicted image and the original image, also known as the residual, is transformed and quantized and sent to the entropy encoder for encoding. It is then reconstructed through inverse quantization and inverse transformation, plus the predicted image, and finally reconstructed through loop filtering. The reconstructed image will enter the coded (reconstructed) image buffer in the encoder as a reference image for inter-frame prediction of subsequent coded frames.

[0003] Motion-compensated temporal filter (MCTF) is a video preprocessing technology implemented in a variety of encoders in recent years. The algorithm first selects the more important frames (such as I frames, P frames, etc.) in the mini-GOP of the frame sequence as the filtered frames before the start of encoding, and selects several adjacent frames before and after the filtered frames in the display order as reference frames. The filtered frames are divided into fixed-size filter units (such as 16x16, 32x32, etc.), and each filter unit is sequentially searched on all reference frames to obtain motion vectors, and the motion compensation unit is used to weight each pixel in the filtered frame.

[0004] Temporal filtering was initially used for video denoising. It extracts multiple sets of pixel values ​​in different video frames of the same content area in the video, and designs low-pass filters or band-pass filters to remove the noise generated in video production and transmission, thereby improving video quality. For the field of video coding, its improvement in compression efficiency mainly lies in the use of filtering to make the content of the reference frame and the referenced frame of the inter-frame prediction in the encoding process closer, thereby improving the accuracy of inter-frame prediction and compression efficiency. However, for the filtered frame, since the content before and after filtering is different, filtering distortion will naturally be introduced, so generally speaking, its compression efficiency will be lower. In summary, temporal filtering in video coding will lead to a decrease in the compression efficiency of the filtered frame, while the compression efficiency of other inter-frame reference frames will be improved. By filtering only a few frames (such as I frames, P frames, etc.) that are referenced more in the filtering sequence, the overall compression efficiency can be improved.

[0005] However, in the actual encoding process, if the intra-frame prediction distortion is lower than the inter-frame prediction, the coding unit in the inter-frame reference frame may also choose to use intra-frame prediction for encoding. In this case, the expected intra-frame prediction benefit does not exist, but the loss of filtering has already occurred, so that overall, the temporal filtering leads to a decrease in compression efficiency. However, motion compensated temporal filtering needs to be completed before encoding begins, so there is currently no way to avoid this loss. Summary of the invention

[0006] The main purpose of this application is to propose an image filtering processing method, system, electronic device and computer-readable storage medium, aiming to solve the problem of how to reduce the compression efficiency loss caused by time domain filtering and improve the overall video compression efficiency.

[0007] To achieve the above object, an embodiment of the present application provides an image filtering processing method, the method comprising:

[0008] Perform Lookahead precoding on the image to be processed, and collect the Lookahead intra-frame prediction cost of the area covered by the current filtering unit before filtering begins;

[0009] The filtering unit is subjected to filtering processing, wherein an inter-frame prediction cost in the filtering process is obtained, and the filtering strength of the filtering unit is adjusted according to the magnitudes of the intra-frame prediction cost and the inter-frame prediction cost.

[0010] Optionally, the adjusting the filtering strength of the filtering unit according to the magnitude of the intra-frame prediction cost and the inter-frame prediction cost comprises:

[0011] When the intra-frame prediction cost is smaller than the inter-frame prediction cost, reducing the filtering strength of the filtering unit;

[0012] When the intra prediction cost is greater than the inter prediction cost, the filtering strength of the filtering unit is increased.

[0013] Optionally, the adjusting the filtering strength of the filtering unit according to the magnitude of the intra-frame prediction cost and the inter-frame prediction cost comprises:

[0014] When filtering all pixels belonging to the filtering unit, the weight of the used filtering reference frame is multiplied by an intensity correction coefficient, and the intensity correction coefficient is determined according to the magnitude of the intra-frame prediction cost and the inter-frame prediction cost.

[0015] Optionally, the strength correction coefficient is determined according to the size of the intra-frame prediction cost and the inter-frame prediction cost in the filtering process, including:

[0016] The strength correction coefficient is negatively correlated with the intra-frame prediction cost and positively correlated with the inter-frame prediction cost.

[0017] Optionally, the intensity correction coefficient is S_k = min(2.0, ((a * QP * intraSatd + c) / (interSatd_k + c))^2),

[0018] Among them, a and c are empirical coefficients, QP is a quantization parameter, intraSatd is the intra-frame prediction cost, and interSatd_k is the inter-frame prediction cost based on the kth filtering reference frame of the filtering unit.

[0019] Optionally, the inter-frame prediction cost is an optimal motion vector cost generated by performing motion compensated time domain filtering MCTF motion search on the filtering unit.

[0020] Optionally, the obtaining of the inter-frame prediction cost in the filtering process includes:

[0021] After obtaining a motion compensated image according to the filtered reference frame of the filtering unit, the distortion between the motion compensated image and the image before filtering by the filtering unit is determined, and the distortion value is used as the inter-frame prediction cost based on the filtered reference frame.

[0022] In addition, to achieve the above-mentioned purpose, the embodiment of the present application further provides an image filtering processing system, the system comprising:

[0023] A collection module is used to perform Lookahead precoding on the image to be processed and collect the Lookahead intra-frame prediction cost of the area covered by the current filtering unit before filtering begins;

[0024] The filtering module is used to perform filtering processing on the filtering unit, wherein the inter-frame prediction cost in the filtering process is obtained, and the filtering strength of the filtering unit is adjusted according to the size of the intra-frame prediction cost and the inter-frame prediction cost.

[0025] To achieve the above-mentioned purpose, an embodiment of the present application also provides an electronic device, which includes: a memory, a processor, and an image filtering processing program stored in the memory and executable on the processor, wherein the image filtering processing program implements the image filtering processing method as described above when executed by the processor.

[0026] To achieve the above objectives, an embodiment of the present application further provides a computer-readable storage medium, on which an image filtering processing program is stored. When the image filtering processing program is executed by a processor, the image filtering processing method as described above is implemented.

[0027] To achieve the above-mentioned purpose, an embodiment of the present application further provides a computer program product, on which an image filtering processing program is stored, and when the image filtering processing program is executed by a processor, the image filtering processing method as described above is implemented.

[0028] The image filtering processing method, system, electronic device and computer-readable storage medium proposed in the embodiments of the present application can use the intra-frame prediction cost obtained in the Lookahead pre-coding and the inter-frame prediction cost generated by motion estimation in the MCTF to estimate the possibility of intra-frame prediction and inter-frame prediction in the area in actual encoding, thereby adjusting the intensity of time domain filtering of the current filtering unit accordingly, reducing the compression efficiency loss caused by erroneous filtering, and improving the compression efficiency as a whole. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 An application environment architecture diagram for implementing various embodiments of the present application;

[0030] Figure 2 This is a flow chart of an image filtering processing method proposed in the first embodiment of the present application;

[0031] Figure 3 A schematic diagram of a filtered frame and a reference frame of a frame sequence;

[0032] Figure 4 for Figure 2 A detailed flow chart of step S202;

[0033] Figure 5 A schematic diagram of the hardware architecture of an electronic device proposed in the second embodiment of the present application;

[0034] Figure 6 This is a module diagram of an image filtering processing system proposed in the third embodiment of the present application. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0036] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0037] The following is an explanation of the terms used in this application:

[0038] Versatile Video Coding (VVC) standard: a new generation of compression standard for video coding jointly developed by the International Telecommunication Union and the International Organization for Standardization, designed to provide higher compression performance and better video quality.

[0039] Motion-compensated temporal filter (MCTF): It is a coding tool in the encoder that performs pre-filtering on the video to improve compression efficiency.

[0040] Lookahead pre-coding: The process of pre-analyzing the video before encoding in the encoder. Usually refers to the use of inter-frame prediction technology to reduce the amount of data to be encoded when encoding the video. This technology reduces spatial redundancy by predicting the value of the current pixel based on the surrounding pixels, aiming to improve encoding efficiency and compression ratio.

[0041] Minimum Group of Pictures (mini-GOP): In order to better perform inter-frame compression and control frame rate and bit rate, the concept of Group of Pictures (GOP) is introduced in video compression. GOP determines the order and connection between different frame types in the video bitstream. Usually a GOP always starts with an I frame, and the number of frames between two adjacent I frames is the size of the GOP. Mini-GOP is a group of images from the bottom layer to the highest layer within the GOP. The size of mini-GOP is related to the frame reference relationship and the number of time domain layers during video encoding.

[0042] SATD (Sum of Absolute Transformed Differences): It is a measure of the size of the video residual signal. After the difference between two pixel matrices is transformed by Hadmard, the sum of the absolute values ​​of the transformation matrix is ​​calculated to evaluate the difference between the two pixel matrices.

[0043] Coding Unit (CU): It is the basic unit for coding processes such as mode prediction, transformation, and quantization.

[0044] Largest Coding Unit (LCU): The basic unit for image division, which can be further divided into CUs of different sizes.

[0045] Quantization Param (QP): A parameter used to control the distortion of the quantization process.

[0046] See also Figure 1 , Figure 1 The present invention is an application environment architecture diagram for implementing various embodiments of the present invention. The present invention can be applied to an application environment including, but not limited to, a client 2, a server 4, and a network 6.

[0047] The client 2 is used to display the interface of the current application to the user and receive the user's operation, such as uploading and selecting a video or image. The client 2 can be a terminal device such as a PC (Personal Computer), a mobile phone, a tablet computer, a portable computer, a wearable device, etc.

[0048] The server 4 is used to provide data and technical support for the client 2. The server 4 can be a computing device such as a rack server, a blade server, a tower server or a cabinet server, and can be an independent server or a server cluster composed of multiple servers.

[0049] The network 6 can be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), the Wideband Code Division Multiple Access (WCDMA), the 4G network, the 5G network, Bluetooth, Wi-Fi, etc. The server 4 and one or more clients 2 are connected to each other through the network 6 for data transmission and interaction.

[0050] Embodiment 1

[0051] like Figure 2As shown, it is a flowchart of an image filtering processing method proposed in the first embodiment of the present application. It can be understood that the flowchart in the embodiment of the present method is not used to limit the order of executing the steps. As needed, some steps in the flowchart can be added or deleted. The execution subject of the method can be the client or the server, which is not limited here.

[0052] The method comprises the following steps:

[0053] S200 , performing Lookahead precoding on the image to be processed, and collecting the Lookahead intra-frame prediction cost of the area covered by the current filtering unit before filtering begins.

[0054] The method proposed in this embodiment is based on an encoder that implements the Lookahead and MCTF algorithms. When encoding, the encoder first pre-encodes the current image in the Lookahead, calculates the frame structure of the sequence, QP information and other parameters, and saves the pre-encoded intra-frame prediction cost. Then, the pre-encoded image is subjected to MCTF filtering.

[0055] In the current hybrid coding framework, each frame of the video will first be divided into a fixed-size maximum coding unit LCU, and may be further divided into coding units of variable size CU. Each CU first uses inter-frame or intra-frame prediction technology to obtain a predicted image. The difference between the predicted image and the original image, also known as the residual, will be transformed and quantized and sent to the entropy encoder for encoding. Then it will be reconstructed through inverse quantization and inverse transformation, and finally reconstructed through loop filtering. The reconstructed image will enter the coded (reconstructed) image buffer in the encoder as a reference image for inter-frame prediction of subsequent coded frames.

[0056] The encoder will also perform a Lookahead pre-encoding process on the video before the formal encoding begins. This process buffers multiple consecutive images of the input video to form an original image queue, and traverses different frame types and reference structure combinations on the queue to calculate the pre-encoding cost of the combination and make dynamic frame type decisions. This cost calculation generally divides the image into fixed-size Lookahead units (for example, 8x8 size), performs simple intra-frame and inter-frame mode predictions on each Lookahead unit, and calculates the sum of the SATD costs. The encoding information generated will be saved to assist the subsequent formal encoding process.

[0057] In this embodiment, after the image is subjected to Lookahead precoding and before filtering formally begins, the Lookahead intraframe prediction cost intraSatd of the area covered by the current filtering unit is collected. The image can obtain the optimal SATD of each Lookahead unit during the Lookahead precoding process, and the intraframe prediction cost intraSatd refers to the sum of the optimal SATDs of all Lookahead units in the area covered by the filtering unit.

[0058] S202, performing filtering processing on the filtering unit, wherein an inter-frame prediction cost in the filtering process is obtained, and the filtering strength of the filtering unit is adjusted according to the magnitudes of the intra-frame prediction cost and the inter-frame prediction cost.

[0059] The filtering process in this embodiment adopts the MCTF algorithm. First, before the start of encoding, more important frames (such as I frames, P frames, etc.) in the mini-GOP of the frame sequence are selected as filtered frames, and several frames adjacent to the filtered frames in the display order are selected as reference frames.

[0060] like Figure 3 The figure shows a schematic diagram of a filtered frame and a reference frame of a frame sequence. Figure 3 A frame sequence of 9 frames is shown, and the solid line indicates the reference direction of the actual encoding. For example, frame 1 will bidirectionally reference frame 0 and frame 2. MCTF can select I and P frames 0, 4, and 8 for filtering, which are the filtered frames. For example, when filtering frame 4, frames 2, 3, 5, and 6 can be selected as filtering reference frames for motion estimation. It is worth noting that the motion estimation reference direction in MCTF may be opposite to the actual encoding.

[0061] Then, the filtered frame is divided into fixed-size filter units (e.g., 16x16, 32x32, etc.), and motion search is performed on each filter unit on all reference frames in turn to obtain the motion vector, and the motion compensation block is used to weight each pixel I of the filtered frame according to the following formula:

[0062] I'(x, y) = (I(x, y) + sum(w_k(x, y) * I_k(x + mvHor_k(x, y), y +mvVer_k(x, y))) / (1 + sum(w_k(x, y)))

[0063] Where x and y represent the current pixel position, I_k represents the kth filtered reference frame image, mvHor_k and mvVer_k represent the motion vectors referring to the kth filtered reference frame, and w_k represents the weight of the kth filtered reference frame. The weight depends on the algorithm implementation. In the prior art, the weight is generally related to the difference between the filtered frame pixel and the motion compensated pixel, the mini-GOP structure, QP and other coding parameters.

[0064] In this embodiment, in order to adjust the strength of the time domain filtering and thus reduce the compression efficiency loss caused by erroneous filtering, the weights calculated according to the original MCTF algorithm are modified.

[0065] The inter-frame prediction cost can also be called the motion estimation cost, which is the optimal motion vector cost generated by the motion compensation time domain filtering MCTF motion search for the filtering unit. After obtaining the motion compensated image according to the k-th filtering reference frame of the filtering unit, the distortion between the motion compensated image and the image before filtering of the filtering unit is determined, and the distortion value is used as the inter-frame prediction cost based on the filtering reference frame. In this embodiment, the distortion value is also represented by SATD, and the distortion value based on the k-th filtering reference frame, that is, the inter-frame prediction cost is interSatd_k.

[0066] For more details, see Figure 4 , is a detailed flow chart of the above step S202. It can be understood that the flow chart is not used to limit the order of executing the steps. Some steps in the flow chart can be added or deleted as needed. In this embodiment, the step S202 specifically includes:

[0067] S2020: When the intra-frame prediction cost is smaller than the inter-frame prediction cost, reduce the filtering strength of the filtering unit.

[0068] By comparing the intra-frame prediction cost and the inter-frame prediction cost, the possibility of intra-frame prediction and inter-frame prediction in the region in actual coding can be estimated. If the intra-frame prediction cost is smaller than the inter-frame prediction cost, it means that the possibility of intra-frame prediction is high, and the intensity of temporal filtering can be appropriately reduced, thereby reducing the compression efficiency loss caused by error filtering.

[0069] S2022: When the intra-frame prediction cost is greater than the inter-frame prediction cost, increase the filtering strength of the filtering unit.

[0070] If the intra-frame prediction cost is larger than the inter-frame prediction cost, it means that the possibility of inter-frame prediction is high, and the strength of time domain filtering can be appropriately enhanced, thereby improving the compression efficiency as a whole.

[0071] The specific way of adjusting the filtering strength in this embodiment is to multiply the weight of the filtering reference frame used (i.e., the weight w_k) by a strength correction coefficient when filtering all pixels belonging to the filtering unit. The strength correction coefficient is determined according to the magnitude of the intra-frame prediction cost and the inter-frame prediction cost. Specifically, the strength correction coefficient is negatively correlated with the intra-frame prediction cost and positively correlated with the inter-frame prediction cost.

[0072] In an optional embodiment, the strength correction coefficient (S_k) can be set according to the following formula:

[0073] S_k = min(2.0, ((a * QP * intraSatd + c) / (interSatd_k + c))^2),

[0074] Wherein, a and c are empirical coefficients, QP is a quantization parameter, intraSatd is the intra prediction cost, and interSatd_k is the inter prediction cost based on the kth filtering reference frame of the filtering unit. In this embodiment, after multiple experiments and studies, the empirical coefficients a and c can be taken as 0.0125 and 64 respectively.

[0075] The constant value 2.0 is used to limit the size of the strength correction coefficient to avoid problems in subsequent processing caused by the calculated result of the strength correction coefficient being too large. That is, when the calculated result is less than or equal to 2.0, the strength correction coefficient is assigned to the calculated result; and when the calculated result is greater than 2.0, the strength correction coefficient is directly assigned to 2.0.

[0076] When the intra-frame prediction cost is smaller than the inter-frame prediction cost, the strength correction coefficient is less than 1, which reduces the MCTF filtering strength; conversely, when the intra-frame prediction cost is larger than the inter-frame prediction cost, the strength correction coefficient is greater than 1, which enhances the MCTF filtering strength.

[0077] In this embodiment, when filtering all pixels belonging to the current filtering unit, the following weight is used: w'_k(x, y) = w_k(x, y) * s_k. The other filtering processes of this embodiment are consistent with the filtering processes of the original MCTF algorithm and are not described here.

[0078] The image filtering processing method proposed in this embodiment can use the intra-frame prediction cost obtained in the Lookahead pre-coding and the inter-frame prediction cost generated by motion estimation in the MCTF to estimate the possibility of intra-frame prediction and inter-frame prediction in the area in actual coding, so as to adjust the intensity of the time domain filtering of the current filtering unit accordingly, reduce the compression efficiency loss caused by erroneous filtering, and improve the compression efficiency as a whole.

[0079] Embodiment 2

[0080] like Figure 5 FIG. 2 is a schematic diagram of the hardware architecture of an electronic device 20 according to the second embodiment of the present application. In this embodiment, the electronic device 20 may include, but is not limited to, a memory 21, a processor 22, and a network interface 23 that can be interconnected via a system bus. It should be noted that Figure 5 Only the electronic device 20 having components 21-23 is shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead. In this embodiment, the electronic device 20 may be a device of the client or the server.

[0081] The memory 21 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 21 can be an internal storage unit of the electronic device 20, such as a hard disk or memory of the electronic device 20. In other embodiments, the memory 21 can also be an external storage device of the electronic device 20, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the electronic device 20. Of course, the memory 21 can also include both the internal storage unit of the electronic device 20 and its external storage device. In this embodiment, the memory 21 is generally used to store the operating system and various application software installed in the electronic device 20, such as the program code of the image filtering processing system 60, etc. In addition, the memory 21 can also be used to temporarily store various types of data that have been output or are to be output.

[0082] The processor 22 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 22 is generally used to control the overall operation of the electronic device 20. In this embodiment, the processor 22 is used to run the program code stored in the memory 21 or process data, such as running the image filtering processing system 60.

[0083] The network interface 23 may include a wireless network interface or a wired network interface. The network interface 23 is generally used to establish a communication connection between the electronic device 20 and other electronic devices.

[0084] Embodiment 3

[0085] like Figure 6 As shown, a module schematic diagram of an image filtering processing system 60 is proposed in the third embodiment of the present application. The image filtering processing system 60 can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can perform specific functions. The following description will specifically introduce the functions of each program module in this embodiment.

[0086] In this embodiment, the image filtering processing system 60 includes:

[0087] The collection module 600 is used to perform Lookahead precoding on the image to be processed and collect the Lookahead intra-frame prediction cost of the area covered by the current filtering unit before filtering begins.

[0088] This embodiment uses an encoder that implements the Lookahead and MCTF algorithms. When encoding, the encoder first pre-encodes the current image in the Lookahead, calculates the frame structure of the sequence, QP information and other parameters, and saves the pre-encoded intra-frame prediction cost. Then, the pre-encoded image is filtered by MCTF.

[0089] In this embodiment, after the image is subjected to Lookahead precoding and before filtering formally begins, the Lookahead intraframe prediction cost intraSatd of the area covered by the current filtering unit is collected. The image can obtain the optimal SATD of each Lookahead unit during the Lookahead precoding process, and the intraframe prediction cost intraSatd refers to the sum of the optimal SATDs of all Lookahead units in the area covered by the filtering unit.

[0090] The filtering module 602 is used to perform filtering processing on the filtering unit, wherein the inter-frame prediction cost in the filtering process is obtained, and the filtering strength of the filtering unit is adjusted according to the size of the intra-frame prediction cost and the inter-frame prediction cost.

[0091] The filtering process in this embodiment adopts the MCTF algorithm. First, before the start of encoding, more important frames (such as I frames, P frames, etc.) in the mini-GOP of the frame sequence are selected as filtered frames, and several frames adjacent to the filtered frames in the display order are selected as reference frames.

[0092] Then, the filtered frame is divided into fixed-size filter units (e.g., 16x16, 32x32, etc.), and motion search is performed on each filter unit on all reference frames in turn to obtain the motion vector, and the motion compensation block is used to weight each pixel I of the filtered frame according to the following formula:

[0093] I'(x, y) = (I(x, y) + sum(w_k(x, y) * I_k(x + mvHor_k(x, y), y +mvVer_k(x, y))) / (1 + sum(w_k(x, y)))

[0094] Where x and y represent the current pixel position, I_k represents the kth filtered reference frame image, mvHor_k and mvVer_k represent the motion vectors referring to the kth filtered reference frame, and w_k represents the weight of the kth filtered reference frame. The weight depends on the algorithm implementation. In the prior art, the weight is generally related to the difference between the filtered frame pixel and the motion compensated pixel, the mini-GOP structure, QP and other coding parameters.

[0095] In this embodiment, in order to adjust the strength of the time domain filtering and thus reduce the compression efficiency loss caused by erroneous filtering, the weights calculated according to the original MCTF algorithm are modified.

[0096] The inter-frame prediction cost can also be called the motion estimation cost, which is the optimal motion vector cost generated by the motion compensation time domain filtering MCTF motion search for the filtering unit. After obtaining the motion compensated image according to the k-th filtering reference frame of the filtering unit, the distortion between the motion compensated image and the image before filtering of the filtering unit is determined, and the distortion value is used as the inter-frame prediction cost based on the filtering reference frame. In this embodiment, the distortion value is also represented by SATD, and the distortion value based on the k-th filtering reference frame, that is, the inter-frame prediction cost is interSatd_k.

[0097] According to the size of the intra-frame prediction cost and the inter-frame prediction cost, the filtering strength of the filtering unit is adjusted accordingly. When the intra-frame prediction cost is smaller than the inter-frame prediction cost, the filtering strength of the filtering unit is reduced. When the intra-frame prediction cost is larger than the inter-frame prediction cost, the filtering strength of the filtering unit is increased.

[0098] By comparing the intra-frame prediction cost and the inter-frame prediction cost, the possibility of intra-frame prediction and inter-frame prediction in the region in actual coding can be estimated. If the intra-frame prediction cost is smaller than the inter-frame prediction cost, it means that the possibility of intra-frame prediction is high, and the intensity of temporal filtering can be appropriately reduced, thereby reducing the compression efficiency loss caused by error filtering.

[0099] If the intra-frame prediction cost is larger than the inter-frame prediction cost, it means that the possibility of inter-frame prediction is high, and the strength of time domain filtering can be appropriately enhanced, thereby improving the compression efficiency as a whole.

[0100] The specific way of adjusting the filtering strength in this embodiment is to multiply the weight of the filtering reference frame used (i.e., the weight w_k) by a strength correction coefficient when filtering all pixels belonging to the filtering unit. The strength correction coefficient is determined according to the magnitude of the intra-frame prediction cost and the inter-frame prediction cost. Specifically, the strength correction coefficient is negatively correlated with the intra-frame prediction cost and positively correlated with the inter-frame prediction cost.

[0101] In an optional embodiment, the strength correction coefficient (S_k) can be set according to the following formula:

[0102] S_k = min(2.0, ((a * QP * intraSatd + c) / (interSatd_k + c))^2),

[0103] Wherein, a and c are empirical coefficients, QP is a quantization parameter, intraSatd is the intra prediction cost, and interSatd_k is the inter prediction cost based on the kth filtering reference frame of the filtering unit. In this embodiment, after multiple experiments and studies, the empirical coefficients a and c can be taken as 0.0125 and 64 respectively.

[0104] When the intra-frame prediction cost is smaller than the inter-frame prediction cost, the strength correction coefficient is less than 1, which reduces the MCTF filtering strength; conversely, when the intra-frame prediction cost is larger than the inter-frame prediction cost, the strength correction coefficient is greater than 1, which enhances the MCTF filtering strength.

[0105] In this embodiment, when filtering all pixels belonging to the current filtering unit, the following weight is used: w'_k(x, y) = w_k(x, y) * s_k. The other filtering processes of this embodiment are consistent with the filtering processes of the original MCTF algorithm and are not described here.

[0106] The image filtering processing system proposed in this embodiment can use the intra-frame prediction cost obtained in the Lookahead pre-coding and the inter-frame prediction cost generated by motion estimation in the MCTF to estimate the possibility of intra-frame prediction and inter-frame prediction in the area in actual coding, so as to adjust the intensity of the time domain filtering of the current filtering unit accordingly, reduce the compression efficiency loss caused by erroneous filtering, and improve the compression efficiency as a whole.

[0107] Embodiment 4

[0108] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores an image filtering processing program, and the image filtering processing program can be executed by at least one processor so that the at least one processor performs the steps of the image filtering processing method as described above.

[0109] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, referred to as SMC), a secure digital (Secure Digital, referred to as SD) card, a flash card, etc. Of course, the computer-readable storage medium may also include both an internal storage unit of a computer device and an external storage device thereof. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on a computer device, such as the program code of the image filtering processing method in the embodiment, etc. In addition, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.

[0110] Embodiment 5

[0111] The present application also provides a computer program product, which stores an image filtering processing program. The image filtering processing program can be executed by at least one processor so that the at least one processor performs the steps of the image filtering processing method as described above.

[0112] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0113] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0114] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.

[0115] The above are only preferred embodiments of the embodiments of the present application, and are not intended to limit the patent scope of the embodiments of the present application. Any equivalent structure or equivalent process transformation made using the description and drawings of the embodiments of the present application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the embodiments of the present application.

Claims

1. An image filtering processing method, characterized in that: The method comprises: Perform Lookahead precoding on the image to be processed, and collect the Lookahead intra-frame prediction cost of the area covered by the current filtering unit before filtering begins; The filtering unit is subjected to filtering processing, wherein an inter-frame prediction cost in the filtering process is obtained, and according to the sizes of the intra-frame prediction cost and the inter-frame prediction cost corresponding to the filtering unit, the possibility of intra-frame prediction and inter-frame prediction of the filtering unit in actual encoding is estimated, thereby adjusting the filtering strength of the filtering unit, and the adjustment includes increasing or decreasing the filtering strength of the filtering unit.

2. The image filtering processing method according to claim 1, characterized in that: The adjusting the filtering strength of the filtering unit comprises: When the intra-frame prediction cost is smaller than the inter-frame prediction cost, reducing the filtering strength of the filtering unit; When the intra prediction cost is greater than the inter prediction cost, the filtering strength of the filtering unit is increased.

3. The image filtering processing method according to claim 1 or 2, characterized in that: The adjusting the filtering strength of the filtering unit includes: When filtering all pixels belonging to the filtering unit, the weight of the used filtering reference frame is multiplied by an intensity correction coefficient, and the intensity correction coefficient is determined according to the magnitude of the intra-frame prediction cost and the inter-frame prediction cost.

4. The image filtering processing method according to claim 3, characterized in that: The strength correction coefficient is determined according to the size of the intra-frame prediction cost and the inter-frame prediction cost in the filtering process, including: The strength correction coefficient is negatively correlated with the intra-frame prediction cost and positively correlated with the inter-frame prediction cost.

5. The image filtering processing method according to claim 4, characterized in that: The intensity correction factor is S_k = min(2.0, ((a * QP * intraSatd + c) / (interSatd_k+ c))^2), Among them, a and c are empirical coefficients, QP is a quantization parameter, intraSatd is the intra-frame prediction cost, and interSatd_k is the inter-frame prediction cost based on the kth filtering reference frame of the filtering unit.

6. The image filtering processing method according to claim 1, characterized in that: The inter-frame prediction cost is an optimal motion vector cost generated by performing motion compensation time domain filtering MCTF motion search on the filtering unit.

7. The image filtering processing method according to claim 1, characterized in that: The inter-frame prediction cost in the filtering process includes: After obtaining a motion compensated image according to the filtered reference frame of the filtering unit, the distortion between the motion compensated image and the image before filtering by the filtering unit is determined, and the distortion value is used as the inter-frame prediction cost based on the filtered reference frame.

8. An image filtering processing system, characterized in that: The system comprises: A collection module is used to perform Lookahead precoding on the image to be processed and collect the Lookahead intra-frame prediction cost of the area covered by the current filtering unit before filtering begins; A filtering module is used to perform filtering processing on the filtering unit, wherein the inter-frame prediction cost in the filtering process is obtained, and according to the size of the intra-frame prediction cost and the inter-frame prediction cost corresponding to the filtering unit, the possibility of intra-frame prediction and inter-frame prediction of the filtering unit in actual encoding is estimated, thereby adjusting the filtering strength of the filtering unit, and the adjustment includes increasing or decreasing the filtering strength of the filtering unit.

9. An electronic device, characterized in that: The electronic device includes: a memory, a processor, and an image filtering processing program stored in the memory and executable on the processor, wherein the image filtering processing program implements the image filtering processing method according to any one of claims 1 to 7 when executed by the processor.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an image filtering processing program, and when the image filtering processing program is executed by a processor, the image filtering processing method according to any one of claims 1 to 7 is implemented.

11. A computer program product, characterized in that The computer program product stores an image filtering processing program, and when the image filtering processing program is executed by a processor, the image filtering processing method according to any one of claims 1 to 7 is implemented.