Filtering method, device, and storage medium

MYPI2025002920A0Undetermined Publication Date: 2024-05-14HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
MYPI2025002920
Authority / Receiving Office
MY · MY
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-11-14
Filing Date
2024-01-12
Publication Date
2024-05-14

AI Technical Summary

Technical Problem

The existing technology does not filter the authorized area, which affects the subjective and objective quality of the image.

Method used

By determining the filtering strategy and authority area of ​​the current filtering unit, classifying the samples in the filtering unit according to their authority level, and performing corresponding filtering operations based on the filtering strategy and classification results, constrained filtering of the authority area is achieved.

Benefits of technology

The subjective and objective quality of the image is improved, ensuring that areas with different permission levels are appropriately filtered according to permissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure PI2025002920_DRAWING_001
    Figure PI2025002920_DRAWING_001
  • Figure PI2025002920_DRAWING_002
    Figure PI2025002920_DRAWING_002
  • Figure PI2025002920_DRAWING_003
    Figure PI2025002920_DRAWING_003
Patent Text Reader

Abstract

The present disclosure discloses a filtering method, a device and a storage medium, and belongs to the field of image processing technology. In the present disclosure, by determining a filtering strategy corresponding to a current filtering unit and a permission region where the current filtering unit is located, determining a permission level of a sample within the current filtering unit according to the permission level of the permission region; classifying the sample within the current filtering unit according to the permission level of the sample; and performing a corresponding filtering operation on the current filtering unit according to the filtering strategy and a classification result, so that constrained filtering operations on permission regions is realized and the subjective and objective quality of images is improved. Fig 2.
Need to check novelty before this filing date? Find Prior Art

Description

Filtering method, device and storage medium Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a filtering method, device and storage medium. Background Art

[0002] Different areas in the encoded image have different permissions, which can be a level of confidentiality or other access rights. Users with the highest permissions can see the correct content of all areas. Users with the lowest permissions can only see the correct content of areas equal to their own permissions, and cannot see the correct content of areas with higher permissions. For example, these high-authority areas are presented to low-authority users as mosaic or obscured content. One application scenario of permission areas is to present correct images of different ranges to users with different permissions. In principle, users with higher permissions see a larger range of correct images and a smaller range of obscured images.

[0003] Existing solutions do not filter the permission area, which will affect the subjective and objective quality of the image.

[0004] The above content is only used to assist in understanding the technical solution of the present invention and does not constitute an admission that the above content is prior art.

[0005] Summary of the Invention

[0006] The main purpose of the present invention is to provide a filtering method, device and storage medium, aiming to solve the technical problem that the prior art does not filter the permission area, which affects the subjective and objective quality of the image.

[0007] To achieve the above object, the present invention provides a filtering method, which comprises the following steps:

[0008] Determine the filtering strategy and the authority area corresponding to the current filtering unit, where the authority area is an image area with an authority level in the image;

[0009] Determining the permission level of the sample in the current filtering unit according to the permission level of the permission area;

[0010] classifying the samples in the current filtering unit according to the permission level of the samples;

[0011] Perform corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result.

[0012] Optionally, the filtering strategy is determined by flag information parsed from the code stream, and the flag information is used for transmission at the sequence level, image level, slice level, tile level or filtering unit level.

[0013] Optionally, the permission region includes at least one filtering unit, the current filtering unit is allowed to span multiple permission regions, and the filtering unit includes at least one sample;

[0014] The determining the permission level of the sample in the current filtering unit according to the permission level of the permission area includes:

[0015] The permission level of the sample in the current filtering unit is consistent with the permission area where the sample is located.

[0016] Optionally, the current filtering unit is a basic unit in the filtering process and different filtering units are allowed to perform different filtering operations;

[0017] The performing corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result includes:

[0018] Not performing a filtering operation on a first sample in the current filtering unit, and performing a filtering operation on a second sample in the current filtering unit;

[0019] or,

[0020] Performing a filtering operation on all samples in the current filtering unit;

[0021] or,

[0022] No filtering operation is performed on any samples in the current filtering unit.

[0023] Optionally, the first sample is a non-filterable sample, and the second sample is a filterable sample.

[0024] Optionally, performing a filtering operation on all samples in the current filtering unit includes:

[0025] Converting non-filterable samples in the current filtering unit into filterable samples by deriving information of a reference block or reference sample, and performing a filtering operation on all filterable samples, wherein the information of the derived reference block or reference sample is derived from available blocks or available samples within and around the permission area, or is derived from preset information;

[0026] The available blocks or available samples are blocks or samples that have an authority lower than or equal to an authority of the non-filterable samples and have been decoded or encoded.

[0027] Optionally, include at least one of the following:

[0028] The samples in the current filtering unit that require reference block information during filtering and for which at least one reference block is unavailable are treated as unfilterable samples;

[0029] A sample in the current filtering unit that requires a reference sample during the filtering process and for which at least one reference sample is unavailable is considered as an unfilterable sample;

[0030] Determine a sample in the current filtering unit that requires a reference sample during filtering and for which all reference samples are unavailable as an unfilterable sample; or

[0031] Samples that require reference samples during the filtering process within the current filtering unit and whose proportion of unavailable reference samples among all reference samples is greater than or equal to a preset value are regarded as unfilterable samples.

[0032] Optionally, the filtering method further includes:

[0033] Determining whether the samples in the current filtering unit need to use reference block information during the filtering process according to a preset filtering method;

[0034] Whether the reference block is available is determined based on the authority of the sample and the authority of the reference block.

[0035] Optionally, the reference block is a block required for making a filtering decision and / or implementing a filtering operation, the reference block includes at least one sample, and the authority of the reference block is the highest authority of all samples in the reference block.

[0036] Optionally, the determining whether the reference block is available based on the permission of the sample and the permission of the reference block includes:

[0037] If the authority of the reference block is lower than or equal to the authority of the sample and at least one of the following preset conditions is met, then it is determined that the reference block is available;

[0038] The preset conditions include:

[0039] The reference block has been decoded or encoded;

[0040] The reference block and the sample are located in the same slice or tile; or

[0041] The reference block and the sample are located in different slices or tiles, and filtering is allowed on the boundary of the slice or tile.

[0042] Optionally, if the authority of the reference block is lower than or equal to the authority of the sample and at least one of the following preset conditions is satisfied, after determining that the reference block is available, the method further includes:

[0043] Derived reference block information by using decoded blocks or coded blocks with authority lower than or equal to that of the sample around the unavailable reference block, and / or, derived reference block information by using preset information;

[0044] The information of the unavailable reference block is replaced by the derived reference block information, so that the unavailable reference block is converted into an available reference block.

[0045] Optionally, the filtering method further includes:

[0046] Obtaining a reference sample corresponding to any sample in the current filtering unit according to a preset filtering method;

[0047] Whether the reference sample is available is determined by comparing the permissions of the sample and the permissions of the reference sample.

[0048] Optionally, the reference samples are samples required for making filtering decisions and / or performing filtering operations.

[0049] Optionally, the determining whether the reference sample is available based on the permission of the sample and the permission of the reference sample includes:

[0050] If the authority of the reference sample is lower than or equal to the authority of the sample, and at least one of the following preset conditions is met, then the reference sample is determined to be available;

