Filtering method and device and storage medium
By classifying the image's filtering units according to permission levels and applying filtering strategies during the filtering process, the problem of the impact of permission area filtering on image quality is solved, and the subjective and objective effects of the image are improved.
Patent Information
- Application Number
- CN202510895602.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-14
- Publication Date
- 2025-10-17
AI Technical Summary
In the prior art, filtering is not performed on the authority area of the coded image, which affects the subjective and objective quality of the image.
By determining the filtering strategy and authority area of the filtering unit, the samples in the filtering unit are classified according to the authority level, and the corresponding filtering operations are performed according to the filtering strategy and classification results, including the distinction between filterable and non-filterable samples, and the use of reference blocks or reference samples. The filtering methods such as deblocking filtering, sample adaptive compensation, enhanced sample adaptive compensation, cross-component sample adaptive compensation and adaptive loop filtering are adopted.
It realizes the constrained filtering operation on the permission area, improving the subjective and objective quality of the image.
Smart Images

Figure CN120812299A_ABST
Abstract
Description
[0001] The present application is a divisional application of the Chinese Invention Patent Application No. 202211426315.3, filed on November 14, 2022, entitled "Filtering Method, Device and Storage Medium", the priority of which is hereby affirmed and incorporated by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of image processing, in particular to a filtering method, device and storage medium. BACKGROUND
[0003] Different regions in the encoded image have different permissions, which can be a level of confidentiality or other access permission level. For users with the highest permission, they can see the correct content of all regions. For users with the lowest permission, they can only see the correct content of the region equal to their own permission, and cannot see the correct content of the region higher than their own permission, for example, these high permission regions present to low permission users are mosaicked or masked content. One application scenario of the permission region is to present different ranges of correct images to users with different permissions. In principle, the higher the permission of the user, the larger the range of correct images he sees, and the smaller the range of masked images.
[0004] The existing scheme does not filter the permission region, which will affect the subjective and objective quality of the image.
[0005] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0006] The main purpose of the present application is to provide a filtering method, device and storage medium, which aims to solve the technical problem that the prior art does not filter the permission region, which will affect the subjective and objective quality of the image.
[0007] To achieve the above purpose, the present application provides a filtering method, which comprises the following steps:
[0008] determining the filtering strategy corresponding to the current filtering unit and the permission region it is in, the permission region being an image region in the image with a permission level;
[0009] determining the permission level of the sample in the current filtering unit according to the permission level of the permission region;
[0010] classifying the samples in the current filtering unit according to the permission level of the samples;
[0011] performing corresponding filtering operation 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 a bitstream, and the flag information is transmitted at a sequence level, an image level, a slice level, a tile level, or a filtering unit level.
[0013] Optionally, the permission region includes at least one filtering unit, and the current filtering unit is allowed to cross multiple permission regions, and the filtering unit includes at least one sample.
[0014] The permission level of the sample in the current filtering unit is determined according to the permission level of the permission region, and the permission level of the sample in the current filtering unit is determined according to the permission level of the permission region.
[0015] The permission level of the sample in the current filtering unit is consistent with the permission region where the sample is located.
[0016] Optionally, the current filtering unit is a basic unit in a filtering process, and different filtering units are allowed to perform different filtering operations.
[0017] The corresponding filtering operation is performed on the current filtering unit according to the filtering strategy and the classification result, and the corresponding filtering operation is performed on the current filtering unit according to the filtering strategy and the classification result.
[0018] No filtering operation is performed on the first sample in the current filtering unit, and the filtering operation is performed on the second sample in the current filtering unit.
[0019] Or,
[0020] The filtering operation is performed on all samples in the current filtering unit.
[0021] Or,
[0022] No filtering operation is performed on all 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, the filtering operation is performed on all samples in the current filtering unit, and the filtering operation is performed on all samples in the current filtering unit.
[0025] The non-filterable sample in the current filtering unit is converted into a filterable sample by deriving information of a reference block or a reference sample, and the filtering operation is performed on all filterable samples, and the information of the reference block or the reference sample is derived from available blocks or available samples inside and around the permission region, or is derived from preset information.
[0026] Wherein, the available block or the available sample is a block or a sample with a permission lower than or equal to the permission of the non-filterable sample and has been decoded or encoded.
[0027] Optionally, it includes at least one of the following:
[0028] a sample in the current filtering unit is determined as an unfilterable sample if the sample needs reference block information in the filtering process and at least one reference block is unavailable;
[0029] a sample in the current filtering unit is determined as an unfilterable sample if the sample needs reference samples in the filtering process and at least one reference sample is unavailable;
[0030] a sample in the current filtering unit is determined as an unfilterable sample if the sample needs reference samples in the filtering process and all reference samples are unavailable;
[0031] a sample in the current filtering unit is determined as an unfilterable sample if the sample needs reference samples in the filtering process and the proportion of unavailable reference samples in all reference samples is greater than or equal to a preset value.
[0032] Optionally, the filtering method further comprises:
[0033] determining whether a sample in the current filtering unit needs reference block information in the filtering process according to a preset filtering mode;
[0034] determining whether the reference block is available by the authority of the sample and the authority of the reference block.
[0035] Optionally, the reference block is a block needed for filtering decision and / or filtering operation, the reference block comprises 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 by the authority of the sample and the authority of the reference block comprises:
[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, it is determined that the reference block is available;
[0038] the preset conditions comprise:
[0039] the reference block has been decoded or encoded;
[0040] the reference block and the sample are located in the same Slice or Tile;
[0041] the reference block and the sample are located in different Slices or Tiles, and filtering on the boundary of the Slice or Tile is allowed.
[0042] Optionally, after the determining whether the reference block is available by the authority of the sample and the authority of the reference block, the method further comprises:
[0043] deriving the reference block information from a decoded block or a coded block around the unavailable reference block whose authority is lower than or equal to the authority of the sample, and / or deriving the reference block information from preset information;
[0044] replacing the information of the unavailable reference block with the derived reference block information, so that the unavailable reference block is converted into an available reference block.
[0045] Optionally, the filtering method further comprises:
[0046] obtaining a reference sample corresponding to the sample according to a preset filtering mode;
[0047] determining whether the reference sample is available according to the authority of the sample and the authority of the reference sample.
[0048] Optionally, the reference sample is a sample required for making a filtering decision and / or implementing a filtering operation.
[0049] Optionally, the determining whether the reference sample is available according to the authority of the sample and the authority of the reference sample comprises:
[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, it is determined that the reference sample is available;
[0051] the preset conditions comprise:
[0052] the reference sample is decoded or coded;
[0053] the reference sample and the sample are located in a same slice or tile;
[0054] the reference sample and the sample are located in different slices or tiles, and filtering on a boundary of a slice or a tile is allowed.
[0055] Optionally, after the 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, it is determined that the reference sample is available, the method further comprises:
[0056] deriving reference sample information from a decoded sample or a coded sample around the unavailable reference sample whose authority is lower than or equal to the authority of the sample, and / or deriving the reference sample information from preset information;
[0057] replacing the information of the unavailable reference sample with the derived reference sample information, so that the unavailable reference sample is converted into an available reference sample.
[0058] Optionally, the preset filtering mode comprises at least one of:
[0059] Deblocking filter
[0060] Sample adaptive offset
[0061] Enhanced sample adaptive offset
[0062] Cross-component sample adaptive offset
[0063] Adaptive loop filter
[0064] In addition, to achieve the above object, the present application further provides a filter device, which comprises a memory, a processor and a filter program stored in the memory and running on the processor, and the filter program is configured to implement the filter method as described above.
[0065] In addition, to achieve the above object, the present application further provides a storage medium, which stores a filter program, and the filter program is executed by a processor to implement the filter method as described above.
[0066] In addition, to achieve the above object, the present application further provides a filter device, which comprises:
[0067] The acquisition module is configured to determine a filter strategy corresponding to a current filter unit and an authority area where the current filter unit is located, and the authority area is an image area with an authority level in an image.
[0068] The identification module is configured to determine an authority level of a sample in the current filter unit according to an authority level of the authority area.
[0069] The classification module is configured to classify the sample in the current filter unit according to the authority level of the sample.
[0070] The filter module is configured to perform a corresponding filter operation on the current filter unit according to the filter strategy and the classification result.
[0071] The present application determines a filter strategy corresponding to a current filter unit and an authority area where the current filter unit is located, determines an authority level of a sample in the current filter unit according to an authority level of the authority area, classifies the sample in the current filter unit according to the authority level of the sample, and performs a corresponding filter operation on the current filter unit according to the filter strategy and the classification result, so that different filter operations are performed on samples with different authority levels in each authority area according to the filter strategy, the filter operation on the authority area is constrained, and the subjective and objective quality of the image is improved. BRIEF DESCRIPTION OF DRAWINGS
[0072] Figure 1is a structural schematic view of a filtering device of a hardware running environment related to an embodiment scheme of the present application.
[0073] Figure 2 is a flowchart of a first embodiment of the filtering method of the present application.
[0074] Figure 3 is a structural schematic view of a video encoding framework in an embodiment of the filtering method of the present application.
[0075] Figure 4 is a flowchart of a second embodiment of the filtering method of the present application.
[0076] Figure 5 is a reference sample schematic view of a deblocking filtering mode in an embodiment of the filtering method of the present application.
[0077] Figure 6 is a schematic view of a vertical boundary and a horizontal boundary corresponding to the deblocking filtering mode in an embodiment of the filtering method of the present application.
[0078] Figure 7 is a reference sample schematic view of a sample adaptive offset mode in an embodiment of the filtering method of the present application.
[0079] Figure 8 is a reference block schematic view of the sample adaptive offset mode in an embodiment of the filtering method of the present application.
[0080] Figure 9 is a reference sample schematic view of an enhanced sample adaptive offset mode in an embodiment of the filtering method of the present application.
[0081] Figure 10 is a reference sample schematic view of a cross-component sample adaptive offset mode in an embodiment of the filtering method of the present application.
[0082] Figure 11 is a reference sample schematic view of an adaptive loop filtering mode in an embodiment of the filtering method of the present application.
[0083] Figure 12 is another reference sample schematic view of the adaptive loop filtering mode in an embodiment of the filtering method of the present application.
[0084] Figure 13 is a flowchart of a third embodiment of the filtering method of the present application.
[0085] Figure 14 is a structural block diagram of a first embodiment of the filtering device of the present application.
[0086] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0087] It should be understood that the specific embodiments described herein are merely exemplary and do not limit the application.
[0088] Referring to Figure 1 , Figure 1 The filter device structure diagram of the hardware running environment involved in the embodiment of the application is shown.
[0089] As Figure 1 shown, the filter device can 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 realize the connection and communication between the components. The user interface 1003 can include a display screen, an input unit such as a keyboard, and an optional user interface 1003 can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (Wi-Fi) interface). The memory 1005 can be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (NVM), such as a disk memory. The memory 1005 can also be an independent storage device from the aforementioned processor 1001.
[0090] Those skilled in the art can understand that Figure 1 the structure shown in the figure does not constitute a limitation on the filter device, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.
[0091] As Figure 1 shown, the memory 1005 as a storage medium can include an operating system, a network communication module, a user interface module, and a filter program.
[0092] In Figure 1 the filter device shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the filter device of the application can be arranged in the filter device, and the filter device calls the filter program stored in the memory 1005 through the processor 1001, and executes the filter method provided by the embodiment of the application.
[0093] The exemplary embodiments will be described in detail herein with reference to a few examples. The description herein, in connection with the appended drawings, is intended to convey principles of the exemplary embodiments, and not specific operation procedures or details, as some implement details are not known at this time. It will be appreciated that the description herein and disclosed elements and / or methods can be modified in various manners. Such modifications are intended to fall within the scope of the present application. Also, it will be appreciated that the
[0094] It has to be noted that, as used herein, the terms "includes" and / or "contains", etc., are used in the sense of "comprising", meaning "including, but not limited to", and not in the sense of "consisting only of, or "consisting exclusively of", such that the listed steps or options need not be treated as being ordered and treated as essential to implement the disclosed embodiments. It is intended that the application be construed as including all such steps and options.
[0095] It is to be understood that the singular forms "a", "an", and "the" include plural referents unless the context clearly dictates otherwise. Pronouns in the masculine (or feminine) form include the feminine (or masculine) form, also and vice versa, and the use of the singular form herein is intended to include the plural and vice versa, unless the context clearly indicates otherwise. The terms "comprises" and / or "comprising", or "includes" and / or "including" when used in this document, specify the presence of stated features, steps, operations, elements, components, items, groups, and / or the like but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, items, groups, and / or the like. As used herein, the term "and / or" comprises at least one of the associated listed items, that is, satisfies the requirements of at least one of the associated listed items. The use of the terms "at least one of", when used in the context of a list of elements, means that at least one of each named element is present from among the group of elements, and that one or more of the specified elements can be selected even if present more than once in the list. Similarly, the terms "comprises", "comprising", "includes", "including" and the like can be used in the context of describing construction elements and / or processes that can include, but are not limited to, one or more of the specified elements.
[0096] It should be understood that, although each step in the flowchart in the embodiments of the present application is shown in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless explicitly stated herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other sequences. Moreover, at least part of the steps in the figure can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be alternately executed with at least part of other steps or sub-steps or stages of other steps.
[0097] Depending on the context, the word "if" as used herein can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if it is determined" or "if (a stated condition or event) is detected" can be interpreted as "when it is determined" or "in response to determining" or "when (a stated condition or event) is detected" or "in response to detecting (a stated condition or event)".
[0098] It should be noted that, in this paper, step codes such as S10, S20 are used, the purpose is to express the corresponding content more clearly and briefly, and it does not constitute a substantial limitation in sequence. Those skilled in the art may, for example, perform S20 first and then perform S10 in specific implementation, but these should be within the scope of protection of the present application.
[0099] It should be understood that the specific embodiments described herein are merely used to explain the present application and do not limit the present application.
[0100] The embodiment of the present application provides a filtering method, referring to Figure 2 , Figure 2 The present application provides a filtering method first embodiment flowchart, the filtering method can be applied to processing video data decoding method flow, also can be applied to processing video data encoding method flow.
[0101] In the embodiment, the filtering method comprises the following steps:
[0102] Step S10: determine the filtering strategy corresponding to the current filtering unit and the authority area it is in, and the authority area is an image area with an authority level in the image.
[0103] The execution subject of the embodiment can be a filtering device, which can be implemented in various forms. For example, the filtering device described in the present application can include a mobile terminal or a smart terminal such as a tablet computer, a notebook computer, a palm computer, a camera, and the like, and a fixed terminal device such as a desktop computer, which all have the function of image processing. In the following description, the filtering device will be taken as an example for illustration.
[0104] With reference to Figure 3 It is a video coding framework, which includes prediction, transform, quantization, entropy coding and filtering modules, wherein: the prediction module includes intra prediction and inter prediction, the intra prediction is to use the reconstructed pixels around the current block for prediction to remove spatial redundancy; the inter prediction is to use the reconstructed pixels on the time domain reference frame for prediction to remove temporal redundancy. The transform module is to linearly map the spatial domain residual information to the transform domain (such as the frequency domain), the goal is to enable energy concentration and remove the frequency domain correlation of the signal. The theoretical transform matrix is reversible and does not cause signal loss. The quantization module is a "many-to-one" mapping process, which is irreversible and will cause signal loss; the advantage is that it can greatly reduce the value range of the signal, so that the encoder can give a good approximation of the original signal with a small number of symbols, thereby improving the compression rate. The entropy coding module is a lossless coding method based on the information entropy principle, which converts a series of element symbols (such as transform coefficients and mode information) used to represent the video sequence into a binary code stream to remove the statistical redundancy of these video element symbols. The filtering module enhances the reconstructed image, the goal is to make the reconstructed image closer to the original image, while reducing the impact of blocking effect and ringing effect, and improving the quality of the reconstructed image.
[0105] In an optional embodiment, the filtering operation in the embodiment is a filtering operation for a coded image, and different regions in the coded image have different permissions, which can be a security level or other access level. For a user with the highest permission, the correct content of all regions can be seen. For a user with the lowest permission, only the correct content of the region equal to the user's permission can be seen, and the correct content of the region higher than the user's permission cannot be seen, for example, these high permission regions present the content with mosaic or shielding to the low permission user. One application scenario of the permission region is to present different ranges of correct images to users with different permissions, the higher the permission of the user, the larger the range of correct images seen by the user, and the smaller the range of the image shielded.
[0106] However, the current filtering manner does not filter the samples in the authority region, which greatly affects the subjective and objective quality of the image. In order to solve the above technical problems, according to the filtering operation and the authority level of the authority region, the filtering operation of the authority region with different authority levels is constrained, for example, the filtering of the high authority region is not limited because the information of the surrounding reference samples can be obtained; for the filtering of the low authority region, if the reference sample is not available (for example, the reference sample is located in the high authority region), the constrained filtering operation is performed.
[0107] In the embodiment, the filtering unit is taken as the basic unit in the filtering process when filtering the image. When filtering, each filtering unit can be sequentially filtered, or multiple filtering units can be simultaneously filtered. Each filtering unit corresponds to an image sub-region in the image. In contrast, the authority region is an image region with an authority level. For a single image, the image has multiple filtering units and multiple authority regions. The number of filtering units and the number of authority regions do not have a corresponding relationship. One authority region can contain multiple filtering units, for example, the authority region X can contain one filtering unit A, or it can contain two filtering units A and B at the same time. Further, one filtering unit can be in multiple different authority regions, for example, the filtering unit C can be in the authority region X, or it can cross the authority 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 the embodiment, the image can also be divided into a chrominance component and a luminance component according to the chrominance and luminance. The filtering units contained in the two components are corresponding. One filtering unit can contain the above two components, and one component can also contain multiple filtering units. The filtering process of the entire image is described in the embodiment by taking the filtering unit as an example. In the embodiment, the number and size of the filtering units divided from a single image and the number and size of the authority regions can be set according to the actual image processing requirements, which are not limited in the embodiment.
[0109] In an optional embodiment, the filtering operation on the filtering unit is performed according to a corresponding filtering strategy, and each filtering unit can allow different filtering strategies to be performed. For example, the filtering strategy performed by the current filtering unit can be the same as or different from the filtering strategies of other filtering units. In this embodiment, the filtering strategy is determined by flag information, which can be transmitted at the sequence level (or SPS level), image level (or PPS level or frame level), Slice level, Tile level, or filtering unit level (or CTU / CTB / LCU / LCB 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 filtering strategy level can also be the patch level. The syntax used to manage or control a plurality of images can be referred to as the sequence level. The syntax used to manage or control a single frame image can be referred to as the image level. The syntax used to manage or control a parallel unit (i.e., image region) including a plurality of coding units can be referred to as the Slice level, Tile level, or Patch level. The syntax used to manage or control the maximum coding unit can be referred to as the LCU level. The syntax used to manage or control the filtering unit can be referred to as the filtering unit level. A filtering unit can include a plurality of maximum coding units, and a maximum coding unit can also include a plurality of filtering units.
[0110] Step S20: determining the permission level of the sample 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 chrominance 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 security level or other access permission level.
[0112] Since the filtering unit in the embodiment can be in one permission area or in multiple permission areas, the permission levels of the samples in the filtering unit are not all the same. The embodiment describes the two cases. For the first case, the filtering unit is in one permission area, in which case, the samples in the filtering unit are all in the permission area. At this time, the permission levels of the samples in the filtering unit are consistent with the permission level of the permission area. For example, when the filtering unit is in permission area X, the permission levels of all the samples in the filtering unit are the permission level of permission area X. For the second case, the filtering unit is in multiple permission areas, in which case, the samples in the filtering unit are in different permission areas. The permission levels of the samples in the filtering unit are consistent with the permission levels of the permission areas. For example, when the filtering unit is in permission areas X and Y, part of the samples in the filtering unit are in permission area X, and the other part of the samples are in permission area Y. The permission level of the samples in permission area X is the permission level of permission area X, and the permission level of the samples in permission area Y is the permission level of permission area Y.
[0113] Step S30: classifying the samples in the current filtering unit according to the permission levels of the samples.
[0114] In an optional embodiment, after determining the permission levels of the samples in the current filtering unit, the embodiment can classify all the samples in the current filtering unit according to the permission levels of the samples. The embodiment divides all the samples in the current filtering unit into first samples and second samples according to the permission levels of the samples. The embodiment classifies the samples in the current filtering unit in the following manner.
[0115] The embodiment provides an implementation manner, which is to determine the samples with high permission levels and the samples with low permission levels in the current filtering unit according to the permission levels of the samples. All the samples in the current filtering unit are classified according to the high and low permission levels of the samples. Optionally, the samples with high permission levels are classified as first samples, and the samples with low permission levels are classified as second samples.
[0116] The embodiment further provides another implementation manner, which is that the reference block information is needed in the filtering process in the current filtering unit, and the permission level of the sample is compared with the permission level of the reference block. All the samples in the current filtering unit are classified based on the comparison result. Optionally, the samples with permission levels lower than or equal to the permission level of the reference block are classified as first samples, and the samples with permission levels higher than the permission level of the reference block are classified as second samples.
[0117] The embodiment further provides another implementation manner, specifically, a reference sample is needed in the in-loop filtering process of the current filtering unit, and the authority level of the sample is compared with the authority level of the reference sample, and all samples in the current filtering unit are classified based on the comparison result. Optionally, the sample with the authority level lower than or equal to the authority level of the reference sample can be regarded as the first sample, and the sample with the authority level higher than the authority level of the reference sample can be regarded as the second sample.
[0118] The above manner is only for example, and other manners except the above manner can be selected in the actual filtering process, and the embodiment does not limit this.
[0119] In an optional embodiment, the first sample can be a non-filterable sample, and the second sample can be a filterable sample.
[0120] Step S40: performing a corresponding filtering operation on the current filtering unit according to the filtering strategy and the classification result.
[0121] In an optional embodiment, the authority level of each sample in the embodiment can divide all samples in the current filtering unit into filterable samples and non-filterable samples, wherein the filterable sample is a sample that can directly perform a filtering operation, and the non-filterable sample is a sample that cannot directly perform a filtering operation.
[0122] In an optional embodiment, the flag information parsed from the bitstream 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 the samples in the filtering unit, even if two filtering units have the same filtering strategy, the results after performing the filtering operation can be different. For example, it is assumed that the filtering strategy is partial filtering, and the partial filtering strategy is not performing filtering operation on the first sample (i.e. the non-filterable sample) in the filtering unit, and performing filtering operation on the second sample (i.e. the filterable sample) in the filtering unit. Due to the different classification of the samples in the filtering unit, the number of the first sample and the second sample in each filtering unit is different, and thus the final filtering result is different.
[0123] In an alternative embodiment, the filtering strategy includes at least three modes of full filtering, partial filtering and full non-filtering, and the classification result of the samples can determine at least the case that there is at least one unfilterable sample and / or there is at least one filterable sample in the current filtering unit. The full filtering is to perform filtering operation on all samples in the current filtering unit when there is at least one filterable sample, the partial filtering is to perform filtering operation on the filterable samples in the current filtering unit without filtering operation on the unfilterable samples, and the full non-filtering is to perform no filtering operation on all samples in the current filtering unit when there is at least one unfilterable sample.
[0124] In an alternative embodiment, the preset filtering mode is adopted when performing filtering operation on the samples, and the preset filtering mode in this embodiment includes at least one of deblocking filtering, sample adaptive offset, enhanced sample adaptive offset, cross-component sample adaptive offset and adaptive loop filtering, and then the samples are filtered according to the corresponding mode. Different from the prior art that no filtering operation is performed on the samples in the authority region, the filtering operation in this embodiment is performed on the basis of the preset filtering mode in combination with the authority level of the samples in the authority region, thereby realizing the constrained filtering operation on the authority regions with different authority levels and 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 region where the current filtering unit is located, determines the authority level of the samples in the current filtering unit according to the authority level of the authority region, classifies the samples in the current filtering unit according to the authority level of the samples, and performs corresponding filtering operation on the current filtering unit according to the filtering strategy and the classification result, thereby performing different filtering operations on the samples with different authority levels in each authority region according to the filtering strategy, realizing the constrained filtering operation on the authority regions, and improving the subjective and objective quality of the image.
[0126] Reference Figure 4 , Figure 4 The flowchart of a second embodiment of the filtering method of the present application is shown.
[0127] Based on the above first embodiment, the filtering method of this embodiment further includes:
[0128] Step S301: The samples in the current filtering unit that need to use reference block information in the filtering process and at least one reference block is unavailable are taken 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 described as deblocking filtering. Figure 5 According to the deblocking filtering method, the P blocks and Q blocks on both sides of the boundary are needed to calculate the boundary strength. The coding information of the reference block will be used in the deblocking filtering process, including prediction method, non-zero transform coefficients, reference image and motion vector information. When this filtering method is used to filter the sample, the sample will use the reference block information, and the two reference blocks needed are the P block and the Q block.
[0132] In this embodiment, the preset filtering mode is further described as the filtering mode of sample adaptive compensation. The filtering mode of sample adaptive compensation includes a variety of different modes, such as boundary compensation, sideband compensation and parameter fusion. Taking the parameter fusion mode as an example, refer to Figure 8, the parameter fusion mode refers to, for an SAO (Sample Adaptive Offset) filtering unit, SAO parameters of the SAO filtering unit are directly used as SAO parameters of a neighboring filtering unit (left or above), and a reference block of the SAO filtering unit is a left or above SAO filtering unit. A, B, and C all represent SAO filtering units. When the C block makes a SAO parameter decision, there can be three cases: (a) directly using the parameters of the A block; (b) directly using the parameters of the B block; and (c) selecting parameters different from the A block and the B block by analyzing characteristics of a pixel block of the C block. When a sample is filtered in this way, the sample uses reference block information, and taking the C block as an example, the A block and the B block are needed when the C block makes a SAO parameter decision. The above is an example of whether reference block information is needed in different filtering modes. In a specific implementation, whether reference block information is needed in a filtering process can also be determined in other manners, which is not limited in the embodiment.
[0133] In an optional embodiment, whether a reference block needed by a sample is available can be further determined by a permission of the sample and a permission of the reference block. Specifically, for a sample in a current filtering unit, a permission of the sample and a permission of a reference block needed by the sample are obtained, the permission of the sample and the permission of the reference block are determined according to a permission area in which the sample is located, the reference block also includes a plurality of samples, and the permission of the reference block is a highest permission of all the samples in the reference block, for example, the reference block includes samples Q, W, and E, and it is assumed that the permission of the sample Q is the highest, and the permission of the reference block is the same as the permission of the sample Q. Then, the permission of the reference block is 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, it is further determined whether a preset condition is met. The preset condition can be that the reference block is decoded or encoded, that is, for an encoding end, it is also necessary to ensure that the reference block is encoded, or for a decoding end, it is also necessary to ensure that the reference block is decoded. The preset condition can also be that the reference block and the sample are located in a 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 on a boundary of the slice or the tile is allowed. If the judgment condition of the permission and any one of the preset conditions are met, it is determined that the reference block is available.
[0134] In an alternative embodiment, after determining the unavailable reference block, the information of the unavailable reference block can be replaced by the derived reference block information, so as to convert the unavailable reference block into an available reference block. In this embodiment, an implementation of the derived reference block information is provided, specifically, for the encoding end, the reference block information is derived from the coded blocks around the unavailable reference block, for the decoding end, the reference block information is derived from the decoded blocks around the unavailable reference block, and it is emphasized that, since the authority of the unavailable reference block is usually higher than that of the sample, the authority of these decoded blocks or coded blocks in this embodiment needs to be lower than or equal to the authority of the sample.
[0135] In this embodiment, another implementation is also provided, specifically, the reference block information is derived from the preset information, wherein the preset information includes default filter parameters, prediction mode, non-zero transform coefficient, reference image and motion vector, etc.
[0136] Step S302: The sample in the current filter unit which needs to refer to the sample in the filtering process and at least one reference sample is unavailable is regarded as an unfilterable sample.
[0137] Step S303: The sample in the current filter unit which needs to refer to the sample in the filtering process and all reference samples are unavailable is regarded as an unfilterable sample.
[0138] Step S304: The sample in the current filter unit which needs to refer to the sample in the filtering process and the proportion of the unavailable reference samples in all reference samples is greater than or equal to a preset value is regarded as an unfilterable sample.
[0139] In an alternative embodiment, the filterable sample and the unfilterable sample in the current filter unit can also be determined according to the reference sample information, wherein the reference sample is the sample required for the filtering decision and / or the filtering operation.
[0140] In an alternative embodiment, for a certain sample in the current filter unit, the reference sample of the sample needs to be obtained first, after determining the reference sample, it is further determined whether the reference sample is available, and finally whether the sample is an unfilterable sample is determined based on the determination result of whether the reference sample is available, and the specific determination process can be implemented in the following manner.
[0141] In this embodiment, an implementation is provided, when it is determined that the reference sample needs to be used and there is at least one unavailable reference sample, the sample is determined to be an unfilterable sample. For example, the reference samples of the sample S in the current filter unit are S1, S2 and S3, and it is assumed that at least one of S1, S2 and S3 is an unavailable reference sample, then the sample S can be determined to be an unfilterable sample.
[0142] In another implementation provided in this embodiment, when it is determined that a reference sample is needed and all the reference samples are unavailable, the sample is determined as an unfilterable sample. For example, the reference samples corresponding to the sample S in the current filtering unit are S1, S2 and S3, and it is assumed that S1, S2 and S3 are all unavailable reference samples. Then, the sample S can be determined as an unfilterable sample.
[0143] In another implementation provided in this embodiment, when it is determined that a reference sample is needed and the proportion of unavailable reference samples is greater than or equal to a preset value, the sample is determined as an unfilterable sample. For example, the reference samples corresponding to the sample S in the current filtering unit are S1, S2 and S3, and it is assumed that S1 and S2 are unavailable reference samples and S3 is an available reference sample. Then, the proportion of unavailable reference samples is calculated as 2 / 3. It is assumed that the preset value is 50%. Then, it is determined that the proportion of unavailable reference samples is greater than the preset value. Thus, the sample S can be determined as an unfilterable sample. The preset value can be set according to actual filtering requirements, which is not limited in this embodiment.
[0144] Further, in this embodiment, the reference samples corresponding to a sample can be determined based on different preset filtering manners. In this embodiment, various filtering manners are exemplified.
[0145] In an optional embodiment, the filtering manner is deblocking filtering. The deblocking filtering module needs to process the 8x8 block boundaries in all PU and TU boundaries, including two links: filtering decision and filtering operation. First, the filtering decision is performed to obtain the filtering strength (no filtering, weak filtering or strong filtering) and the filtering parameters of the boundary. Then, the filtering operation is performed, that is, the pixels are corrected according to the selected filtering strength and filtering parameters. The deblocking filtering algorithm has self-adaptive ability to different video contents and different encoding parameters, that is, different block boundaries adaptively select whether to filter and the filtering strength. For example, the discontinuous boundaries of a smooth region are strongly filtered, and the boundaries of a rich-texture region are weakly filtered or not filtered. In addition, the filtering parameters (i.e., β and t c ) can be adjusted according to the individual characteristics of different video sequences at the slice level, that is, the filtering parameters are fine-tuned by adding an offset value. In this way, the filtering strength can be increased or decreased, the decoded video quality can be optimized, and better results than the default values can be obtained. It is worth noting that although the minimum unit of deblocking filtering is an 8x8 block boundary, the 8x8 block boundary is actually divided into two parts to perform deblocking filtering independently. As shown in Figure 5 and Figure 6 Further, the deblocking filtering manner of the vertical boundary is exemplified. As shown in Figure 5As shown, for this filtering mode, the reference samples can be the samples needed in the filtering process, i.e. the reference samples are the samples needed for calculating the boundary strength and implementing the filtering operation. Specifically, according to different filtering operations, such as the luma strong filtering, luma weak filtering and chroma filtering, the reference samples can be all or part of the samples in the P block and Q block. Figure 5 Further, the deblocking filtering can also operate on the horizontal boundary, and the deblocking filtering on the horizontal boundary is as shown in Figure 6 As shown, similarly, according to different filtering operations, the reference samples can be all or part of the samples in the P block and Q block. Figure 6
[0146] In an alternative embodiment, the filtering mode is illustrated as sample adaptive offset. The sample adaptive offset takes the coding tree block (CTB) as the basic unit, classifies the reconstructed pixels by selecting a suitable classifier, and then uses different offset values for different categories of pixels, which can effectively improve the subjective and objective quality of the video. The SAO includes two categories of offset forms, namely edge offset (EO) and band offset (BO), and in addition, the parameter fusion technology is introduced to save the code rate of the coding parameters. The edge offset technology classifies the current pixel by comparing the size of the current pixel value and the adjacent pixel value, and then offsets the same value for the same category of pixels, and the offset values for different categories of pixels can be different. According to the position difference of the selected adjacent pixels, the edge offset is divided into four modes: horizontal direction (EO_0), vertical direction (EO_1), 135-degree direction (EO_2) and 45-degree direction (EO_3), as shown in Figure 7 wherein c represents the current pixel, and a and b represent the adjacent pixels. Referring to Figure 7 , for this filtering mode, the reference samples can be a predetermined number of samples around any sample in the current filtering unit. As shown in Figure 7 , the reference samples are two samples around the current sample, for example, c is the current sample, and a and b are the reference samples. Further, the band offset is classified according to the pixel intensity value, and the pixel range is equally divided into 32 bands, and each band is offset according to its own characteristics, and the same band uses the same offset value. For example, for an 8-bit image, the pixel value range is [0, 255], which is divided into 32 bands, each band contains 8 pixel values, and the index range of the band is [0, 31]. The parameter fusion mode refers to that for a CTB, the SAO parameters directly use the SAO parameters of the adjacent block (left or top), and this mode does not involve the reference samples, which can be seen from the above-mentioned reference block acquisition process.
[0147] In an alternative embodiment, the filter method is used for enhanced sample adaptive offset. When the enhanced sample adaptive offset method is used, for the luminance samples, first, all the pixels are classified into C1 and C2 categories in two dimensions respectively, then the two-dimensional categories are taken as a Cartesian product to obtain the final classification result Ct=C1xC2. For the 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 code stream. The enhanced sample adaptive offset 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 the figure. For the current pixel, the initial category is set to cx=0, then the current pixel is compared with the surrounding 8 pixels from left to right and from top to bottom, if the surrounding pixel is greater than the current pixel, cx is incremented by 1; otherwise, cx is decremented by 1 (the second method is that cx is unchanged), and after the traversal is completed, the final category of the current pixel is obtained. As can be seen, the value range of cx is [-8, 8] (the value range of cx is [0, 8] in the second method), so C1=17 (C1=9 in the second method). Which of the two methods is used is determined by the encoding end, and the identification information is transmitted in the image header. Figure 9 The classification template of the C1 category shown in the figure is used for the C2 category of the second dimension, the pixel values in the range of [0, (1<<bitdepth)-1] are uniformly divided into C2 categories according to the size interval, and the size of C2 is determined by the encoding end and is transmitted in the image header. Let the current pixel value be y, the classification formula is cy=(y*C2)>>bitdepth, where cy is a specific category in the range of [0, C2]. Referring to Figure 9 , for this filter method, a predetermined number of samples around any sample in the current filter unit can also be used as reference samples. As shown in Figure 9 , the reference samples are the 8 samples around the current sample, for example 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 alternative embodiment, the filter method is used for cross-component sample adaptive offset. The cross-component sample adaptive offset classifies the current chrominance sample according to the corresponding luminance sample value, and then adds an offset value according to the category. This technology only supports the BO (Band Offset) classification method. The specific method is to uniformly divide the value range of the luminance sample into BandNum bands, each band is a category, and the band category to which the luminance sample value corresponding to the current chrominance sample falls is taken as the category of the current chrominance sample, and then an offset value corresponding to the category is added to the chrominance sample. Referring to Figure 10For this filtering method, a preset number of samples around any sample in the current filtering unit can also be used as reference samples. In this filtering method, the sample and the reference sample are in different components. For example, the reference sample of the current chroma sample is one of the 9 surrounding luminance samples, such as Figure 10 As shown, c is the current chroma sample, 0 to 8 are the surrounding 9 luminance samples, and a luminance sample is selected from these 9 luminance samples as the reference sample for the current chroma sample.
[0149] In an optional embodiment, the filtering method is described as adaptive loop filtering. In the adaptive loop filtering, for the luminance component, a frame image is divided into 4x4 coefficient areas (such as Figure 14 As shown), the pixels in the same coefficient area use the same set of filter coefficients. According to the scanning order of the coefficient area, two adjacent coefficient areas can be merged into a new area, and the merged area can continue to be merged with its adjacent areas until the entire frame image is a coefficient area. Therefore, the number of filter coefficient groups for a frame image is equal to the number of coefficient areas after merging, and the value range is [1,16]. The number of filter coefficient groups for this frame image (that is, the number of coefficient areas after merging), the size of each area (that is, how many original coefficient areas each area after merging contains), and each set of filter coefficients need to be transmitted in the code stream. For the chrominance component, one filter is used for one frame image (that is, the entire frame image corresponds to one coefficient area and one set of filter coefficients), and the Cb and Cr components have their own filters. Refer to Figure 11 and Figure 12 , where the adaptive loop filter has the shape of Figure 11 As shown, the enhanced adaptive loop filter has the shape of Figure 12 As shown, for this filtering method, the surrounding samples within the filter coverage range and centered on the current sample can be used as reference samples. Figure 11 and Figure 12 The surrounding samples within the filter coverage are shown, namely, reference samples. The filter coverage can be set based on different standards, which is not limited in this embodiment.
[0150] After determining the reference samples, whether the reference samples required by the sample are available can be further determined by the authority of the sample and the authority of the reference samples in the embodiment. Specifically, for a certain sample in the current filtering unit, the authority of the sample and the authority of the reference samples required by the sample are obtained, the corresponding authority can be determined through the authority area where the sample is located and the authority area where the reference sample is located, and then the authority of the reference sample is compared with the authority of the sample. If the authority of the reference sample is lower than or equal to the authority of the sample, it is further determined whether the following preset condition is met. The preset condition can be that the reference sample has been decoded or has been 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 located in the same Slice or Tile. The preset condition can also be that the reference sample and the sample are located in different Slices or Tiles, and the boundary of the Slice or Tile is allowed to be filtered. If the judgment condition of the authority high and low and any one of the preset conditions are met at the same time, it is determined that the reference sample is available.
[0151] Further, after determining the unavailable reference samples in the embodiment, the information of the unavailable reference samples can be replaced by the derived reference sample information, so as to convert the unavailable reference samples into available reference samples. In the embodiment, an implementation manner is provided for the derived reference sample information. Specifically, for the encoding end, the reference sample information is derived through the already encoded samples around the unavailable reference sample, and for the decoding end, the reference sample information is derived through the already decoded samples around the unavailable reference sample, and it needs to be emphasized that since the authority of the unavailable reference sample is usually higher than the authority of the sample, the authority of these already decoded samples or already encoded samples needs to be lower than or equal to the authority of the sample.
[0152] Another implementation manner is also provided in the embodiment, specifically, the reference sample information is derived through preset information, wherein the preset information includes a default sample value.
[0153] The embodiment classifies the unfilterable samples and filterable samples in the current filtering unit through the reference block information or the reference sample information, and can also convert the unavailable reference block or the unavailable reference sample into available reference block or available reference sample. Through the above-mentioned manner, the unfilterable samples and filterable samples can be accurately identified, and then the corresponding filtering strategy is executed, so that the subjective and objective quality of the image can be effectively improved.
[0154] Reference Figure 13 , Figure 13 The flowchart of the second embodiment of the filtering method of the application is shown.
[0155] Based on the first embodiment, the filtering method in the present embodiment further comprises:
[0156] Step S401: no filtering operation is performed on the first samples in the current filtering unit, and filtering operation is performed on the second samples in the current filtering unit.
[0157] The preset filtering mode in the present embodiment comprises at least one of deblocking filtering, sample adaptive offset, enhanced sample adaptive offset, cross-component sample adaptive offset, and adaptive loop filtering, and the specific process of the filtering operation can be implemented in the following manner.
[0158] In an optional embodiment, when the filtering strategy is partial filtering, no matter how many the unfilterable samples and filterable samples in the current filtering unit are, the filtering operation performed is that no filtering operation is performed on the first samples (unfilterable samples) in the filtering unit, and filtering operation is performed on the second samples (filterable samples) in the filtering unit. Assuming that there are N unfilterable samples and M filterable samples in the current filtering unit, no filtering operation is performed on the N unfilterable samples, and filtering operation is performed on the M filterable samples.
[0159] In an optional embodiment, when the filtering strategy is full filtering, it is required to first determine whether there are filterable samples in the current filtering unit, and if there are filterable samples, filtering operation is performed on all the samples in the current filtering unit. Further, whether there are filterable samples in the current filtering unit includes two cases. The first case is that all the samples in the current filtering unit are filterable samples, for example, the current filtering unit contains N samples, and all the N samples are filterable, and then filtering operation can be performed on the N filterable samples. The second case is that there are unfilterable samples in the current filtering unit, and for this case, it is required to first convert all the unfilterable samples in the current filtering unit into filterable samples, and then perform filtering operation on all the filterable samples, for example, the current filtering unit contains N filterable samples and M unfilterable samples, the M unfilterable samples are first converted into M filterable samples, and then filtering operation is performed on N+M filterable samples.
[0160] In an optional embodiment, when the filtering strategy is full filtering, it is required to first determine whether there are filterable samples in the current filtering unit, and if there are filterable samples, filtering operation is performed on all the samples in the current filtering unit. Further, whether there are filterable samples in the current filtering unit includes two cases. The first case is that all the samples in the current filtering unit are filterable samples, for example, the current filtering unit contains N samples, and all the N samples are filterable, and then filtering operation can be performed on the N filterable samples. The second case is that there are unfilterable samples in the current filtering unit, and for this case, it is required to first convert all the unfilterable samples in the current filtering unit into filterable samples, and then perform filtering operation on all the filterable samples, for example, the current filtering unit contains N filterable samples and M unfilterable samples, the M unfilterable samples are first converted into M filterable samples, and then filtering operation is performed on N+M filterable samples.
[0161] In an alternative embodiment, the unfilterable sample in the current filter unit can be converted into a filterable sample by deriving information of a reference block or a reference sample, wherein the reference block refers to a neighboring block required in the sample filtering process, and the reference sample refers to a surrounding sample required in the sample filtering process. In this embodiment, an implementation is provided for the acquisition of the information of the reference block or the reference sample, specifically, the information of the reference block or the reference sample is derived from available blocks or available samples inside and around the authority region, which can be in the same authority region as the unfilterable sample or in different authority regions, which is not limited in this embodiment. Wherein, the authority of the available blocks or available samples needs to be lower than or equal to the authority of the unfilterable sample, for the decoding end, the available blocks or available samples are decoded blocks or samples, for the encoding end, the available blocks or available samples are encoded blocks or samples.
[0162] In this embodiment, another implementation is provided for the acquisition of the information of the reference block or the reference sample, specifically, the information of the reference block or the reference sample is derived from preset information, wherein the preset information includes default sample values, filter parameters, prediction methods, non-zero transform coefficients, reference images and motion vectors, etc.
[0163] In this embodiment, by performing different filtering operations on samples with different authority levels in each authority region according to the filtering strategy, the constrained filtering operation on the authority region is realized, and the subjective and objective quality of the image is improved.
[0164] Reference Figure 14 , Figure 14 The structure block diagram of the first embodiment of the filtering device of the present application is shown in the figure.
[0165] As Figure 14 shown, the filtering device provided by the embodiment of the present application comprises:
[0166] The acquisition module 10 is configured to determine the filtering strategy corresponding to the current filter unit and the authority region where the current filter unit is located, and the authority region is an image region with an authority level in the image.
[0167] The identification module 20 is configured to determine the authority level of the sample in the current filter unit according to the authority level of the authority region.
[0168] The classification module 30 is configured to classify the sample in the current filter unit according to the authority level of the sample.
[0169] The filtering module 40 is configured to perform corresponding filtering operation on the current filter unit according to the filtering strategy and the classification result.
[0170] The embodiment determines a filtering strategy corresponding to a current filtering unit and a permission area where the current filtering unit is located; determines a permission level of a sample in the current filtering unit according to a permission level of the permission area; classifies the sample in the current filtering unit according to the permission level of the sample; and performs a corresponding filtering operation on the current filtering unit according to the filtering strategy and the classification result, so as to perform different filtering operations on samples of different permission levels in each permission area according to the filtering strategy, thereby realizing a constrained filtering operation on the permission area and improving the subjective and objective quality of an image.
[0171] In an embodiment, the filtering strategy is determined by flag information parsed from a bitstream, and the flag information is used for transmission at a sequence level, an image level, a Slice level, a Tile level or a filtering unit level.
[0172] In an embodiment, the permission area contains at least one filtering unit, the current filtering unit is allowed to cross multiple permission areas, and the filtering unit includes at least one sample.
[0173] The identification module 20 is also configured to determine that the permission level of the sample in the current filtering unit is consistent with the permission area where the sample is located.
[0174] In an embodiment, the current filtering unit is a basic unit in a filtering process, and different filtering units are allowed to perform different filtering operations.
[0175] The filtering module 40 is also configured to perform no filtering operation on a first sample in the current filtering unit, perform filtering operation on a second sample in the current filtering unit, perform filtering operation on all samples in the current filtering unit, or perform no filtering operation on all samples in the current filtering unit.
[0176] In an embodiment, the first sample is a non-filterable sample, and the second sample is a filterable sample.
[0177] In an embodiment, the filtering module 40 is also configured to convert the non-filterable sample in the current filtering unit into a filterable sample by deriving information of a reference block or a reference sample, and perform filtering operation on all filterable samples, wherein the information of the reference block or the reference sample is derived from available blocks or available samples inside and around the permission area or is derived from preset information, and the available blocks or available samples are blocks or samples with a permission lower than or equal to the permission of the non-filterable sample and have been decoded or encoded.
[0178] In an embodiment, the classification module 30 is further configured to determine, according to a preset filtering manner, whether a sample in the current filtering unit needs to use reference block information in a filtering process; and determine whether the reference block is available by comparing the authority of the sample with the authority of the reference block.
[0179] In an embodiment, the classification module 30 is further configured to determine, according to a preset filtering manner, whether a sample in the current filtering unit needs to use reference block information in a filtering process; and determine whether the reference block is available by comparing the authority of the sample with the authority of the reference block.
[0180] In an embodiment, the reference block is a block needed for filtering decision and / or filtering operation, and 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.
[0181] In an 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 met: the reference block is 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 on the boundary of the slice or tile is allowed.
[0182] In an embodiment, the filtering device further includes a conversion module.
[0183] The conversion module is configured to derive reference block information by using decoded blocks or encoded blocks around an unavailable reference block, the authority of which is lower than or equal to the authority of the sample, and / or derive the reference block information by using preset information; and replace the 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 an embodiment, the classification module 30 is further configured to obtain, according to a preset filtering manner, a reference sample corresponding to any sample in the current filtering unit; and determine whether the reference sample is available by comparing the authority of the sample with the authority of the reference sample.
[0185] In an embodiment, the reference sample is a sample needed for filtering decision and / or filtering operation.
[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; Performing corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result; The classifying the samples in the current filtering unit according to the permission levels of the samples includes: Samples in the current filtering unit that require reference block information during filtering and for which at least one reference block is unavailable are regarded as unfilterable samples.
2. 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 level of the permission area where the sample is located.
3. The filtering method according to claim 2, 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: No filtering operation is performed on a first sample in the current filtering unit, and a filtering operation is performed on a second sample in the current filtering unit.
4. The filtering method according to claim 3, wherein: The first sample is a non-filterable sample, and the second sample is a filterable sample.
5. The filtering method according to claim 1, 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.
6. The filtering method according to claim 5, 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.
7. The filtering method according to claim 5, 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 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; 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.
8. The filtering method according to claim 5, wherein: The preset filtering method includes: deblocking filtering.
9. 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 8.
10. 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 8 is implemented.
11. 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, configured to perform a corresponding filtering operation on the current filtering unit according to the filtering strategy and the classification result; The classification module is further configured to classify samples in the current filtering unit that require reference block information during filtering and for which at least one reference block is unavailable as unfilterable samples.