A frequency domain pre-filtering method and related apparatus
Patent Information
- Application Number
- CN202310035053.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-10
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-01-10
AI Technical Summary
然而,现有在视频编解码的前处理过程中使用DCT变换时,普遍直接在频域系数上进行处理,处理后的图像帧仍存在无法有效压缩的问题
[0034] Beneficial Effects: Compared with existing technologies, this application provides a frequency domain pre-filtering method and related apparatus. The method includes dividing the frame to be filtered into several image blocks and determining the suppression coefficient of each image block based on the spatial gradient value of each image block; obtaining the frequency domain coefficients corresponding to the frame to be filtered and determining the target pixels in each image block based on the frequency domain coefficients; and performing frequency domain filtering on the target pixels in each image block based on the suppression coefficients corresponding to each image block to obtain a filtered image frame. This application determines the suppression coefficients corresponding to each image block based on the spatial gradient of each image block, and then uses the suppression coefficients corresponding to each image block to filter the frequency domain coefficients of the image blocks. This combines frequency domain information and spatial domain information of the frame to be filtered for video encoding preprocessing, which can save the encoding bitrate of the frame to be filtered without compromising the subjective quality of the image.
Smart Images

Figure CN116132687B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field, and in particular to a frequency domain pre-filtering method and related apparatus. Background Technology
[0002] In the field of video image coding, the Discrete Cosine Transform (DCT) is an essential step. It is a type of Fourier Transform that aims to transform an image from the spatial domain to the frequency domain for effective compression. Furthermore, low-frequency components in an image represent areas with low brightness gradients (i.e., relatively flat areas), while high-frequency components often represent areas with large gradient changes (such as contours and noise). Therefore, the DCT can also be used in the preprocessing stage of video encoding and decoding. By selectively manipulating the coefficients in the frequency domain, it can achieve maximum image distortion imperceptible to the human eye, thereby effectively reducing the coding bitrate without sacrificing subjective video quality. However, current methods of using the DCT in preprocessing for video encoding and decoding typically process the frequency domain coefficients directly, resulting in image frames that still suffer from ineffective compression.
[0003] Therefore, the existing technology still needs to be improved and enhanced. Summary of the Invention
[0004] The technical problem to be solved by this application is to provide a frequency domain pre-filtering method and related apparatus to address the shortcomings of the prior art.
[0005] To address the aforementioned technical problems, a first aspect of this application provides a frequency domain pre-filtering method, the method comprising:
[0006] The frame to be filtered is divided into several image blocks, and the suppression coefficient of each image block is determined based on the spatial gradient value of each image block.
[0007] Obtain the frequency domain coefficients corresponding to the frame to be filtered, and determine the target pixel points in each image block based on the frequency domain coefficients;
[0008] Based on the suppression coefficients corresponding to each image block, frequency domain filtering is performed on the target pixels in each image block to obtain the filtered image frame.
[0009] In the aforementioned frequency domain pre-filtering method, dividing the frame to be filtered into several image blocks specifically involves:
[0010] The luminance component of the frame to be filtered is divided into several image blocks.
[0011] The frequency domain pre-filtering method, wherein determining the suppression coefficient of each image block based on the spatial gradient value of each image block specifically includes:
[0012] Obtain the spatial gradient value corresponding to each image patch, and determine the target spatial gradient value based on the spatial gradient values of all image patches;
[0013] The suppression coefficient corresponding to each image block is determined based on the spatial gradient value of each image block and the target spatial gradient value.
[0014] The frequency domain pre-filtering method, wherein determining the suppression coefficient corresponding to each image patch based on the spatial domain gradient value corresponding to each image patch and the target spatial domain gradient value specifically includes:
[0015] For each image patch, the spatial gradient value of the image patch is compared with the target spatial gradient value;
[0016] If the spatial gradient value is greater than the target spatial gradient value, then the suppression coefficient of the image patch is set to the first suppression coefficient.
[0017] If the spatial gradient value is less than or equal to the target spatial gradient value, then the suppression coefficient of the image patch is set as a second suppression coefficient, wherein the second suppression coefficient is greater than the first suppression coefficient.
[0018] In the frequency domain pre-filtering method, the target spatial gradient value is the average of the spatial gradient values of each image block.
[0019] The frequency domain pre-filtering method, wherein obtaining the frequency domain coefficients corresponding to the frame to be filtered and determining the target pixel points in each image block based on the frequency domain coefficients specifically includes:
[0020] The frequency domain coefficients corresponding to the frame to be filtered are determined by discrete cosine transform.
[0021] Based on the frequency domain coefficients, determine the frequency domain coefficient histogram statistics corresponding to the frame to be filtered, and determine the frequency domain coefficient threshold based on the frequency domain coefficient histogram statistics;
[0022] For each image block, select the pixels in the image block whose frequency domain coefficients are less than the frequency domain coefficient threshold, and use the selected pixels as the target pixels.
[0023] The frequency domain pre-filtering method, wherein the step of performing frequency domain filtering on the target pixels in each image block based on the suppression coefficient corresponding to each image block specifically includes:
[0024] The frequency domain coefficients of the target pixels in each image block are multiplied by the suppression coefficients corresponding to each image block to obtain candidate image frames.
[0025] Perform a discrete cosine transform on the candidate image frame to obtain the filtered image frame.
[0026] A second aspect of this application provides a frequency domain pre-filtering device, the device comprising:
[0027] The first determining module is used to divide the frame to be filtered into several image blocks and determine the suppression coefficient of each image block based on the spatial gradient value of each image block.
[0028] The second determining module is used to obtain the frequency domain coefficients corresponding to the frame to be filtered, and to determine the target pixel points in each image block based on the frequency domain coefficients.
[0029] The filtering module is used to perform frequency domain filtering on the target pixels in each image block based on the suppression coefficient corresponding to each image block, so as to obtain the filtered image frame.
[0030] A third aspect of this application provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps in any of the frequency domain pre-filtering methods described above.
[0031] A fourth aspect of this application provides a terminal device, which includes: a processor, a memory, and a communication bus; the memory stores a computer-readable program that can be executed by the processor;
[0032] The communication bus enables communication between the processor and the memory;
[0033] When the processor executes the computer-readable program, it implements the steps in any of the frequency domain pre-filtering methods described above.
[0034] Beneficial Effects: Compared with existing technologies, this application provides a frequency domain pre-filtering method and related apparatus. The method includes dividing the frame to be filtered into several image blocks and determining the suppression coefficient of each image block based on the spatial gradient value of each image block; obtaining the frequency domain coefficients corresponding to the frame to be filtered and determining the target pixels in each image block based on the frequency domain coefficients; and performing frequency domain filtering on the target pixels in each image block based on the suppression coefficients corresponding to each image block to obtain a filtered image frame. This application determines the suppression coefficients corresponding to each image block based on the spatial gradient of each image block, and then uses the suppression coefficients corresponding to each image block to filter the frequency domain coefficients of the image blocks. This combines frequency domain information and spatial domain information of the frame to be filtered for video encoding preprocessing, which can save the encoding bitrate of the frame to be filtered without compromising the subjective quality of the image. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 A flowchart of the frequency domain pre-filtering method provided in this application.
[0037] Figure 2 A flowchart illustrating the frequency domain pre-filtering method provided in this application.
[0038] Figure 3 This is an example graph showing the histogram statistics of frequency domain coefficients.
[0039] Figure 4 The schematic diagram of the frequency domain pre-filter loading provided in this application.
[0040] Figure 5 A schematic diagram of the terminal device provided in this application. Detailed Implementation
[0041] This application provides a frequency domain pre-filtering method and related apparatus. To make the objectives, technical solutions, and effects of this application clearer and more explicit, the following detailed description is provided with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining this application and are not intended to limit this application.
[0042] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0043] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0044] It should be understood that the sequence number and size of each step in this embodiment do not imply the order of execution. The execution order of each process is determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application embodiment.
[0045] Research has shown that Discrete Cosine Transform (DCT) is an essential step in video image coding. A type of Fourier Transform, it aims to transform an image from the spatial domain to the frequency domain for effective compression. Furthermore, low-frequency components in an image represent areas with low brightness gradients (i.e., flatter regions), while high-frequency components often represent areas with large gradient changes (such as contours and noise). Therefore, DCT can also be used in the preprocessing stage of video encoding and decoding. By selectively manipulating the coefficients in the frequency domain, it can achieve maximum image distortion imperceptible to the human eye, thereby effectively reducing the coding bitrate without sacrificing subjective video quality. However, current methods of using DCT in preprocessing for video encoding and decoding typically process the frequency domain coefficients directly, resulting in image frames that still cannot be effectively compressed.
[0046] To address the aforementioned issues, in this embodiment, the frame to be filtered is divided into several image blocks, and the suppression coefficient of each image block is determined based on its spatial gradient value. The frequency domain coefficients corresponding to the frame to be filtered are obtained, and the target pixels in each image block are determined based on these frequency domain coefficients. Frequency domain filtering is then performed on the target pixels in each image block based on their respective suppression coefficients to obtain the filtered image frame. This application determines the suppression coefficients corresponding to each image block based on their spatial gradients, and then uses these suppression coefficients to filter the frequency domain coefficients of the image blocks. This combination of frequency domain information and spatial domain information of the frame to be filtered for video encoding preprocessing can save on the encoding bitrate of the frame to be filtered without compromising the subjective quality of the image.
[0047] The application content will be further explained below with reference to the accompanying drawings and the description of the embodiments.
[0048] This embodiment provides a frequency domain pre-filtering method, such as... Figure 1 As shown, the method includes:
[0049] S10. Divide the frame to be filtered into several image blocks, and determine the suppression coefficient of each image block based on the spatial gradient value of each image block.
[0050] Specifically, the frame to be filtered can be a video frame in a video sequence, such as a video frame in an 8K video. Each of the several image blocks includes a portion of the image region of the frame to be filtered, and the image blocks do not overlap with each other; that is, the frame to be filtered is divided into several non-overlapping image blocks.
[0051] In one implementation, after the frame to be filtered is transformed from the spatial domain to the frequency domain, the low-frequency components of the frame represent regions with low brightness gradients, while the high-frequency components represent regions with large brightness gradients (e.g., contours, noise). Therefore, when dividing the frame to be filtered into several image blocks, the brightness components of the frame can be divided into several image blocks. Specifically, dividing the frame to be filtered into several image blocks involves equally dividing the brightness components of the frame into several image blocks. This division can be achieved by first splitting the frame to obtain its corresponding brightness components, and then further dividing these brightness components into several image blocks of the same size, where these image blocks do not overlap.
[0052] The suppression coefficient of each image block is determined based on the spatial gradient value of each image block. The suppression coefficient is inversely proportional to the spatial gradient value. That is, an image block with a small spatial gradient value has a large suppression coefficient, and an image block with a large spatial gradient value has a small suppression coefficient. Since a small spatial gradient value indicates that the image block is in a flat region, a large suppression coefficient can be used. A large spatial gradient indicates that the image block contains contours or noise, and a small suppression coefficient is required to avoid affecting the contour clarity. This ensures that the contours and details of the frame to be filtered are not affected, and also saves the encoded bitstream of the frame to be filtered.
[0053] In one implementation, determining the suppression coefficient of each image patch based on the spatial gradient value of each image patch specifically includes:
[0054] Obtain the spatial gradient value corresponding to each image patch, and determine the target spatial gradient value based on the spatial gradient values of all image patches;
[0055] The suppression coefficient corresponding to each image block is determined based on the spatial gradient value of each image block and the target spatial gradient value.
[0056] Specifically, the spatial gradient value may include edge detection values in the horizontal direction and edge detection values in the vertical direction, wherein the spatial gradient is calculated as follows:
[0057] G = G x +G y
[0058]
[0059] Where G represents the spatial gradient, G x G represents the edge detection value in the horizontal direction. y The vertical edge detection value is represented by I(x,y), which represents a 3x3 matrix of the reference image patch centered at (x,y). * represents convolution operation, and || is the absolute value operation.
[0060] The target spatial gradient value reflects the overall gradient of the frame to be filtered, and the target spatial gradient threshold is used to measure the flatness of image patches. In other words, the spatial gradient values of each image patch can be compared with the target spatial gradient value to determine whether a large or small suppression coefficient should be used for the image patch. The target spatial gradient can be the average of the spatial gradient values of each image patch, or a weighted average of the spatial gradient values of each image patch. In one implementation, the target spatial gradient value is the average of the spatial gradient values of each image patch. That is, after calculating the spatial gradient values of each image patch, the average of the spatial gradient values of each image patch is calculated, and the calculated average is used as the target spatial gradient value.
[0061] In one implementation, determining the suppression coefficient corresponding to each image patch based on its corresponding spatial gradient value and the target spatial gradient value specifically includes:
[0062] For each image patch, the spatial gradient value of the image patch is compared with the target spatial gradient value;
[0063] If the spatial gradient value is greater than the target spatial gradient value, then the suppression coefficient of the image patch is set to the first suppression coefficient.
[0064] If the spatial gradient value is less than or equal to the target spatial gradient value, then the suppression coefficient of the image patch is set as the second suppression coefficient.
[0065] Specifically, both the first and second suppression coefficients are preset, with the second suppression coefficient being greater than the first suppression coefficient. That is, when the spatial gradient value is less than or equal to the target spatial gradient value, the second suppression coefficient is used for the image patch; when the spatial gradient value is less than the target spatial gradient value, the first suppression coefficient is used. This is because when the spatial gradient value is less than or equal to the target spatial gradient value, it indicates that the image patch is in a flat region of the frame to be filtered. Using a larger second suppression coefficient for filtering in the frequency domain will not cause a decrease in the subjective quality of the image patch and can also reduce the bitrate of subsequent encoding. Of course, in practical applications, when the spatial gradient value is less than or equal to the target spatial gradient value, the corresponding suppression coefficient can be selected based on the interval in which the spatial gradient value is located. For example, several spatial gradient intervals can be preset, each corresponding to a suppression coefficient, with the magnitude of the suppression coefficient inversely proportional to the upper (or lower) limit of the spatial gradient interval. When the spatial gradient value is greater than the target spatial gradient value, a fixed suppression coefficient can be set directly, or no filtering can be performed.
[0066] S20. Obtain the frequency domain coefficients corresponding to the frame to be filtered, and determine the target pixel points in each image block based on the frequency domain coefficients.
[0067] Specifically, the frequency domain coefficients can be determined by transforming the frame to be filtered from the spatial domain to the frequency domain. This transformation can be performed using a discrete cosine transform (DCT). In other words, before performing pre-domain filtering on the frame, a DCT can be applied to convert the frame to the frequency domain to obtain its corresponding frequency domain coefficients. The target pixel is a pixel within an image block, and its frequency domain coefficients meet preset requirements, such as being less than a preset frequency domain coefficient threshold. This preset threshold can be pre-set or adaptively determined based on the frequency domain coefficients of the frame to be filtered.
[0068] In one implementation, obtaining the frequency domain coefficients corresponding to the frame to be filtered and determining the target pixel points in each image block based on the frequency domain coefficients specifically includes:
[0069] The frequency domain coefficients corresponding to the frame to be filtered are determined by discrete cosine transform.
[0070] Based on the frequency domain coefficients, determine the frequency domain coefficient histogram statistics corresponding to the frame to be filtered, and determine the frequency domain coefficient threshold based on the frequency domain coefficient histogram statistics;
[0071] For each image block, select the pixels in the image block whose frequency domain coefficients are less than the frequency domain coefficient threshold, and use the selected pixels as the target pixels.
[0072] Specifically, the frequency domain coefficient histogram statistics can be achieved by dividing the range of absolute values of the frequency domain coefficients of the frame to be filtered into several intervals (e.g., 100 intervals), and then counting the number of pixels whose values fall into each interval to form the frequency domain coefficient histogram statistics of the frame to be filtered. For example, as shown in the figure... Figure 3 The frequency domain coefficient histogram statistics are shown below. Pixels falling within an interval refer to pixels whose absolute frequency domain coefficient value falls within that interval. In other words, for each interval, the number of pixels whose absolute frequency domain coefficient value falls within that interval is counted to obtain the number of pixels corresponding to each interval, thus forming the frequency domain coefficient histogram statistics of the frame to be filtered.
[0073] After obtaining the frequency domain coefficient histogram statistics, a preset number of absolute frequency domain coefficient thresholds are determined based on these statistics, and these thresholds are used as the overall frequency domain coefficient thresholds. For example, the absolute frequency domain coefficient threshold corresponding to 85% of the pixels can be selected. In other words, the filtering frequency domain band is determined based on the absolute frequency domain coefficient threshold corresponding to 85% of the pixels. Then, frequency domain filtering is performed on the target pixels within the filtering frequency domain band. This adaptive determination of the filtering frequency band based on the frame to be filtered can improve the filtering effect.
[0074] S30. Based on the suppression coefficients corresponding to each image block, frequency domain filtering is performed on the target pixels in each image block to obtain the filtered image frame.
[0075] Specifically, after determining the suppression coefficients and target pixels for each image block, frequency domain filtering is performed on the target pixels based on the suppression coefficients, while non-target pixels in the image block are not subject to frequency domain filtering. This approach achieves the effect of frequency domain filtering by preserving the contour details of the frame being filtered without affecting its subjective quality.
[0076] In one implementation, the step of performing frequency domain filtering on the target pixels in each image block based on the suppression coefficient corresponding to each image block specifically includes:
[0077] The frequency domain coefficients of the target pixels in each image block are multiplied by the suppression coefficients corresponding to each image block to obtain candidate image frames.
[0078] Perform a discrete cosine transform on the candidate image frame to obtain the filtered image frame.
[0079] Specifically, the frequency domain coefficients are multiplied by the suppression coefficients, and the product is used as the filtered frequency domain coefficients. In other words, for each image block, the frequency domain coefficients of the target pixel in that block are multiplied by the suppression coefficients to obtain the updated frequency domain coefficients for the target pixel. Then, each image block forms a candidate image frame, which resides in the frequency domain space. Therefore, after obtaining the candidate image frames, a discrete cosine transform is performed on them to obtain the filtered image frame.
[0080] In summary, this embodiment provides a frequency domain pre-filtering method. The method includes dividing the frame to be filtered into several image blocks and determining the suppression coefficient of each image block based on the spatial gradient value of each image block; obtaining the frequency domain coefficients corresponding to the frame to be filtered and determining the target pixels in each image block based on the frequency domain coefficients; and performing frequency domain filtering on the target pixels in each image block based on the suppression coefficients corresponding to each image block to obtain the filtered image frame. This application transforms the frame to be filtered into the frequency domain space using discrete cosine transform (DCT), determines the filtering frequency band based on the frequency domain coefficients of the transformed frame, determines the suppression coefficient of each image block in the frame based on the spatial gradient, and then uses the suppression coefficient corresponding to each image block to perform frequency domain filtering on the target pixels of each image block in the filtering frequency band. Finally, the filtered frame is subjected to inverse discrete cosine transform (DCT) to obtain the filtered image frame. By combining the frequency domain information and the spatial domain information of the frame to be filtered for video encoding preprocessing, the encoding bitrate of the frame to be filtered can be saved without compromising the subjective quality of the image (i.e., preserving the contour details in the frame to be filtered).
[0081] Based on the above frequency domain pre-filtering method, this embodiment provides a frequency domain pre-filtering device, such as... Figure 4 As shown, the device includes:
[0082] The first determining module 100 is used to divide the frame to be filtered into several image blocks and determine the suppression coefficient of each image block based on the spatial gradient value of each image block.
[0083] The second determining module 200 is used to obtain the frequency domain coefficients corresponding to the frame to be filtered, and to determine the target pixel points in each image block based on the frequency domain coefficients.
[0084] The filtering module 300 is used to perform frequency domain filtering on the target pixels in each image block based on the suppression coefficient corresponding to each image block, so as to obtain the filtered image frame.
[0085] Based on the above-described frequency domain pre-filtering method, this embodiment provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps in the frequency domain pre-filtering method described in the above embodiment.
[0086] Based on the above-described frequency domain pre-filtering method, this application also provides a terminal device, such as... Figure 5 As shown, it includes at least one processor 20; a display screen 21; and a memory 22, and may also include a communications interface 23 and a bus 24. The processor 20, display screen 21, memory 22, and communications interface 23 can communicate with each other via the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setup mode. The communications interface 23 can transmit information. The processor 20 can invoke logical instructions in the memory 22 to execute the methods described in the above embodiments.
[0087] Furthermore, the logical instructions in the aforementioned memory 22 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0088] The memory 22, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, such as program instructions or modules corresponding to the methods in the embodiments of this disclosure. The processor 20 executes functional applications and data processing by running the software programs, instructions, or modules stored in the memory 22, thereby implementing the methods in the above embodiments.
[0089] The memory 22 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 22 may include high-speed random access memory (RAM) and non-volatile memory. Examples include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, as well as transient storage media.
[0090] Furthermore, the specific process of loading and executing multiple instruction processors in the aforementioned storage medium and terminal device has been described in detail in the above method, and will not be repeated here.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A frequency domain pre-filtering method, characterized in that, The method includes: The luminance component of the frame to be filtered is divided into several image blocks, and the suppression coefficient of each image block is determined based on the spatial gradient value of each image block. Obtain the frequency domain coefficients corresponding to the frame to be filtered, and determine the target pixel points in each image block based on the frequency domain coefficients; Based on the suppression coefficients corresponding to each image block, frequency domain filtering is performed on the target pixels in each image block to obtain the filtered image frame. Specifically, the suppression coefficients based on each image block include: The spatial gradient value corresponding to each image patch is obtained, and the target spatial gradient value is determined based on the spatial gradient values of all image patches. The spatial gradient value includes the edge detection values in the horizontal direction and the edge detection values in the vertical direction. The target spatial gradient value is used as a basis for measuring the flatness of the image patch. For each image patch, the spatial gradient value of the image patch is compared with the target spatial gradient value; If the spatial gradient value is greater than the target spatial gradient value, then the suppression coefficient of the image patch is set to the first suppression coefficient. If the spatial gradient value is less than or equal to the target spatial gradient value, then the suppression coefficient of the image patch is set as a second suppression coefficient, wherein the second suppression coefficient is greater than the first suppression coefficient.
2. The frequency domain pre-filtering method according to claim 1, characterized in that, The target spatial gradient value is the average of the spatial gradient values of each image block.
3. The frequency domain pre-filtering method according to claim 1, characterized in that, The step of obtaining the frequency domain coefficients corresponding to the frame to be filtered and determining the target pixel points in each image block based on the frequency domain coefficients specifically includes: The frequency domain coefficients corresponding to the frame to be filtered are determined by discrete cosine transform. Based on the frequency domain coefficients, determine the frequency domain coefficient histogram statistics corresponding to the frame to be filtered, and determine the frequency domain coefficient threshold based on the frequency domain coefficient histogram statistics; For each image block, select the pixels in the image block whose frequency domain coefficients are less than the frequency domain coefficient threshold, and use the selected pixels as the target pixels.
4. The frequency domain pre-filtering method according to claim 3, characterized in that, The step of performing frequency domain filtering on the target pixels in each image block based on the suppression coefficient corresponding to each image block specifically includes: The frequency domain coefficients of the target pixels in each image block are multiplied by the suppression coefficients corresponding to each image block to obtain candidate image frames. Perform a discrete cosine transform on the candidate image frame to obtain the filtered image frame.
5. A frequency domain pre-filter device, characterized in that, The device includes: The first determining module is used to divide the luminance component of the frame to be filtered into several image blocks, and determine the suppression coefficient of each image block based on the spatial gradient value of each image block. The second determining module is used to obtain the frequency domain coefficients corresponding to the frame to be filtered, and to determine the target pixel points in each image block based on the frequency domain coefficients. The filtering module is used to perform frequency domain filtering on the target pixels in each image block based on the suppression coefficient corresponding to each image block, so as to obtain the filtered image frame. Specifically, the suppression coefficients based on each image block include: The spatial gradient value corresponding to each image patch is obtained, and the target spatial gradient value is determined based on the spatial gradient values of all image patches. The spatial gradient value includes the edge detection values in the horizontal direction and the edge detection values in the vertical direction. The target spatial gradient value is used as a basis for measuring the flatness of the image patch. For each image patch, the spatial gradient value of the image patch is compared with the target spatial gradient value; If the spatial gradient value is greater than the target spatial gradient value, then the suppression coefficient of the image patch is set to the first suppression coefficient. If the spatial gradient value is less than or equal to the target spatial gradient value, then the suppression coefficient of the image patch is set as a second suppression coefficient, wherein the second suppression coefficient is greater than the first suppression coefficient.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps in the frequency domain pre-filtering method as described in any one of claims 1-4.
7. A terminal device, characterized in that, include: Processor, memory, and communication bus; the memory stores a computer-readable program that can be executed by the processor; The communication bus enables communication between the processor and the memory; When the processor executes the computer-readable program, it implements the steps in the frequency domain pre-filtering method as described in any one of claims 1-4.
Citation Information
Patent Citations
Loop filtering method and device
CN112514401A