[0051] The preset conditions include:

[0052] The reference sample has been decoded or encoded;

[0053] The reference sample and the sample are located in the same slice or tile; or

[0054] The reference sample and the sample are located in different slices or tiles, and filtering is allowed on the boundary of the slice or tile.

[0055] Optionally, if the authority of the reference sample is lower than or equal to the authority of the sample and at least one of the following preset conditions is satisfied, after determining that the reference sample is available, the method further includes:

[0056] Derived reference sample information by using decoded samples or coded samples with authority lower than or equal to that of the sample around the unavailable reference sample, and / or derived reference sample information by using preset information;

[0057] The information of the unavailable reference sample is replaced by the derived reference sample information, so that the unavailable reference sample is converted into an available reference sample.

[0058] Optionally, the preset filtering mode includes at least one of the following:

[0059] Deblocking filtering;

[0060] Sample adaptive compensation;

[0061] Enhanced sample adaptive compensation;

[0062] Adaptive compensation across component samples; or

[0063] Adaptive loop filtering.

[0064] In addition, to achieve the above objectives, the present invention also proposes a filtering device, which includes: a memory, a processor, and a filtering program stored in the memory and running on the processor, and the filtering program is configured to implement the filtering method described above.

[0065] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a filtering program is stored. When the filtering program is executed by a processor, the filtering method described above is implemented.

[0066] In addition, to achieve the above-mentioned object, the present invention further provides a filtering device, comprising:

[0067] An acquisition module, configured to determine a filtering strategy and a permission area corresponding to a current filtering unit, wherein the permission area is an image area with a permission level in the image;

[0068] an identification module, configured to determine the permission level of the sample in the current filtering unit according to the permission level of the permission area;

[0069] a classification module, configured to classify the samples in the current filtering unit according to the permission level of the samples;

[0070] A filtering module is used to perform corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result.

[0071] The present invention determines the filtering strategy corresponding to the current filtering unit and the authority area in which it is located; determines the authority level of samples in the current filtering unit according to the authority level of the authority area; classifies the samples in the current filtering unit according to the authority level of the samples; performs corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result, and performs different filtering operations on samples of different authority levels in each authority area according to the filtering strategy, thereby realizing constrained filtering operations on the authority area and improving the subjective and objective quality of the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] FIG1 is a schematic diagram of the structure of a filtering device in a hardware operating environment according to an embodiment of the present invention;

[0073] FIG2 is a schematic flow chart of a first embodiment of a filtering method according to the present invention;

[0074] FIG3 is a schematic diagram of a video coding framework structure in an embodiment of a filtering method of the present invention;

[0075] FIG4 is a schematic flow chart of a second embodiment of a filtering method according to the present invention;

[0076] FIG5 is a schematic diagram of reference samples of a deblocking filtering method in an embodiment of a filtering method of the present invention;

[0077] FIG6 is a schematic diagram of vertical boundaries and horizontal boundaries corresponding to a deblocking filtering method in an embodiment of a filtering method according to the present invention;

[0078] FIG7 is a schematic diagram of a reference sample of a sample adaptive compensation method in an embodiment of a filtering method of the present invention;

[0079] FIG8 is a schematic diagram of a reference block in a sample adaptive compensation method according to an embodiment of the filtering method of the present invention;

[0080] FIG9 is a schematic diagram of reference samples in an enhanced sample adaptive compensation method according to an embodiment of a filtering method of the present invention;

[0081] FIG10 is a schematic diagram of reference samples in an adaptive compensation method across component samples in an embodiment of a filtering method according to the present invention;

[0082] FIG11 is a schematic diagram of a reference sample of an adaptive loop filtering method in an embodiment of a filtering method of the present invention;

[0083] FIG12 is a schematic diagram of another reference sample of an adaptive loop filtering method in an embodiment of the filtering method of the present invention;

[0084] FIG13 is a schematic flow chart of a third embodiment of a filtering method according to the present invention;

[0085] FIG14 is a structural block diagram of the first embodiment of the filtering device of the present invention.

[0086] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0087] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0088] 1 , which is a schematic diagram of the structure of a filtering device in a hardware operating environment according to an embodiment of the present invention.

[0089] As shown in Figure 1, the filtering device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) memory or a stable non-volatile memory (NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0090] Those skilled in the art will appreciate that the structure shown in FIG1 does not limit the filtering device, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0091] As shown in FIG. 1 , the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a filtering program.

[0092] In the filtering device shown in Figure 1, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the filtering device of the present invention can be set in the filtering device, and the filtering device calls the filtering program stored in the memory 1005 through the processor 1001 and executes the filtering method provided by the embodiment of the present invention.

[0093] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0094] It should be noted that, in this document, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising 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 "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined based on their explanation in the specific embodiment or further combined with the context of the specific embodiment.

[0095] It should be understood that although the terms "first," "second," "third," etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are used solely to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the term "if," as used herein, may be interpreted as "upon," "when," or "in response to a determination." Furthermore, as used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms "comprising" and "including" indicate the presence of the recited features, steps, operations, elements, components, items, types, and / or groups, but do not preclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, types, and / or groups. The terms "or," "and / or," "including at least one of the following," etc., as used herein, may be interpreted as inclusive, meaning any one or any combination. For example, “comprising at least one of the following: A, B, C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”; and for another example, “A, B or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”. An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some manner.

[0096] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and they can be performed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0097] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to the determination" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)," depending on the context.

[0098] It should be noted that in this article, step codes such as S10 and S20 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the order. When implementing the step, those skilled in the art may execute S20 first and then S10, etc., but these should all be within the scope of protection of this application.

[0099] 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.

[0100] An embodiment of the present invention provides a filtering method. Referring to Figure 2, Figure 2 is a flow chart of a first embodiment of a filtering method of the present invention. The filtering method can be applied to the decoding method flow for processing video data, and can also be applied to the encoding method flow for processing video data.

[0101] In this embodiment, the filtering method includes the following steps:

[0102] Step S10: Determine the filtering strategy and the authority area corresponding to the current filtering unit, where the authority area is an image area with an authority level in the image.

[0103] The execution subject of this embodiment may be a filtering device, which may be implemented in various forms. For example, the filtering device described in this application may include mobile terminals or smart terminals such as tablet computers, laptop computers, PDAs, and cameras, as well as fixed terminal devices such as desktop computers. These devices all have image processing functions, and the subsequent description will use the filtering device as an example.

[0104] Figure 3 shows a video coding framework that includes prediction, transform, quantization, entropy coding, and filtering modules. The prediction module includes intra-frame prediction and inter-frame prediction. Intra-frame prediction uses reconstructed pixels around the current block to remove spatial redundancy, while inter-frame prediction uses reconstructed pixels from a temporal reference frame to remove temporal redundancy. The transform module linearly maps residual information in the spatial domain to a transform domain (e.g., the frequency domain), aiming to concentrate energy and remove frequency-domain signal correlation. Theoretically, the transform matrix is ​​reversible, resulting in no signal loss. The quantization module uses a "many-to-one" mapping process that is irreversible and can result in signal loss. However, its advantage is that it significantly reduces the signal's range of values, enabling the encoder to provide a good approximation of the original signal with a small number of symbols, thereby improving compression. The entropy coding module is a lossless coding method based on the principle of information entropy. It converts a series of element symbols representing a video sequence (such as transform coefficients and mode information) into a binary bitstream, removing statistical redundancy within these element symbols. The filtering module enhances the reconstructed image, aiming to make the reconstructed image closer to the original image while reducing the effects of blocking and ringing effects, thereby improving the quality of the reconstructed image.

[0105] In an optional embodiment, the filtering operation in this embodiment is for filtering the encoded image, and different areas in the encoded image have different permissions, which can be a confidentiality level or other access permission level. For users with the highest permissions, the correct content of all areas can be seen. For users with the lowest permissions, they can only see the correct content of areas equal to their own permissions, and cannot see the correct content of areas with higher permissions than their own. For example, these high-authority areas are presented to low-authority users with mosaic or obscured content. One application scenario of the permission area is to present correct images of different ranges to users with different permissions. Users with higher permissions see a larger range of correct images and a smaller range of obscured images.

[0106] However, current filtering methods do not filter samples within the permission area, which greatly affects the subjective and objective quality of the image. To address the above technical issues, this embodiment performs constrained filtering operations on permission areas of different permission levels based on the filtering operation and the permission level of the permission area. For example, filtering in high-privilege areas is not restricted because the surrounding reference sample information is available. For filtering in low-privilege areas, if reference samples are not available (for example, the reference samples are located in high-privilege areas), constrained filtering operations are required.

[0107] In this embodiment, when filtering an image, filtering is performed using a filtering unit as the basic unit in the filtering process. During filtering, each filtering unit can be filtered sequentially, or multiple filtering units can be filtered simultaneously. Each filtering unit corresponds to an image sub-region within the image. In contrast, a permission region is an image region with permission levels. For a single image, the image has multiple filtering units and also multiple permission regions. There is no corresponding relationship between the number of filtering units and the number of permission regions. A permission region can contain multiple filtering units. For example, permission region X can contain one filtering unit A, or it can contain two filtering units A and B at the same time. Furthermore, a filtering unit can also be located in multiple different permission regions. For example, filtering unit C can be located in permission region X, or it can span permission regions X and Y at the same time.

[0108] The filtering unit divides the image into multiple image regions in the horizontal and vertical directions. In this embodiment, the image can also be divided into a chroma component and a luminance component according to chroma and luminance. The filtering units contained in these two components are corresponding. A filtering unit can contain the above two components, and a component can also contain multiple filtering units. In this embodiment, the filtering process of the entire image is explained using the filtering unit as an example. In this embodiment, the number and size of the filtering units divided into a single image, as well as the number and size of the authority areas, can be set accordingly according to the actual image processing requirements, and are not limited in this embodiment.

[0109] In an optional embodiment, when filtering operations are performed on a filtering unit, the filtering operation is performed according to a corresponding filtering strategy, and each filtering unit can be allowed to execute different filtering strategies. Taking the current filtering unit as an example, the filtering strategy executed by the current filtering unit can be the same as the filtering strategies of other filtering units, or can be different from the filtering strategies of other filtering units. In this embodiment, the filtering strategy is determined by flag information, and the flag information can be transmitted at the sequence level (or SPS (Sequence Parameter Set) level), or the picture level (or PPS (Picture Parameter Set) level or frame level), or the slice level, or the tile level, or the filtering unit level (or the CTU (Coding Tree Unit) / CTB / LCU (Largest Coding Unit) / LCB (Largest Coding Block) level). The flag information is parsed from the bitstream, and the filtering strategy corresponding to each filtering unit can be determined based on the parsed flag information. The level of the filtering strategy can also be the patch level. The syntax used to manage or control multiple images can be called the sequence level; the syntax used to manage or control a single frame image can be called the picture level; the syntax used to manage or control a parallel unit (i.e., an image region) including multiple coding units can be called the slice level, tile level, or patch level; the syntax used to manage or control a maximum coding unit can be called the LCU level; and the syntax used to manage or control a filtering unit can be called the filtering unit level. A filtering unit can include multiple maximum coding units, and a maximum coding unit can also include multiple filtering units.

[0110] Step S20: determining the permission level of the samples in the current filtering unit according to the permission level of the permission area.

[0111] In an optional embodiment, each filtering unit includes at least one sample, which is a chroma sample or a luminance sample of a pixel. The permission level of each sample in the filtering unit is determined by the permission level of the permission area in which the filtering unit is located. The permission level can be a confidentiality level or other access permission level.

[0112] Since the filtering unit in this embodiment can be located in one permission zone or in multiple permission zones simultaneously, the permission levels of each sample in the filtering unit are not all the same. This embodiment describes the two aforementioned situations separately. Regarding the first situation, i.e., when the filtering unit is located in one permission zone, in this case, all samples in the filtering unit are also located in that permission zone. In this case, the permission level of each sample in the filtering unit is consistent with the permission level of that permission zone. For example, when the current filtering unit is located in permission zone X, the permission level of all samples in the current filtering unit is the permission level of permission zone X. Regarding the second situation, i.e., when the current filtering unit is located in multiple permission zones, in this case, the samples in the filtering unit are also located in different permission zones. The permission level of the samples in the filtering unit is consistent with the permission level of the permission zone. For example, when the current filtering unit is located in permission zones X and Y simultaneously, in this case, some samples in the current filtering unit are located in permission zone X, while others are located in permission zone Y. The permission level of the samples in permission zone X is the permission level of permission zone X, and the permission level of the samples in permission zone Y is the permission level of permission zone Y.

[0113] Step S30: Classify the samples in the current filtering unit according to the permission levels of the samples.

[0114] In an optional embodiment, after determining the authority level of each sample in the current filtering unit, all samples in the current filtering unit can be classified according to the authority level of each sample in this embodiment. In this embodiment, all samples in the current filtering unit can be divided into first samples and second samples according to the authority level of each sample. The specific process of classifying samples in the current filtering unit in this embodiment can be implemented as follows.

[0115] An implementation method is provided in this embodiment, specifically, according to the authority level of each sample, the samples with high authority level and the samples with low authority level in the current filtering unit can be determined, and all samples in the current filtering unit are classified according to the high and low authority levels of the samples. Optionally, the samples with high authority level can be used as the first sample, and the samples with low authority level can be used as the second sample.

[0116] This embodiment further provides another implementation method, specifically, reference block information needs to be used in the filtering process within the current filtering unit, and the permission level of the sample is compared with the permission level of the reference block, and all samples in the current filtering unit are classified based on the comparison result. Optionally, samples with a permission level lower than or equal to the permission level of the reference block can be used as the first sample, and samples with a permission level higher than the permission level of the reference block can be used as the second sample.

[0117] This embodiment further provides another implementation method, specifically, a reference sample is required in the filtering process within the current filtering unit, and the permission level of the sample is compared with the permission level of the reference sample, and all samples in the current filtering unit are classified based on the comparison result. Optionally, a sample with an permission level lower than or equal to the permission level of the reference sample can be used as the first sample, and a sample with an permission level higher than the permission level of the reference sample can be used as the second sample.

[0118] The above-mentioned methods are merely examples. In the actual filtering process, other methods besides the above-mentioned methods may be selected, which is not limited in this embodiment.

[0119] In an optional embodiment, the first sample may be a non-filterable sample, and the second sample may be a filterable sample.

[0120] Step S40: performing corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result.

[0121] In an optional embodiment, in this embodiment, all samples in the current filtering unit can be divided into filterable samples and non-filterable samples according to the permission level of each sample, wherein the filterable samples are samples that can be directly filtered, and the non-filterable samples are samples that cannot be directly filtered.

[0122] In an optional embodiment, the flag information parsed from the code stream is used to determine the filtering strategy corresponding to the current filtering unit, and the authority level is used to classify the samples in the current filtering unit. Due to the different classification of samples in the filtering unit, even if two filtering units have the same filtering strategy, the final results after performing the filtering operation may be different. For example, assuming that the filtering strategy is partial filtering, the partial filtering strategy is to not perform the filtering operation on the first sample (that is, the non-filterable sample) in the filtering unit, and perform the filtering operation on the second sample (that is, the filterable sample) in the filtering unit. Due to the different classification of samples in the filtering unit, the number of first samples and second samples in each filtering unit is also different, so the final filtering results are also different.

[0123] In an optional embodiment, the filtering strategy includes at least three methods: full filtering, partial filtering, and no filtering. Based on the classification result of the samples, it can be determined that the samples of the current filtering unit at least include at least one unfilterable sample and / or at least one filterable sample. Among them, full filtering means that when there is at least one filterable sample, all samples in the current filtering unit are filtered, partial filtering means that no filtering operation is performed on the unfilterable samples in the current filtering unit, and filtering operation is performed on the filterable samples, and no filtering means that when there is at least one unfilterable sample, no filtering operation is performed on all samples in the current filtering unit.

[0124] In an optional embodiment, a preset filtering method is adopted when filtering samples. The preset filtering method in this embodiment includes at least one of deblocking filtering, sample adaptive compensation, enhanced sample adaptive compensation, cross-component sample adaptive compensation, and adaptive loop filtering. The samples are then filtered in the corresponding manner. Unlike the existing practice of not performing filtering on samples within the permission area, this embodiment performs filtering based on the preset filtering method and the permission level of the samples in the permission area, thereby achieving constrained filtering of permission areas with different permission levels, thereby improving the subjective and objective quality of the image.

[0125] This embodiment determines the filtering strategy corresponding to the current filtering unit and the authority area in which it is located; determines the authority level of samples in the current filtering unit according to the authority level of the authority area; classifies the samples in the current filtering unit according to the authority level of the samples; performs corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification results, and performs different filtering operations on samples of different authority levels in each authority area according to the filtering strategy, thereby realizing constrained filtering operations on the authority area and improving the subjective and objective quality of the image.

[0126] Refer to FIG4 , which is a flow chart of a second embodiment of a filtering method according to the present invention.

[0127] Based on the first embodiment above, the filtering method of this embodiment further includes:

[0128] Step S301: Samples in the current filtering unit that require reference block information during filtering and for which at least one reference block is unavailable are treated as unfilterable samples.

[0129] In an optional embodiment, in this embodiment, filterable samples and non-filterable samples in the current filtering unit can be judged based on information related to the reference block. Specifically, for a certain sample in the current filtering unit, it is first necessary to determine whether the sample needs to use reference block information during the filtering process. If the reference block information is needed, it is further determined whether there is at least one reference block that is unavailable. If the above two conditions are met at the same time, it can be determined that the sample is a non-filterable sample. Among them, the reference block is a block required for making filtering decisions and / or implementing filtering operations. On the contrary, if the reference block information is not used; or if the reference block information is used and all reference block information is available, it is impossible to directly determine whether the sample is filterable, and it is necessary to further determine whether the sample is filterable based on the situation of the reference sample.

[0130] In an optional embodiment, whether reference block information needs to be used in the filtering process of samples in the current filtering unit can be determined according to a preset filtering method in this embodiment, wherein the preset filtering method includes at least one of deblocking filtering, sample adaptive compensation, enhanced sample adaptive compensation, cross-component sample adaptive compensation and adaptive loop filtering.

[0131] In this embodiment, the preset filtering method is first used to illustrate deblocking filtering. Referring to Figure 5, the P blocks and Q blocks on both sides of the boundary are required when calculating the boundary strength according to the deblocking filtering method. The deblocking filtering process uses the coding information of the reference blocks, including the prediction method, non-zero transform coefficients, reference image, and motion vector information. When filtering samples using this filtering method, the samples will use reference block information, and the two reference blocks required are the P blocks and the Q blocks.

[0132] This embodiment further illustrates the use of a sample adaptive offset (SAO) filtering scheme as a predefined filtering method. This filtering scheme includes various modes, such as boundary compensation, sideband compensation, and parameter fusion. Taking the parameter fusion mode as an example, referring to Figure 8, the parameter fusion mode means that for a sample adaptive offset (SAO) filter unit, its SAO parameters directly use the SAO parameters of the adjacent filter unit (to the left or above), with the reference block being the SAO filter unit to the left or above. A, B, and C each represent an SAO filter unit. When block C makes an SAO parameter decision, it can choose one of three options: (a) directly use the parameters of block A; (b) directly use the parameters of block B; or (c) analyze the characteristics of its own pixel block and select parameters different from those of blocks A and B. When filtering a sample using this filtering method, the sample uses reference block information. For example, when making an SAO parameter decision for block C, two reference blocks, A and B, are required. The above are examples for explaining whether reference block information is required for different filtering methods. In specific implementations, whether reference block information is required for a sample during filtering may also be determined in other ways, which is not limited in this embodiment.

[0133] In an optional embodiment, the availability of the reference block required by the sample can be further determined based on the permissions of the sample and the permissions of the reference block. Specifically, for a sample within the current filtering unit, permissions for the sample and the reference block required by the sample can be obtained. The corresponding permissions can be determined based on the permission area where the sample resides. A reference block also includes multiple samples, and the permission of the reference block is the highest permission of all samples within the reference block. For example, if the reference block contains samples Q, W, and E, and sample Q has the highest permission, then the permission of the reference block is consistent with that of sample Q. The permission of the reference block is then compared with the permission of the sample. If the permission of the reference block is lower than or equal to the permission of the sample, further determination is made as to whether the following preset conditions are met. The preset condition can be that the reference block has been decoded or encoded, meaning that the encoder must ensure that the reference block has been encoded, or that the decoder must ensure that the reference block has been decoded. The preset condition can also be that the reference block and the sample are located in the same slice or tile. The preset condition can also be that the reference block and the sample are located in different slices or tiles, and filtering is allowed at the slice or tile boundary. If the authority level judgment condition and any one of the preset conditions are met at the same time, the reference block is deemed to be available.

[0134] In an optional embodiment, after determining that an unavailable reference block is available, the information of the unavailable reference block may be replaced with derived reference block information, thereby converting the unavailable reference block into an available reference block. This embodiment provides an implementation method for the derived reference block information. Specifically, for the encoder, the reference block information is derived from the encoded blocks surrounding the unavailable reference block. For the decoder, the reference block information is derived from the decoded blocks surrounding the unavailable reference block. It should be emphasized that, since the permissions of the unavailable reference block are generally higher than the permissions of the sample, in this embodiment, the permissions of these decoded blocks or encoded blocks need to be lower than or equal to the permissions of the sample.

[0135] This embodiment also provides another implementation method, which is to derive reference block information through preset information, wherein the preset information includes default filtering parameters, prediction method, non-zero transform coefficients, reference images, motion vectors and other information.

[0136] Step S302: Samples in the current filtering unit that require reference samples during the filtering process and for which at least one reference sample is unavailable are treated as unfilterable samples.

[0137] Step S303: Samples in the current filtering unit that require reference samples during the filtering process and for which all reference samples are unavailable are regarded as unfilterable samples.

[0138] Step S304: Samples that require reference samples during filtering within the current filtering unit and whose proportion of unavailable reference samples among all reference samples is greater than or equal to a preset value are considered as unfilterable samples.

[0139] In an optional embodiment, in this embodiment, filterable samples and non-filterable samples in the current filtering unit may also be judged based on reference sample information, wherein the reference samples are samples required for making filtering decisions and / or implementing filtering operations.

[0140] In an optional embodiment, for a certain sample in the current filtering unit, it is necessary to first obtain a reference sample of the sample. After determining the reference sample, it is further determined whether the reference sample is available. Finally, based on the judgment result of whether the reference sample is available, it is determined whether the sample is an unfilterable sample. The specific judgment process can be implemented as follows.

[0141] This embodiment provides an implementation method that, when it is determined that reference samples are required and at least one reference sample is unavailable, determines that the sample is an unfilterable sample. For example, if the reference samples corresponding to sample S in the current filtering unit are S1, S2, and S3, and if at least one of S1, S2, and S3 is unavailable, then sample S can be determined to be an unfilterable sample.

[0142] This embodiment provides another implementation method. When it is determined that a reference sample is required and all reference samples are unavailable, the sample is determined to be an unfilterable sample. For example, if the reference samples corresponding to sample S in the current filtering unit are S1, S2, and S3, and if S1, S2, and S3 are all unavailable reference samples, sample S can be determined to be an unfilterable sample.

[0143] This embodiment provides another implementation method. When it is determined that a reference sample is required and the proportion of unavailable reference samples is greater than or equal to a preset value, the sample is determined to be an unfilterable sample. For example, the reference samples corresponding to the sample S in the current filtering unit are S1, S2, and S3. Assuming that S1 and S2 are unavailable reference samples and S3 is an available reference sample, it can be calculated that the proportion of unavailable reference samples is 2 / 3. Assuming that the preset value of the proportion is 50%, it can be determined that the proportion of unavailable reference samples is greater than the preset value. At this time, it can be determined that the sample S is an unfilterable sample. Among them, the preset value can be set accordingly according to the actual filtering requirements, and this is not limited in this embodiment.

[0144] Furthermore, in this embodiment, the reference sample corresponding to the sample may be determined based on different preset filtering methods. In this embodiment, various filtering methods are further illustrated.

[0145] In an optional embodiment, deblocking filtering is described using filtering as a filtering method. The deblocking filter module processes all 8x8 block boundaries within all PU (Prediction Unit) and TU (Transform Unit) boundaries. This process involves two steps: filtering decision and filtering operation. First, a filtering decision is made to determine the filtering strength (no filtering, weak filtering, or strong filtering) and filtering parameters for the boundary. Then, the filtering operation is performed, modifying the pixels accordingly based on the selected filtering strength and filtering parameters. The deblocking filter algorithm is adaptive to different video content and encoding parameters, adaptively selecting whether to filter and the filtering strength for different block boundaries. For example, strong filtering is applied to discontinuous boundaries in smooth areas, while weak filtering or no filtering is applied to textured areas. Furthermore, at the slice level, filtering parameters (i.e., β and tc) can be adjusted based on the individual characteristics of different video sequences. By adding an offset value to the filtering parameters for fine-tuning, the filtering strength can be increased or decreased, optimizing the decoded video quality and achieving better results than the default values. It is worth noting that although the minimum unit of deblocking filtering is the 8x8 block boundary, the 8x8 block boundary is actually divided into two parts for independent deblocking filtering, as shown in Figures 5 and 6. The vertical boundary uses 8x4 as the basic unit, and the horizontal boundary uses 4x8 as the basic unit. Further explanation is given by taking the deblocking filtering method of the vertical boundary as an example, as shown in Figure 5. For this filtering method, the reference samples can be the samples required for the filtering process, that is, the reference samples are the samples required for calculating the boundary strength and implementing the filtering operation. Specifically, depending on the different filtering operations, such as strong luminance filtering, weak luminance filtering, and chrominance filtering, the reference samples can be all or part of the samples in Figure 5. Furthermore, deblocking filtering can also operate on horizontal boundaries. The deblocking filtering of the horizontal boundary is shown in Figure 6. Similarly, depending on the different filtering operations, the reference samples can be all or part of the samples of the P block and Q block in Figure 6.

[0146] In an optional embodiment, sample-adaptive compensation is described using a filtering approach. Sample-adaptive compensation uses the Coding Tree Block (CTB) as the basic unit. By selecting an appropriate classifier to classify reconstructed pixels into categories, different compensation values ​​are then applied to pixels in different categories, effectively improving the subjective and objective quality of the video. SAO includes two major compensation methods: edge offset (EO) and band offset (BO). Furthermore, to save coding parameter bitrate, parameter fusion technology is introduced. Edge offset technology classifies the current pixel by comparing its value with that of adjacent pixels. Pixels in the same category are then compensated with the same value, while pixels in different categories can have different compensation values. Based on the positional differences of the selected adjacent pixels, edge offset is divided into four modes: horizontal (EO_0), vertical (EO_1), 135-degree (EO_2), and 45-degree (EO_3), as shown in Figure 7, where c represents the current pixel and a and b represent adjacent pixels. Referring to Figure 7, for this filtering method, a preset number of samples around any sample in the current filtering unit can be used as reference samples. As shown in Figure 7, the reference samples are the two samples around the current sample. For example, if c is the current sample, then a and b are the reference samples. Furthermore, sideband compensation is classified according to the pixel intensity value, and the pixel range is divided into 32 equal sidebands. Each sideband is compensated according to its own characteristics, and the same compensation value is used for the same sideband. For example, for an 8-bit image, the pixel value range is [0,255], which is divided into 32 sidebands. Each sideband contains 8 pixel values, and the index range of the sideband is [0,31]. The parameter fusion mode means that for a CTB, its SAO parameters directly use the SAO parameters of the adjacent block (left or above). This mode does not involve reference samples. See the reference block acquisition process described above.

[0147] In an alternative embodiment, the enhanced sample adaptive compensation is described in a filtering manner. When adopting the enhanced sample adaptive compensation method, for luminance samples, all pixels are first divided into C1 and C2 categories according to two dimensions respectively, and then the Cartesian product of the categories in the two dimensions is taken to obtain the final classification result Ct = C1 × C2. For chrominance samples, only the second dimension is used for classification (i.e., C2), and the final classification result Ct is obtained by looking up a table. Each category of samples has an offset value, which is transmitted in the bitstream. ESAO supports both image-level control switches and LCU (Largest Coding Unit)-level control switches. For the C1 category of the first dimension, the classification template is shown in Figure 9. For the current pixel, the initial category is set to cx = 0, and then it is compared with the surrounding 8 pixels from left to right and top to bottom in turn. If the surrounding pixel is larger than the current pixel, cx is incremented by 1; otherwise, cx is decremented by 1 (the second method is that cx remains unchanged). After traversal, the final category of the current pixel is obtained. It can be seen that the value range of cx is [-8, 8] (the second method is [0, 8]), so C1 = 17 (the second method is 9). Which of the two methods is adopted is determined by the encoding end, and the identification information is transmitted in the image header. Figure 9 Classification template for the C, category For the C2 category of the second dimension, the pixel values in the range of [0, (1 << bitdepth)-1] are evenly divided into C2 categories at equal intervals according to their magnitudes. The size of C2 is determined by the encoding end and is transmitted in the image header. Let the current pixel value be y, then the classification formula is cy = (y * C2) >> bitdepth, where cy is a specific category within [0, C2]. Referring to Figure 9, for this filtering method, it is also possible to use a preset number of samples around any sample in the current filtering unit as reference samples. As shown in Figure 9, the reference samples are the 8 samples around the current sample. For example, in Figure 9, the shaded part is the current sample, and the 8 non-shaded parts around the shaded part are the reference samples of the current sample.

[0148] In an optional embodiment, adaptive compensation for cross-component samples is described using a filtering approach. Cross-component sample adaptive compensation classifies the current chroma sample based on the corresponding luma sample value and then adds an offset value based on the category. This technology only supports the BO (Band Offset) classification method. Specifically, the luma sample value range is evenly divided into BandNum bands, each band representing a category. The band category into which the luma sample value corresponding to the current chroma sample falls is used as the category of the current chroma sample, and the offset value corresponding to that category is then added to the chroma sample. Referring to Figure 10, for this filtering approach, a preset number of samples surrounding any sample in the current filtering unit can also be used as reference samples. In this filtering approach, the sample and the reference sample are in different components. For example, the reference sample for the current chroma sample is one of the nine surrounding luma samples. As shown in Figure 10, c is the current chroma sample, and 0 to 8 are the nine surrounding luma samples. A luma sample is selected from these nine luma samples as the reference sample for the current chroma sample.

[0149] In an optional embodiment, adaptive loop filtering is described using a filtering approach. For the luminance component in adaptive loop filtering, a frame of image is divided into 4x4 coefficient regions (as shown in FIG14 ), and the pixels within the same coefficient region use the same set of filter coefficients. According to the scanning order of the coefficient regions, two adjacent coefficient regions can be merged into a new region, and the merged region can be further merged with its adjacent regions until the entire frame of image is a single coefficient region. Therefore, the number of filter coefficient groups for a frame of image is equal to the number of merged coefficient regions, and the value range is [1, 16]. The bitstream needs to transmit the number of filter coefficient groups for the current frame of image (i.e., the number of merged coefficient regions), the size of each region (i.e., the number of original coefficient regions contained in each merged region), and each set of filter coefficients. For the chrominance component, a single filter is used for a frame of image (i.e., the entire frame of image corresponds to one coefficient region and one set of filter coefficients), and the Cb and Cr components have their own filters. Referring to Figures 11 and 12, the shape of the adaptive loop filter is shown in Figure 11, and the shape of the enhanced adaptive loop filter is shown in Figure 12. For this filtering method, the surrounding samples within the filter coverage range centered on the current sample can be used as reference samples. Figures 11 and 12 show the surrounding samples within the filter coverage range, i.e., the reference samples. The filter coverage range can be set based on different standards, which is not limited in this embodiment.

[0150] After determining the reference sample, in this embodiment, the permission of the sample and the permission of the reference sample can be used to further determine whether the reference sample required by the sample is available. Specifically, for a certain sample in the current filtering unit, it is necessary to obtain the permission of the sample and the permission of the reference sample required by the sample. The corresponding permission can be determined by the permission area where the sample is located and the permission area where the reference sample is located. Then, the permission of the reference sample is compared with the permission of the sample. If the permission of the reference sample is lower than or equal to the permission of the sample, it is further determined whether the following preset conditions are met. The preset condition can be that the reference sample has been decoded or encoded, that is, for the encoding end, it is also necessary to ensure that the reference sample has been encoded, or for the decoding end, it is also necessary to ensure that the reference sample has been decoded. The preset condition can also be that the reference sample and the sample are in the same slice or tile. The preset condition can also be that the reference sample and the sample are in different slices or tiles, and filtering is allowed on the boundary of the slice or tile. If any one of the judgment conditions of the authority level and the preset conditions is met at the same time, the reference sample is deemed to be available.

[0151] Furthermore, in this embodiment, after determining that a reference sample is unavailable, the information of the unavailable reference sample can be replaced with derived reference sample information, thereby converting the unavailable reference sample into an available reference sample. This embodiment provides an implementation method for derived reference sample information. Specifically, for the encoder, reference sample information is derived from encoded samples surrounding the unavailable reference sample. For the decoder, reference sample information is derived from decoded samples surrounding the unavailable reference sample. It should be emphasized that since the permissions of the unavailable reference sample are generally higher than the permissions of the sample, in this embodiment, the permissions of these decoded or encoded samples need to be lower than or equal to the permissions of the sample.

[0152] This embodiment also provides another implementation manner, specifically, deriving reference sample information through preset information, wherein the preset information includes a default sample value.

[0153] This embodiment classifies the unfilterable samples and filterable samples in the current filtering unit through reference block information or reference sample information, and can also convert unavailable reference blocks or unavailable reference samples into available reference blocks or available reference samples. In this way, the unfilterable samples and filterable samples can be accurately identified, and then the corresponding filtering strategy is executed, which can effectively improve the subjective and objective quality of the image.

[0154] Refer to FIG13 , which is a flow chart of a second embodiment of a filtering method according to the present invention.

[0155] Based on the first embodiment above, the filtering method of this embodiment further includes:

[0156] Step S401: Do not perform a filtering operation on a first sample in the current filtering unit, and perform a filtering operation on a second sample in the current filtering unit.

[0157] The preset filtering method in this embodiment includes at least one of deblocking filtering, sample adaptive compensation, enhanced sample adaptive compensation, cross-component sample adaptive compensation and adaptive loop filtering. The specific process of the filtering operation can be implemented as follows.

[0158] In an optional embodiment, when the filtering strategy is partial filtering, regardless of the number of unfilterable samples and filterable samples in the current filtering unit, the filtering operation performed is to not perform the filtering operation on the first sample (unfilterable sample) in the filtering unit, and to perform the filtering operation on the second sample (filterable sample) in the filtering unit. Assuming that there are N unfilterable samples and M filterable samples in the current filtering unit, the filtering operation is not performed on the N unfilterable samples, and the filtering operation is performed on the M filterable samples.

[0159] In an optional embodiment, when the filtering strategy is no filtering, it is necessary to first determine whether there are any unfilterable samples in the current filtering unit. If there are any unfilterable samples, no filtering operation is performed on any samples in the current filtering unit. Assuming that there are N unfilterable samples and M filterable samples in the current filtering unit, no filtering operation is performed on any samples in the current filtering unit, that is, M+N samples.

[0160] In an optional embodiment, when the filtering strategy is full filtering, in this case, it is necessary to first determine whether there are filterable samples in the current filtering unit. If there are filterable samples, the filtering operation is performed on all samples in the current filtering unit. Furthermore, whether there are filterable samples in the current filtering unit includes two cases. The first case is that all samples in the current filtering unit are filterable. For example, the current filtering unit contains N samples, and these N samples are all filterable. Then, the filtering operation can be performed on these N filterable samples. The second case is that there are non-filterable samples in the current filtering unit. For this case, when executing the full filtering strategy, it is necessary to first convert all non-filterable samples in the current filtering unit into filterable samples, and finally perform the filtering operation on all filterable samples. For example, the current filtering unit contains N filterable samples and M non-filterable samples. First, these M non-filterable samples are converted into M filterable samples, and finally, the filtering operation is performed on N+M filterable samples.

[0161] In an optional embodiment, the non-filterable samples in the current filtering unit can be converted into filterable samples by deriving the information of the reference block or reference sample, wherein the reference block refers to the adjacent block required for use in the sample filtering process, and the reference sample refers to the surrounding samples required for use in the sample filtering process. In this embodiment, an implementation method is provided for obtaining the information of the derived reference block or reference sample, specifically, the information of the reference block or reference sample is derived through the available blocks or available samples inside and around the permission area. The available blocks or available samples can be in the same permission area as the non-filterable samples, or in different permission areas, and this is not limited in this embodiment. The permission of the available blocks or available samples needs to be lower than or equal to the permission of the non-filterable samples. For the decoding end, the available blocks or available samples are decoded blocks or samples, and for the encoding end, the available blocks or available samples are encoded blocks or samples.

[0162] This embodiment provides another implementation method for obtaining information of a reference block or a reference sample, specifically deriving the information of a reference block or a reference sample through preset information, wherein the preset information includes default sample values, filtering parameters, prediction methods, non-zero transform coefficients, reference images, motion vectors and other information.

[0163] This embodiment performs different filtering operations on samples of different permission levels in each permission area according to the filtering strategy, thereby implementing constrained filtering operations on the permission area and improving the subjective and objective quality of the image.

[0164] 14 , which is a structural block diagram of a first embodiment of a filtering device according to the present invention.

[0165] As shown in FIG14 , the filtering device proposed in an embodiment of the present invention includes:

[0166] The acquisition module 10 is used to determine the filtering strategy corresponding to the current filtering unit and the authority area in which it is located, where the authority area is an image area with an authority level in the image.

[0167] The identification module 20 is configured to determine the permission level of the sample in the current filtering unit according to the permission level of the permission area.

[0168] The classification module 30 is configured to classify the samples in the current filtering unit according to the permission levels of the samples.

[0169] The filtering module 40 is configured to perform corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result.

[0170] This embodiment determines the filtering strategy corresponding to the current filtering unit and the authority area in which it is located; determines the authority level of samples in the current filtering unit according to the authority level of the authority area; classifies the samples in the current filtering unit according to the authority level of the samples; performs corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification results, and performs different filtering operations on samples of different authority levels in each authority area according to the filtering strategy, thereby realizing constrained filtering operations on the authority area and improving the subjective and objective quality of the image.

[0171] In one embodiment, the filtering strategy is determined by flag information parsed from the bitstream, and the flag information is used for transmission at the sequence level, image level, slice level, tile level, or filtering unit level.

[0172] In one embodiment, the permission region includes at least one filtering unit, the current filtering unit is allowed to span multiple permission regions, and the filtering unit includes at least one sample;

[0173] The identification module 20 is further configured to ensure that the authority level of the sample in the current filtering unit is consistent with the authority region where the sample is located.

[0174] In one embodiment, the current filtering unit is a basic unit in the filtering process and different filtering units are allowed to perform different filtering operations;

[0175] The filtering module 40 is further configured to not perform a filtering operation on the first sample in the current filtering unit, and to perform a filtering operation on the second sample in the current filtering unit; or to perform a filtering operation on all samples in the current filtering unit; or to not perform a filtering operation on all samples in the current filtering unit.

[0176] In one embodiment, the first sample is a non-filterable sample, and the second sample is a filterable sample.

[0177] In one embodiment, the filtering module 40 is further used to convert the non-filterable samples in the current filtering unit into filterable samples by deriving information of a reference block or a reference sample, and perform filtering operations on all filterable samples, wherein the information of the derived reference block or reference sample is derived through available blocks or available samples inside and around the permission area, or is derived through preset information; wherein the available blocks or available samples are blocks or samples whose permissions are lower than or equal to those of the non-filterable samples and have been decoded or encoded.

[0178] In one embodiment, the classification module 30 is further used to treat samples in the current filtering unit that require reference block information during the filtering process and for which at least one reference block is unavailable as unfilterable samples; treat samples in the current filtering unit that require reference samples during the filtering process and for which at least one reference sample is unavailable as unfilterable samples; treat samples in the current filtering unit that require reference samples during the filtering process and for which all reference samples are unavailable as unfilterable samples; and treat samples in the current filtering unit that require reference samples during the filtering process and for which the proportion of unavailable reference samples in all reference samples is greater than or equal to a preset value as unfilterable samples.

[0179] In one embodiment, the classification module 30 is further used to determine whether the sample in the current filtering unit needs to use reference block information during the filtering process according to a preset filtering method; and to determine whether the reference block is available based on the permissions of the sample and the permissions of the reference block.

[0180] In one embodiment, the reference block is a block required for making filtering decisions and / or implementing filtering operations, the reference block includes at least one sample, and the authority of the reference block is the highest authority of all samples in the reference block.

[0181] In one embodiment, the classification module 30 is further configured to determine that the reference block is available if the authority of the reference block is lower than or equal to the authority of the sample and at least one of the following preset conditions is satisfied; the preset conditions include: the reference block has been decoded or encoded; the reference block and the sample are located in the same slice or tile; the reference block and the sample are located in different slices or tiles, and filtering of the slice or tile boundary is allowed.

[0182] In one embodiment, the filtering device further includes a conversion module;

[0183] The conversion module is configured to derive reference block information through decoded blocks or encoded blocks with authority lower than or equal to that of the sample around the unavailable reference block, and / or derive reference block information through preset information; and replace information of the unavailable reference block with the derived reference block information, so as to convert the unavailable reference block into an available reference block.

[0184] In one embodiment, the classification module 30 is further configured to obtain a reference sample corresponding to any sample in the current filtering unit according to a preset filtering method; and determine whether the reference sample is available based on the permissions of the sample and the permissions of the reference sample.

[0185] In one embodiment, the reference samples are samples required for making filtering decisions and / or performing filtering operations.

[0186] In one embodiment, the classification module 30 is further used to determine that the reference sample is available if the authority of the reference sample is lower than or equal to the authority of the sample and at least one of the following preset conditions is met; the preset conditions include: the reference sample has been decoded or encoded; the reference sample and the sample are located in the same slice or tile; the reference sample and the sample are located in different slices or tiles, and filtering of the slice or tile boundary is allowed.

[0187] In one embodiment, the filtering device further includes a conversion module;

[0188] The conversion module is configured to derive reference sample information through decoded samples or encoded samples whose authority around the unavailable reference sample is lower than or equal to that of the sample, and / or derive reference sample information through preset information; and replace the information of the unavailable reference sample with the derived reference sample information to convert the unavailable reference sample into an available reference sample.

[0189] In one embodiment, the preset filtering method includes at least one of the following: deblocking filtering; sample adaptive compensation; enhanced sample adaptive compensation; cross-component sample adaptive compensation; adaptive loop filtering.

[0190] In addition, to achieve the above objectives, the present invention also proposes a filtering device, which includes: a memory, a processor, and a filtering program stored in the memory and executable on the processor, wherein the filtering program is configured to implement the filtering method described above.

[0191] In addition, an embodiment of the present invention further provides a storage medium, on which a filtering program is stored. When the filtering program is executed by a processor, the steps of the filtering method described above are implemented.

[0192] Since the storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be described one by one here.

[0193] It should be understood that the above is only an example and does not constitute any limitation to the technical solution of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any limitation on this.

[0194] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of the embodiment scheme, and no limitation is made here.

[0195] In addition, for technical details not fully described in this embodiment, reference can be made to the filtering method provided in any embodiment of the present invention, and will not be repeated here.

[0196] In addition, it should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0197] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0198] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, or of course by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

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

Claims

1. A filtering method, characterized in that: The filtering method comprises: Determine the filtering strategy and the authority area corresponding to the current filtering unit, where the authority area is an image area with an authority level in the image; Determining the permission level of the sample in the current filtering unit according to the permission level of the permission area; classifying the samples in the current filtering unit according to the permission level of the samples; Perform corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result.

2. The filtering method according to claim 1, wherein: The filtering strategy is determined by flag information parsed from the code stream, and the flag information is used for transmission at the sequence level, image level, slice level, tile level or filtering unit level.

3. The filtering method according to claim 1, wherein: The permission region includes at least one filtering unit, the current filtering unit is allowed to span multiple permission regions, and the filtering unit includes at least one sample; The determining the permission level of the sample in the current filtering unit according to the permission level of the permission area includes: The permission level of the sample in the current filtering unit is consistent with the permission area where the sample is located.

4. The filtering method according to claim 3, wherein: The current filtering unit is a basic unit in the filtering process and different filtering units are allowed to perform different filtering operations; The performing corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result includes: Not performing a filtering operation on a first sample in the current filtering unit, and performing a filtering operation on a second sample in the current filtering unit; or, Performing a filtering operation on all samples in the current filtering unit; or, No filtering operation is performed on any samples in the current filtering unit.

5. The filtering method according to claim 4, wherein: The first sample is a non-filterable sample, and the second sample is a filterable sample.

6. The filtering method according to claim 4, wherein: The performing a filtering operation on all samples in the current filtering unit includes: Converting non-filterable samples in the current filtering unit into filterable samples by deriving information of a reference block or reference sample, and performing a filtering operation on all filterable samples, wherein the information of the derived reference block or reference sample is derived from available blocks or available samples within and around the permission area, or is derived from preset information; The available blocks or available samples are blocks or samples that have an authority lower than or equal to an authority of the non-filterable samples and have been decoded or encoded.

7. The filtering method according to claim 5, wherein: Include at least one of the following: The samples in the current filtering unit that require reference block information during filtering and for which at least one reference block is unavailable are treated as unfilterable samples; A sample in the current filtering unit that requires a reference sample during the filtering process and for which at least one reference sample is unavailable is considered as an unfilterable sample; Determine a sample in the current filtering unit that requires a reference sample during the filtering process and for which all reference samples are unavailable as an unfilterable sample; or The reference samples are needed in the filtering process of the current filtering unit, and the reference samples are not available in all reference samples. Samples whose proportion is greater than or equal to the preset value are regarded as non-filterable samples.

8. The filtering method according to claim 7, wherein: The filtering method further comprises: Determining whether the samples in the current filtering unit need to use reference block information during the filtering process according to a preset filtering method; Whether the reference block is available is determined based on the authority of the sample and the authority of the reference block.

9. The filtering method according to claim 8, wherein: The reference block is a block required for making a filtering decision and / or implementing a filtering operation. The reference block includes at least one sample. The authority of the reference block is the highest authority of all samples in the reference block.

10. The filtering method according to claim 8, wherein: The determining whether the reference block is available based on the permission of the sample and the permission of the reference block includes: If the authority of the reference block is lower than or equal to the authority of the sample and at least one of the following preset conditions is met, then it is determined that the reference block is available; The preset conditions include: The reference block has been decoded or encoded; The reference block and the sample are located in the same slice or tile; or The reference block and the sample are located in different slices or tiles, and filtering is allowed on the boundary of the slice or tile.

11. The filtering method according to claim 10, wherein: If the authority of the reference block is lower than or equal to the authority of the sample and at least one of the following preset conditions is satisfied, after determining that the reference block is available, the method further includes: Derived reference block information by using decoded blocks or coded blocks with authority lower than or equal to that of the sample around the unavailable reference block, and / or, derived reference block information by using preset information; The information of the unavailable reference block is replaced by the derived reference block information, so that the unavailable reference block is converted into an available reference block.

12. The filtering method according to claim 7, wherein: The filtering method further comprises: Obtaining a reference sample corresponding to any sample in the current filtering unit according to a preset filtering method; Whether the reference sample is available is determined by comparing the permissions of the sample and the permissions of the reference sample.

13. The filtering method according to claim 12, wherein: The reference samples are samples required for making filtering decisions and / or performing filtering operations.

14. The filtering method according to claim 12, wherein: The determining whether the reference sample is available based on the permission of the sample and the permission of the reference sample includes: If the authority of the reference sample is lower than or equal to the authority of the sample, and at least one of the following preset conditions is met, then the reference sample is determined to be available; The preset conditions include: The reference sample has been decoded or encoded; The reference sample and the sample are located in the same slice or tile; or The reference sample and the sample are located in different slices or tiles, and filtering is allowed on the boundary of the slice or tile.

15. The filtering method according to claim 14, wherein: If the authority of the reference sample is lower than or equal to the authority of the sample and at least one of the following preset conditions is satisfied, after determining that the reference sample is available, the method further includes: Derived reference sample information by using decoded samples or coded samples with authority lower than or equal to that of the sample around the unavailable reference sample, and / or derived reference sample information by using preset information; The information of the unavailable reference sample is replaced by the derived reference sample information, so that the unavailable reference sample is converted into an available reference sample.

16. The filtering method according to claim 8 or 12, characterized in that: The preset filtering method includes at least one of the following: Deblocking filtering; Sample adaptive compensation; Enhanced sample adaptive compensation; Adaptive compensation across component samples; or Adaptive loop filtering.

17. A filtering device, characterized in that: The filtering device includes: a memory, a processor, and a filtering program stored in the memory and running on the processor, wherein the filtering program is configured to implement the filtering method according to any one of claims 1 to 16.

18. A storage medium, characterized in that The storage medium stores a filtering program, and when the filtering program is executed by the processor, the filtering method according to any one of claims 1 to 16 is implemented.

19. A filtering device, characterized in that: The filtering device comprises: An acquisition module, configured to determine a filtering strategy and a permission area corresponding to a current filtering unit, wherein the permission area is an image area with a permission level in the image; an identification module, configured to determine the permission level of the sample in the current filtering unit according to the permission level of the permission area; a classification module, configured to classify the samples in the current filtering unit according to the permission level of the samples; A filtering module is used to perform corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result.