WO2024104506A1 - Filtering method, device, and storage medium - Google Patents

Filtering method, device, and storage medium Download PDF

Info

Publication number
WO2024104506A1
WO2024104506A1 PCT/CN2024/072131 CN2024072131W WO2024104506A1 WO 2024104506 A1 WO2024104506 A1 WO 2024104506A1 CN 2024072131 W CN2024072131 W CN 2024072131W WO 2024104506 A1 WO2024104506 A1 WO 2024104506A1
Authority
WO
WIPO (PCT)
Prior art keywords
filtering
sample
samples
authority
current
Prior art date
Application number
PCT/CN2024/072131
Other languages
French (fr)
Chinese (zh)
Inventor
魏亮
陈方栋
王莉
武晓阳
Original Assignee
杭州海康威视数字技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州海康威视数字技术股份有限公司 filed Critical 杭州海康威视数字技术股份有限公司
Publication of WO2024104506A1 publication Critical patent/WO2024104506A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/65Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using error resilience
    • H04N19/66Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using error resilience involving data partitioning, i.e. separation of data into packets or partitions according to importance
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation

Definitions

  • the present invention relates to the field of image processing technology, and in particular to a filtering method, device and storage medium.
  • Different areas in the encoded image have different permissions, which can be a confidentiality level or other access permission level. 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 than their own. For example, these high-authority areas present mosaic or obscured content to low-authority users.
  • 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.
  • 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.
  • the present invention provides a filtering method, which comprises the following steps:
  • a corresponding filtering operation is performed on the current filtering unit according to the filtering strategy and the classification result.
  • 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.
  • 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.
  • 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:
  • the first sample is a non-filterable sample
  • the second sample is a filterable sample
  • performing a filtering operation on all samples in the current filtering unit includes:
  • the available blocks or available samples are blocks or samples that have authority lower than or equal to authority of the non-filterable samples and have been decoded or encoded.
  • Samples that require reference samples in 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.
  • the filtering method further includes:
  • Whether the reference block is available is determined by the authority of the sample and the authority of the reference block.
  • 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.
  • the determining whether the reference block is available based on the permission of the sample and the permission of the reference block includes:
  • 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.
  • 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 is the available reference block.
  • the filtering method further includes:
  • Whether the reference sample is available is determined by comparing the permissions of the sample and the permissions of the reference sample.
  • the reference samples are samples required for making filtering decisions and/or implementing filtering operations.
  • judging whether the reference sample is available by comparing the permission of the sample with the permission of the reference sample includes:
  • 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.
  • the method further includes:
  • the reference sample information is derived by using decoded samples or encoded samples with authority lower than or equal to that of the sample around the unavailable reference sample, and/or the reference sample information is derived 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.
  • the preset filtering mode includes at least one of the following:
  • 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.
  • the present invention further proposes a storage medium, on which a filtering program is stored, and when the filtering program is executed by a processor, the filtering method as described above is implemented.
  • the present invention further provides a filtering device, the filtering device comprising:
  • An acquisition module used to determine the filtering strategy corresponding to the current filtering unit and the authority area in which it is located, wherein the authority area is an image area in the image with an authority level;
  • 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 used for classifying 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.
  • 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.
  • 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
  • FIG2 is a schematic diagram of a flow chart of a first embodiment of a filtering method according to the present invention.
  • FIG3 is a schematic diagram of a video coding framework structure in an embodiment of a filtering method of the present invention.
  • FIG4 is a schematic diagram of a flow chart of a second embodiment of a filtering method according to the present invention.
  • FIG5 is a schematic diagram of reference samples of a deblocking filtering method in an embodiment of a filtering method of the present invention.
  • FIG6 is a schematic diagram of vertical boundaries and horizontal boundaries corresponding to a deblocking filtering method in an embodiment of a filtering method of the present invention.
  • FIG7 is a schematic diagram of a reference sample of a sample point adaptive compensation method in an embodiment of a filtering method of the present invention.
  • FIG8 is a schematic diagram of a reference block of a sample adaptive compensation method in an embodiment of a filtering method of the present invention.
  • FIG9 is a schematic diagram of reference samples in an enhanced sample adaptive compensation method in an embodiment of a filtering method of the present invention.
  • FIG10 is a schematic diagram of reference samples in an adaptive compensation method across component samples in an embodiment of a filtering method of the present invention
  • 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.
  • FIG12 is a schematic diagram of another reference sample of an adaptive loop filtering method in an embodiment of a filtering method of the present invention.
  • FIG13 is a schematic flow chart of a third embodiment of a filtering method according to the present invention.
  • FIG. 14 is a structural block diagram of the first embodiment of the filtering device of the present invention.
  • FIG. 1 is a schematic diagram of the structure of a filtering device in a hardware operating environment according to an embodiment of the present invention.
  • 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 realize the connection and communication between these components.
  • the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface).
  • the memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory.
  • RAM Random Access Memory
  • NVM Non-Volatile Memory
  • the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
  • FIG. 1 does not constitute a limitation on the filtering device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
  • the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a filtering program.
  • 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.
  • first, second, third, etc. may be used to describe various information in this article, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as the second information
  • second information may also be referred to as the first information.
  • word “if” as used herein can be interpreted as “at the time of -- or "when" or "in response to determination”.
  • singular forms “one”, “one” and “the” are intended to also include plural forms, unless there is an opposite indication in the context.
  • “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 only occur when a combination of elements, functions, steps or operations are inherently mutually exclusive in some manner.
  • 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.
  • 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 determining” or “when detecting (stated condition or event)” or “in response to detecting (stated condition or event)", depending on the context.
  • 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 sequence.
  • S20 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.
  • FIG. 2 is a flow chart of a first embodiment of a filtering method of the present invention.
  • the filtering method can be applied to a decoding method flow for processing video data, and can also be applied to an encoding method flow for processing video data.
  • the filtering method includes the following steps:
  • 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.
  • the execution subject of this embodiment may be a filtering device, and the filtering device may be implemented in various forms.
  • the filtering device described in this application may include mobile terminals or intelligent terminals such as tablet computers, laptop computers, PDAs, cameras, and fixed terminal devices such as desktop computers. These devices all have image processing functions, and the filtering device will be used as an example for explanation in the subsequent description.
  • the prediction module includes intra-frame prediction and inter-frame prediction, intra-frame prediction is to use the reconstructed pixels around the current block for prediction to remove spatial redundancy; inter-frame prediction is to use the reconstructed pixels on the time domain reference frame for prediction to remove temporal redundancy.
  • the transformation module linearly maps the residual information in the spatial domain to the transformation domain (such as the frequency domain), with the goal of making the energy more concentrated and removing the frequency domain correlation of the signal. The theoretical transformation matrix is reversible and will 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 use a small number of symbols to give a good approximation of the original signal, thereby improving the compression rate.
  • the entropy coding module is a lossless coding method based on the principle of information entropy, which converts a series of element symbols used to represent the video sequence (such as transform coefficients and mode information, etc.) into a binary code stream to remove the statistical redundancy of these video element symbols.
  • the filtering module will enhance the reconstructed image with the goal of making the reconstructed image closer to the original image, while reducing the impact of blocking and ringing effects and improving the quality of the reconstructed image.
  • the filtering operation in this embodiment is for filtering operations of encoded images, and different areas in the encoded image have different permissions, which can be a confidentiality level or other access permission level.
  • permissions 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.
  • these high-authority areas present mosaic or obscured content to low-authority users.
  • One application scenario of permission areas 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.
  • the current filtering method does not filter samples within the permission area, which will greatly affect the subjective and objective quality of the image.
  • a constrained filtering operation is performed on the permission areas of different permission levels. For example, there is no restriction on filtering in high-authority areas because the surrounding reference sample information can be obtained; for filtering in low-authority areas, if the reference sample is not available (for example, the reference sample is located in the high-authority area), a constrained filtering operation is required.
  • each filtering unit may be filtered in sequence, or multiple filtering units may be filtered simultaneously.
  • Each filtering unit corresponds to an image sub-region in the image.
  • a permission region is an image region with permission levels. For a single image, the image has multiple filtering units and multiple permission regions. There is no corresponding relationship between the number of filtering units and the number of permission regions.
  • a permission region may contain multiple filtering units.
  • permission region X may contain one filtering unit A. It may also include two filter units A and B.
  • a filter unit may also be located in multiple different authority areas, for example, filter unit C may be located in authority area X, or may span authority areas X and Y at the same time.
  • the filtering unit divides the image into multiple image areas in the horizontal and vertical directions.
  • the image can also be divided into a chroma component and a luminance component according to chroma and luminance, and the filtering units contained in these two components are corresponding.
  • a filtering unit can include the above two components, and a component can also include multiple filtering units.
  • the filtering process of the entire image is explained using the filtering unit as an example.
  • the number and size of the filtering units divided by 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 this is not limited in this embodiment.
  • each filter unit when filtering the filter unit, it is performed according to the corresponding filtering strategy, and each filter unit can be allowed to execute different filtering strategies.
  • the filtering strategy executed by the current filter unit can be the same as the filtering strategy of other filter units, or it can be different from the filtering strategy of other filter units.
  • the filtering strategy is determined by the flag information, and the flag information can be transmitted at the sequence level (or SPS (Sequence Parameter Set) level), or the image level (or PPS (Picture Parameter Set) level or frame level), or Slice level, or Tile level, or filter unit level (or CTU (Coding Tree Unit)/CTB/LCU (Largest Coding Unit)/LCB (Largest Coding Block) level).
  • SPS Sequence Parameter Set
  • PPS Position Parameter Set
  • Slice level or Tile level
  • filter unit level or 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 filter unit can be determined based on the parsed flag information.
  • the level of the filtering strategy can also be patch level.
  • the syntax used to manage or control several images can be called sequence level; the syntax used to manage or control a single frame image can be called image level; the syntax used to manage or control a parallel unit (i.e., an image area) including several coding units can be called slice level, tile level, or patch level; the syntax used to manage or control a maximum coding unit can be called LCU level; the syntax used to manage or control a filtering unit can be called filtering unit level.
  • a filtering unit can include multiple maximum coding units, and a maximum coding unit can also include multiple filtering units.
  • Step S20 Determine the permission level of the samples in the current filtering unit according to the permission level of the permission area.
  • each filtering unit includes at least one sample, which is a chromaticity sample or a brightness sample of a pixel.
  • the authority level of each sample in the filtering unit is determined by the authority level of the authority area in which the filtering unit is located.
  • the authority level may be a confidentiality level or other access permission level.
  • the filter unit in this embodiment can be in one permission area or in multiple permission areas at the same time, the permission levels of each sample in the filter unit are not all the same.
  • the above two situations are described separately.
  • the first situation that is, when the filter unit is in one permission area, in this case, all samples in the filter unit are also in the permission area.
  • the permission level of each sample in the filter unit is consistent with the permission level of the permission area.
  • the permission level of all samples in the current filter unit is the permission level of permission area X.
  • the samples in the filter unit are also in different permission areas accordingly, and the permission of the samples in the filter unit is consistent with the permission level of the permission area.
  • the current filter unit is in permission areas X and Y at the same time, at this time, part of the samples in the current filter 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
  • the permission level of the samples in permission area Y is the permission level of permission area Y.
  • Step S30 Classify the samples in the current filtering unit according to the authority levels of the samples.
  • all samples in the current filtering unit can be classified according to the authority level of each sample.
  • all samples in the current filtering unit can be divided into first samples and second samples according to the authority level of each sample. Second, samples, the specific process of classifying the samples in the current filtering unit in this embodiment can be implemented as follows.
  • samples with high authority levels and samples with low authority levels in the current filtering unit can be determined according to the authority levels of each sample, and all samples in the current filtering unit are classified according to the authority levels of the samples.
  • samples with high authority levels can be used as first samples, and samples with low authority levels can be used as second samples.
  • 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.
  • 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.
  • a reference sample is required during the filtering process in 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.
  • 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.
  • the first sample may be a non-filterable sample
  • the second sample may be a filterable sample
  • Step S40 performing corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result.
  • 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.
  • 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 samples in the filtering unit, even if two filtering units have the same filtering strategy, the 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 the first sample and the second sample in each filtering unit is also different, so the final filtering result is also different.
  • 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 the situation where there is at least one unfilterable sample and/or at least one filterable sample.
  • 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
  • no filtering means that when there is at least one unfilterable sample, no filtering operation is performed on all samples of the current filtering unit.
  • a preset filtering method is adopted when filtering the 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. Then, the samples are filtered in the corresponding manner. Different from the existing method that does not perform filtering operations on samples in the permission area, in this embodiment, Based on the preset filtering method, the filtering operation is performed in combination with the permission level of the samples in the permission area, thereby realizing constrained filtering of permission areas with different permission levels, thereby improving the subjective and objective quality of the image.
  • This embodiment determines the filtering strategy corresponding to the current filtering unit and the permission area it is in; determines the permission level of samples in the current filtering unit according to the permission level of the permission area; classifies the samples in the current filtering unit according to the permission 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 permission levels in each permission area according to the filtering strategy, thereby realizing constrained filtering operations on the permission area and improving the subjective and objective quality of the image.
  • FIG. 4 is a flow chart of a second embodiment of a filtering method according to the present invention.
  • the filtering method of this embodiment further includes:
  • Step S301 samples in the current filtering unit that need to use reference block information during filtering and for which at least one reference block is unavailable are regarded as unfilterable samples.
  • 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.
  • the reference block is a block required for making filtering decisions and/or implementing filtering operations.
  • 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.
  • whether reference block information needs to be used in the filtering process for 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.
  • the preset filtering method is first used as the deblocking filter for explanation.
  • the deblocking filtering method the P blocks and Q blocks on both sides of the boundary are required when calculating the boundary strength.
  • the coding information of the reference block is used in the deblocking filtering process, including the prediction method, non-zero transform coefficients, reference images, and motion vectors.
  • the sample will use the reference block information, and the two reference blocks required are the P block and the Q block.
  • 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.
  • the parameter fusion mode means that for a SAO (Sample Adaptive Offset) filter unit, its SAO parameters directly use the SAO parameters of the adjacent filter unit (left or top), and its reference block is the SAO filter unit on the left or top.
  • SAO Sample Adaptive Offset
  • A, B, and C all represent SAO filter units.
  • block C makes SAO parameter decisions
  • this filtering mode is used to filter the sample, the sample will use the reference block information, and when block C makes SAO parameter decisions as an example, the two reference blocks required are block A and block B.
  • the above are examples for explaining whether reference block information is needed for different filtering methods. In specific implementations, whether reference block information is needed for samples during filtering may also be determined in other ways, which is not limited in this embodiment.
  • whether the reference block required by the sample is available can be further determined by the permission of the sample and the permission of the reference block. Specifically, for a sample in the current filtering unit, it is necessary to obtain the permission of the sample and the permission of the reference block required by the sample. The corresponding permission can be determined by the permission area where the sample is located.
  • the reference block also includes multiple samples, and the permission of the reference block is the permission of all samples in the reference block.
  • the highest authority of the reference block For example, there are samples Q, W and E in the reference block. Assuming that sample Q has the highest authority, the authority of the reference block is consistent with that of sample Q. Then compare the authority of the reference block with that of the sample.
  • the preset condition may be that the reference block has been decoded or encoded, that is, for the encoding end, it is also necessary to ensure that the reference block has been encoded, or for the decoding end, it is also necessary to ensure that the reference block has been decoded.
  • the preset condition may also be that the reference block and the sample are located in the same Slice or Tile.
  • the preset condition may also be that the reference block and the sample are located in different Slices or Tiles, and filtering of the boundaries of the Slices or Tiles is allowed. If the judgment condition of the authority level and any one of the preset conditions are met at the same time, the reference block is deemed to be available.
  • the information of the unavailable reference block may be replaced by the derived reference block information, thereby converting the unavailable reference block into an available reference block.
  • an implementation method is provided for the derived reference block information, specifically, for the encoding end, the reference block information is derived by the encoded blocks around the unavailable reference block, and for the decoding end, the reference block information is derived by the decoded blocks around the unavailable reference block, and it should be emphasized that since the authority of the unavailable reference block is usually higher than the authority of the sample, the authority of these decoded blocks or encoded blocks in this embodiment needs to be lower than or equal to the authority of the sample.
  • 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 methods, non-zero transform coefficients, reference images, motion vectors and other information.
  • Step S302 taking 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.
  • Step S303 taking 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.
  • Step S304 samples that require reference samples in 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.
  • 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.
  • the current filtering unit 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.
  • This embodiment provides an implementation method, when it is determined that a reference sample needs to be used and at least one reference sample is unavailable, the sample is identified as an unfilterable sample.
  • the reference samples corresponding to the sample S in the current filtering unit are S1, S2, and S3, and if at least one of S1, S2, and S3 is an unavailable reference sample, the sample S can be identified as an unfilterable sample.
  • This embodiment provides another implementation method, when it is determined that a reference sample needs to be used and all reference samples are unavailable, the sample is identified as an unfilterable sample.
  • the reference samples corresponding to the sample S in the current filtering unit are S1, S2 and S3, and assuming that S1, S2 and S3 are all unavailable reference samples, the sample S can be identified as an unfilterable sample.
  • This embodiment provides another implementation method.
  • the sample is considered to be an unfilterable sample.
  • the reference samples corresponding to the sample S in the current filtering unit are S1, S2, and S3.
  • S1 and S2 are unavailable reference samples and S3 is an available reference sample
  • the proportion of unavailable reference samples is 2/3.
  • the preset value of the proportion is 50%, then By determining that the proportion of unavailable reference samples is greater than a preset value, it can be determined that sample S is an unfilterable sample.
  • the preset value can be set accordingly according to actual filtering requirements, which is not limited in this embodiment.
  • the reference sample corresponding to the sample may be determined based on different preset filtering methods.
  • examples are further provided for various filtering methods.
  • the deblocking filter is described in a filtering manner.
  • the deblocking filter module needs to process the 8x8 block boundaries in all PU (Prediction Unit) and TU (Transform Unit) boundaries, including two links: filtering decision and filtering operation.
  • a filtering decision is made to obtain the filtering strength (no filtering, weak filtering or strong filtering) and filtering parameters of the boundary.
  • the filtering operation is performed, that is, the pixels are corrected accordingly according to the selected filtering strength and filtering parameters.
  • the deblocking filter algorithm has the ability to adapt to different video contents and different encoding parameters, that is, different block boundaries are adaptively selected whether to filter and the filtering strength.
  • the filtering parameters i.e., ⁇ and tc
  • the filtering parameters are allowed to be adjusted according to the individual characteristics of different video sequences, that is, the filtering parameters are fine-tuned by adding offset values, so that the filtering strength can be increased or decreased, the decoded video quality can be optimized, and better results can be obtained than the default values.
  • the 8x8 block boundary is actually divided into two parts for independent deblocking filtering, as shown in Figures 5 and 6, the vertical boundary is based on 8x4 as the basic unit, and the horizontal boundary is based on 4x8 as the basic unit.
  • the reference sample can be the sample required in the filtering process, that is, the reference sample is the sample required for calculating the boundary strength and implementing the filtering operation.
  • the reference sample can be all or part of the samples in Figure 5.
  • the deblocking filter can also be operated on the horizontal boundary, and the deblocking filter of the horizontal boundary is shown in Figure 6.
  • the reference sample can be all or part of the samples of the P block and Q block in Figure 6.
  • the sample adaptive compensation is described in a filtering manner.
  • Sample adaptive compensation uses CTB (Coding Tree Block) as the basic unit.
  • CTB Coding Tree Block
  • SAO includes two major types of compensation forms, namely edge compensation (Edge Offset, EO) and sideband compensation (Band Offset, BO).
  • edge compensation Edge Offset, EO
  • Band Offset BO
  • Boundary compensation technology is to classify the current pixel by comparing the size of the current pixel value with the adjacent pixel value, and then compensate the same value for the same type of pixels.
  • the compensation values of different types of pixels can be different.
  • the boundary compensation is divided into 4 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, where c represents the current pixel, and a and b represent adjacent pixels.
  • a preset number of samples around any sample in the current filtering unit can be used as reference samples.
  • the reference samples are two samples around the current sample. For example, if c is the current sample, a and b are reference samples.
  • the sideband compensation is classified according to the pixel intensity value, and the pixel range is equally divided into 32 sidebands.
  • Each sideband is compensated according to its own characteristics, and the same compensation value is used for the same sideband.
  • 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 top), and this mode does not involve reference samples. See the reference block acquisition process described above.
  • the enhanced sample adaptive compensation is described in a filtering manner.
  • the second dimension is used for classification (ie C2), and the final classification result Ct is obtained by table lookup.
  • Each category of samples has an offset value, which is transmitted in the bitstream.
  • ESAO also supports image-level control The switch and LCU (Largest Coding Unit) level control switch.
  • the classification template is shown in Figure 9.
  • Figure 9 Classification template of C1 category
  • the pixel values in the range of [0, (1 ⁇ bitdepth)-1] are evenly divided into C2 categories according to the size interval.
  • the size of C2 is determined by the encoder and transmitted in the image header.
  • a preset number of samples around any sample in the current filtering unit can also be used as reference samples.
  • the reference samples are the 8 samples around the current sample.
  • the shaded portion in FIG9 is the current sample
  • the 8 non-shaded portions around the shaded portion are the reference samples of the current sample.
  • the adaptive compensation of cross-component samples is described in a filtering manner.
  • Adaptive compensation of cross-component samples is to classify the current chrominance sample according to the corresponding luminance sample value, and then superimpose an offset value according to the category.
  • This technology only supports the BO (Band Offset) classification method. Specifically, the value range of the luminance sample is evenly divided into BandNum strips, each strip is a category, and the strip category into which the luminance sample value corresponding to the current chrominance sample falls is used as the category of the current chrominance sample, and then the chrominance sample is superimposed with the offset value corresponding to the category.
  • a preset number of samples around any sample in the current filtering unit can also be used as reference samples.
  • the sample and the reference sample are in different components.
  • the reference sample of the current chrominance sample is one of the surrounding 9 luminance samples.
  • c is the current chrominance sample
  • 0 to 8 are the surrounding 9 luminance samples
  • a luminance sample is selected from these 9 luminance samples as the reference sample of the current chrominance sample.
  • adaptive loop filtering is described in a filtering manner.
  • a frame of image is divided into 4x4 coefficient areas (as shown in FIG. 14 ), and the pixels in the same coefficient area use the same set of filter coefficients.
  • two adjacent coefficient areas can be merged into a new area, and the merged area can continue to be merged with its adjacent area until the entire frame of image is a coefficient area. Therefore, the number of filter coefficient groups of a frame of image is equal to the number of merged coefficient areas, and the value range is [1,16].
  • the number of filter coefficient groups of this frame of image i.e., the number of merged coefficient areas
  • the size of each area i.e., each merged area contains several original coefficient areas
  • each set of filter coefficients need to be transmitted in the code stream.
  • a frame of image uses a filter (i.e., the entire frame of image corresponds to a coefficient area and a set of filter coefficients), and the Cb and Cr components have their own filters.
  • the shape of the adaptive loop filter is shown in Figure 11
  • the shape of the enhanced adaptive loop filter is shown in Figure 12.
  • the surrounding samples within the filter coverage range which are 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., reference samples.
  • the filter coverage range can be set based on different standards, which is not limited 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 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 filtering is allowed on the boundaries of the Slice or Tile. If the judgment condition of the authority level and any one of the preset conditions are met at the same time, the reference sample is deemed to be available.
  • the information of the unavailable reference sample can be replaced by the derived reference sample information, thereby converting the unavailable reference sample into an available reference sample.
  • an implementation method is provided for the derived reference sample information, specifically, for the encoding end, the reference sample information is derived by the encoded samples around the unavailable reference sample, and for the decoding end, the reference sample information is derived by the decoded samples around the unavailable reference sample, and it should be emphasized that, since the authority of the unavailable reference sample is usually higher than the authority of the sample, in this embodiment, the authority of these decoded samples or encoded samples needs to be lower than or equal to the authority of the sample.
  • This embodiment also provides another implementation manner, which is to derive reference sample information through preset information, wherein the preset information includes a default sample value.
  • 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.
  • the above method can accurately identify the unfilterable samples and filterable samples, and then execute the corresponding filtering strategy, which can effectively improve the subjective and objective quality of the image.
  • FIG. 13 is a flow chart of a second embodiment of a filtering method according to the present invention.
  • the filtering method of this embodiment further includes:
  • 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.
  • 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.
  • the filtering operation performed is not to 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.
  • the filtering strategy when the filtering strategy is no filtering, in this case, it is necessary to first determine whether there are unfilterable samples in the current filtering unit. If there are unfilterable samples, no filtering operation is performed on all 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 all samples in the current filtering unit, that is, M+N samples.
  • the filtering strategy 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. Further, whether there are filterable samples in the current filtering unit includes two situations. The first situation is that all the samples in the current filtering unit are filterable samples. For example, the current filtering unit contains N samples, and these N samples are all filterable samples, then the filtering operation can be performed on these N filterable samples. The second situation is that there are non-filterable samples in the current filtering unit.
  • the current filtering unit contains N filterable samples and M non-filterable samples. First, convert these M non-filterable samples into M filterable samples, and finally perform the filtering operation on N+M filterable samples.
  • the non-filterable samples in the current filtering unit can be converted into filterable samples by deriving information of reference blocks or reference samples, wherein the reference blocks refer to adjacent blocks required for sample filtering, and the reference samples refer to surrounding samples required for sample filtering.
  • This embodiment provides an implementation method for obtaining information of derived reference blocks or reference samples, specifically, by using the permission area
  • the available blocks or available samples inside and around the reference block or reference sample are used to derive information of the reference block or reference sample.
  • the available blocks or available samples may be in the same authority area as the non-filterable samples, or may be in different authority areas, which is not limited in this embodiment. Among them, the authority of the available blocks or available samples needs to be lower than or equal to the authority of the non-filterable samples.
  • 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.
  • another implementation method for obtaining the information of the reference block or reference sample, specifically deriving the information of the reference block or 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.
  • This embodiment performs different filtering operations on samples of different permission levels in each permission area according to the filtering strategy, thereby realizing constrained filtering operations on the permission area and improving the subjective and objective quality of the image.
  • FIG. 14 is a structural block diagram of a first embodiment of a filtering device according to the present invention.
  • the filtering device provided in the embodiment of the present invention includes:
  • 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.
  • the identification module 20 is used to determine the permission level of the sample in the current filtering unit according to the permission level of the permission area.
  • the classification module 30 is used to classify the samples in the current filtering unit according to the authority level of the samples.
  • the filtering module 40 is used to perform corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result.
  • This embodiment determines the filtering strategy corresponding to the current filtering unit and the permission area it is in; determines the permission level of samples in the current filtering unit according to the permission level of the permission area; classifies the samples in the current filtering unit according to the permission 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 permission levels in each permission area according to the filtering strategy, thereby realizing constrained filtering operations on the permission area and improving the subjective and objective quality of the image.
  • the filtering strategy is determined by flag information parsed from a bitstream, and the flag information is used for transmission at a sequence level, a picture level, a slice level, a tile level, or a filtering unit level.
  • 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 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.
  • the current filtering unit is a basic unit in the filtering process and different filtering units allow different filtering operations to be performed;
  • the filtering module 40 is further used 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.
  • the first sample is a non-filterable sample
  • the second sample is a filterable sample
  • the filtering module 40 is further configured to convert the non-filterable samples in the current filtering unit into filterable samples by deriving information of reference blocks or reference samples, and perform filtering operations on all filterable samples, wherein the information of the derived reference blocks or reference samples is obtained by obtaining available blocks or samples in and around the permission area.
  • the available block or available sample is derived from the available sample, or is derived through preset information; wherein the available block or available sample is a block or sample whose authority is lower than or equal to the authority of the non-filterable sample and has been decoded or encoded.
  • the classification module 30 is further used to treat samples that require reference block information during the filtering process in the current filtering unit and for which at least one reference block is unavailable as unfilterable samples; treat samples that require reference samples during the filtering process in the current filtering unit and for which at least one reference sample is unavailable as unfilterable samples; treat samples that require reference samples during the filtering process in the current filtering unit and for which all reference samples are unavailable as unfilterable samples; and treat samples that require reference samples during the filtering process in the current filtering unit 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.
  • the classification module 30 is further used to determine whether the samples in the current filtering unit need 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 samples and the permissions of the reference block.
  • 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.
  • the classification module 30 is further used 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 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.
  • the filtering device further comprises a conversion module
  • the conversion module is used to derive reference block information through decoded blocks or encoded blocks with authority lower than or equal to the authority of the sample around the unavailable reference block, and/or derive reference block information through preset information; replace 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.
  • the classification module 30 is further used 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 authority of the sample and the authority of the reference sample.
  • the reference samples are samples required for making filtering decisions and/or performing filtering operations.
  • 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 boundaries is allowed.
  • the filtering device further comprises a conversion module
  • the conversion module is used to derive reference sample information through decoded samples or encoded samples whose authority around the unavailable reference sample is lower than or equal to the authority of the sample, and/or derive reference sample information through preset information; replace 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.
  • 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.
  • 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.
  • an embodiment of the present invention further provides a storage medium, wherein a filtering program is stored on the storage medium.
  • a filtering program is stored on the storage medium.
  • 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.
  • the technical solution of the present invention in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which 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 a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
  • a storage medium such as a read-only memory (ROM)/RAM, a magnetic disk, or an optical disk
  • a terminal device which can be a mobile phone, a computer, a server, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present invention belongs to the technical field of image processing. Disclosed are a filtering method, a device, and a storage medium. The method of the present invention comprises: determining a filtering policy corresponding to the current filter unit, and a permission area where the current filter unit is located; according to the permission level of the permission area, determining the permission level of a sample in the current filter unit; according to the permission level of the sample, classifying the sample in the current filter unit; and according to the filtering policy and the classification result, executing a corresponding filtering operation on the current filter unit. According to a filtering policy, different filtering operations are executed on samples of different permission levels in each permission area, such that constrained filtering operations are performed on the permission area, thereby improving the subjective and objective quality of an image.

Description

滤波方法、设备及存储介质Filtering method, device and storage medium 技术领域Technical Field
本发明涉及图像处理技术领域,尤其涉及一种滤波方法、设备及存储介质。The present invention relates to the field of image processing technology, and in particular to a filtering method, device and storage medium.
背景技术Background technique
编码图像中的不同区域拥有不同权限,这种权限可以是一种保密等级或者其他访问权限的等级。对于拥有最高权限的用户,可以看到所有区域的正确内容。对于拥有最低权限的用户,只能看到与自身权限相等的区域的正确内容,无法看到比自身权限更高的区域的正确内容,例如,这些高权限区域呈现给低权限用户的是带马赛克的或者被遮蔽的内容。权限区域的一种应用场景是为拥有不同权限的用户呈现不同范围的正确图像,原则上,权限越高的用户所看到的正确图像范围越大,被遮蔽的图像范围越小。Different areas in the encoded image have different permissions, which can be a confidentiality level or other access permission level. 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 than their own. For example, these high-authority areas present mosaic or obscured content to low-authority users. 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.
现有的方案对权限区域不进行滤波,会影响图像的主客观质量。Existing solutions do not filter the permission area, which will affect the subjective and objective quality of the image.
上述内容仅用于辅助理解本发明的技术方案,并不代表承认上述内容是现有技术。The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art.
发明内容Summary of the invention
本发明的主要目的在于提供一种滤波方法、设备及存储介质,旨在解决现有技术对权限区域不进行滤波,会影响图像的主客观质量的技术问题。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.
为实现上述目的,本发明提供了一种滤波方法,所述滤波方法包括以下步骤:To achieve the above object, the present invention provides a filtering method, which comprises the following steps:
确定当前滤波单元对应的滤波策略和所处的权限区域,所述权限区域为图像中具有权限等级的图像区域;Determine the filtering strategy corresponding to the current filtering unit and the authority area in which it is located, wherein the authority area is an image area in the image with an authority level;
根据所述权限区域的权限等级确定所述当前滤波单元内样本的权限等级;Determining the permission level of the samples 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;
根据所述滤波策略和分类结果对所述当前滤波单元执行相应的滤波操作。A corresponding filtering operation is performed on the current filtering unit according to the filtering strategy and the classification result.
可选地,所述滤波策略由从码流中解析出的标志信息确定,所述标志信息用于在序列级、图像级、Slice级、Tile级或滤波单元级传输。Optionally, 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.
可选地,所述权限区域包含至少一个滤波单元,所述当前滤波单元允许跨越多个权限区域,所述滤波单元包括至少一个样本;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;
所述根据所述权限区域的权限等级确定所述当前滤波单元内样本的权限等级,包括: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.
可选地,所述当前滤波单元为滤波过程中的基本单元且不同的滤波单元允许执行不同的滤波操作;Optionally, 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 all samples in the current filtering unit.
可选地,所述第一样本为不可滤波样本,所述第二样本为可滤波样本。Optionally, the first sample is a non-filterable sample, and the second sample is a filterable sample.
可选地,所述对所述当前滤波单元内的所有样本均执行滤波操作,包括:Optionally, performing a filtering operation on all samples in the current filtering unit includes:
通过推导参考块或参考样本的信息将所述当前滤波单元内的不可滤波样本转换为可滤波样本,并对所有可滤波样本均执行滤波操作,所述推导参考块或参考样本的信息是通过所述权限区域内部及周围的可得块或可得样本推导出的,或者是通过预设信息推导出的;Converting the non-filterable samples in the current filtering unit into filterable samples by deriving information of a reference block or a reference sample, and performing a filtering operation on all filterable samples, wherein the information of the derived reference block or the reference sample is derived from available blocks or available samples in and around the permission area, or is derived from preset information;
其中,所述可得块或可得样本为权限低于或等于所述不可滤波样本的权限,并且已解码或已编码的块或样本。The available blocks or available samples are blocks or samples that have authority lower than or equal to authority of the non-filterable samples and have been decoded or encoded.
可选地,包括以下至少一项:Optionally, at least one of the following is included:
将所述当前滤波单元内在滤波过程中需要使用参考块信息,且至少一个参考块不可得的样本作为不可滤波样本;Taking 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;
将所述当前滤波单元内在滤波过程中需要参考样本,且至少一个参考样本不可得的样本作为不可滤波样本;Taking samples in the current filtering unit that require reference samples during filtering and for which at least one reference sample is unavailable as unfilterable samples;
将所述当前滤波单元内在滤波过程中需要参考样本,且所有参考样本都不可得的样本作为不可滤波样本;或The samples in the current filtering unit that require reference samples in the filtering process and for which all reference samples are unavailable are regarded as unfilterable samples; or
将所述当前滤波单元内在滤波过程中需要参考样本,且在所有参考样本中不可得参考样本的占比大于或等于预设值的样本作为不可滤波样本。Samples that require reference samples in 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.
可选地,所述滤波方法还包括:Optionally, the filtering method further includes:
根据预设滤波方式确定所述当前滤波单元内的样本在滤波过程中是否需要使用参考块信息;Determine whether the samples in the current filtering unit need to use reference block information during the filtering process according to a preset filtering mode;
通过所述样本的权限与所述参考块的权限判断所述参考块是否可得。Whether the reference block is available is determined by the authority of the sample and the authority of the reference block.
可选地,所述参考块是进行滤波决策和/或实施滤波操作所需要的块,所述参考块包括至少一个样本,所述参考块的权限为所述参考块内所有样本的最高权限。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.
可选地,所述通过所述样本的权限与所述参考块的权限判断所述参考块是否可得,包括:Optionally, 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, it is determined that the reference block is available;
所述预设条件包括:The preset conditions include:
所述参考块已解码或已编码;The reference block has been decoded or encoded;
所述参考块与所述样本位于同一个Slice或Tile;或The reference block and the sample are located in the same Slice or Tile; or
所述参考块与所述样本位于不同的Slice或Tile,且允许对Slice或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.
可选地,所述若参考块的权限低于或等于所述样本的权限,且至少满足以下预设条件中的一项,则确定所述参考块可得之后,还包括: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 met, 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 is the available reference block.
可选地,所述滤波方法还包括:Optionally, the filtering method further includes:
根据预设滤波方式获取所述当前滤波单元内任一样本对应的参考样本;Acquire 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.
可选地,所述参考样本是进行滤波决策和/或实施滤波操作所需要的样本。Optionally, the reference samples are samples required for making filtering decisions and/or implementing filtering operations.
可选地,所述通过所述样本的权限与所述参考样本的权限判断所述参考样本是否可得,包括:Optionally, judging whether the reference sample is available by comparing the permission of the sample with 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, it is determined that the reference sample is available;
所述预设条件包括:The preset conditions include:
所述参考样本已解码或已编码;The reference sample has been decoded or encoded;
所述参考样本与所述样本位于同一个Slice或Tile;或The reference sample and the sample are located in the same Slice or Tile; or
所述参考样本与所述样本位于不同的Slice或Tile,且允许对Slice或Tile的边界进行滤波。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.
可选地,所述若参考样本的权限低于或等于所述样本的权限,且至少满足以下预设条件中的一项,则确定所述参考样本可得之后,还包括: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 met, after determining that the reference sample is available, the method further includes:
通过不可得参考样本周围权限低于或等于所述样本的权限的已解码样本或已编码样本推导参考样本信息,和/或通过预设信息推导参考样本信息;The reference sample information is derived by using decoded samples or encoded samples with authority lower than or equal to that of the sample around the unavailable reference sample, and/or the reference sample information is derived 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.
可选地,所述预设滤波方式包括以下至少一项:Optionally, the preset filtering mode includes at least one of the following:
去块滤波;Deblocking filtering;
样点自适应补偿;Sample adaptive compensation;
增强样点自适应补偿;Enhanced sample point adaptive compensation;
跨分量样点自适应补偿;或Adaptive compensation across component samples; or
自适应环路滤波。Adaptive loop filtering.
此外,为实现上述目的,本发明还提出一种滤波设备,所述滤波设备包括:存储器、处理器及存储在所述存储器上并在所述处理器上运行的滤波程序,所述滤波程序配置为实现如上文所述的滤波方法。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.
此外,为实现上述目的,本发明还提出一种存储介质,所述存储介质上存储有滤波程序,所述滤波程序被处理器执行时实现如上文所述的滤波方法。In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a filtering program is stored, and when the filtering program is executed by a processor, the filtering method as described above is implemented.
此外,为实现上述目的,本发明还提出一种滤波装置,所述滤波装置包括:In addition, to achieve the above object, the present invention further provides a filtering device, the filtering device comprising:
获取模块,用于确定当前滤波单元对应的滤波策略和所处的权限区域,所述权限区域为图像中具有权限等级的图像区域;An acquisition module, used to determine the filtering strategy corresponding to the current filtering unit and the authority area in which it is located, wherein the authority area is an image area in the image with an authority level;
识别模块,用于根据所述权限区域的权限等级确定所述当前滤波单元内样本的权限等级;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, used for classifying 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.
本发明通过确定当前滤波单元对应的滤波策略和所处的权限区域;根据所述权限区域的权限等级确定所述当前滤波单元内样本的权限等级;根据所述样本的权限等级对所述当前滤波单元内的样本进行分类;根据所述滤波策略和分类结果对所述当前滤波单元执行相应的滤波操作,根据滤波策略对各个权限区域内不同权限等级的样本执行不同的滤波操作,实现了对权限区域进行有约束的滤波操作,提升了图像的主客观质量。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
图1是本发明实施例方案涉及的硬件运行环境的滤波设备的结构示意图;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;
图2为本发明滤波方法第一实施例的流程示意图;FIG2 is a schematic diagram of a flow chart of a first embodiment of a filtering method according to the present invention;
图3为本发明滤波方法一实施例中视频编码框架结构示意图;FIG3 is a schematic diagram of a video coding framework structure in an embodiment of a filtering method of the present invention;
图4为本发明滤波方法第二实施例的流程示意图;FIG4 is a schematic diagram of a flow chart of a second embodiment of a filtering method according to the present invention;
图5为本发明滤波方法一实施例中去块滤波方式的参考样本示意图;FIG5 is a schematic diagram of reference samples of a deblocking filtering method in an embodiment of a filtering method of the present invention;
图6为本发明滤波方法一实施例中去块滤波方式对应的垂直边界和水平边界的示意图;FIG6 is a schematic diagram of vertical boundaries and horizontal boundaries corresponding to a deblocking filtering method in an embodiment of a filtering method of the present invention;
图7为本发明滤波方法一实施例中样点自适应补偿方式的一种参考样本示意图;FIG7 is a schematic diagram of a reference sample of a sample point adaptive compensation method in an embodiment of a filtering method of the present invention;
图8为本发明滤波方法一实施例中样点自适应补偿方式的一种参考块示意图;FIG8 is a schematic diagram of a reference block of a sample adaptive compensation method in an embodiment of a filtering method of the present invention;
图9为本发明滤波方法一实施例中增强样点自适应补偿方式的参考样本示意图;FIG9 is a schematic diagram of reference samples in an enhanced sample adaptive compensation method in an embodiment of a filtering method of the present invention;
图10为本发明滤波方法一实施例中跨分量样点自适应补偿方式的参考样本示意图;FIG10 is a schematic diagram of reference samples in an adaptive compensation method across component samples in an embodiment of a filtering method of the present invention;
图11为本发明滤波方法一实施例中自适应环路滤波方式的一种参考样本示意图;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;
图12为本发明滤波方法一实施例中自适应环路滤波方式的另一种参考样本示意图;FIG12 is a schematic diagram of another reference sample of an adaptive loop filtering method in an embodiment of a filtering method of the present invention;
图13为本发明滤波方法第三实施例的流程示意图;FIG13 is a schematic flow chart of a third embodiment of a filtering method according to the present invention;
图14为本发明滤波装置第一实施例的结构框图。FIG. 14 is a structural block diagram of the first embodiment of the filtering device of the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
参照图1,图1为本发明实施例方案涉及的硬件运行环境的滤波设备结构示意图。Refer to FIG. 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.
如图1所示,该滤波设备可以包括:处理器1001,例如中央处理器(Central Processing Unit,CPU),通信总线1002、用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如无线保真(Wireless-Fidelity,Wi-Fi)接口)。存储器1005可以是高速的随机存取存储器(Random Access Memory,RAM)存储器,也可以是稳定的非易失性存储器(Non-Volatile Memory,NVM),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。 As shown in FIG1 , 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 realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
本领域技术人员可以理解,图1中示出的结构并不构成对滤波设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art will appreciate that the structure shown in FIG. 1 does not constitute a limitation on the filtering device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
如图1所示,作为一种存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及滤波程序。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.
在图1所示的滤波设备中,网络接口1004主要用于与网络服务器进行数据通信;用户接口1003主要用于与用户进行数据交互;本发明滤波设备中的处理器1001、存储器1005可以设置在滤波设备中,所述滤波设备通过处理器1001调用存储器1005中存储的滤波程序,并执行本发明实施例提供的滤波方法。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.
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素,此外,本申请不同实施例中具有同样命名的部件、特征、要素可能具有相同含义,也可能具有不同含义,其具体含义需以其在该具体实施例中的解释或者进一步结合该具体实施例中上下文进行确定。It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes 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 "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including 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 by their explanation in the specific embodiment or further combined with the context of the specific embodiment.
应当理解,尽管在本文可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本文范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语"如果"可以被解释成为"在……时"或"当……时"或"响应于确定"。再者,如同在本文中所使用的,单数形式“一”、“一个”和“该”旨在也包括复数形式,除非上下文中有相反的指示。应当进一步理解,术语“包含”、“包括”表明存在所述的特征、步骤、操作、元件、组件、项目、种类、和/或组,但不排除一个或多个其他特征、步骤、操作、元件、组件、项目、种类、和/或组的存在、出现或添加。本申请使用的术语“或”、“和/或”、“包括以下至少一个”等可被解释为包括性的,或意味着任一个或任何组合。例如,“包括以下至少一个:A、B、C”意味着“以下任一个:A;B;C;A和B;A和C;B和C;A和B和C”,再如,“A、B或C”或者“A、B和/或C”意味着“以下任一个:A;B;C;A和B;A和C;B和C;A和B和C”。仅当元件、功能、步骤或操作的组合在某些方式下内在地互相排斥时,才会出现该定义的例外。It should be understood that, although the terms first, second, third, etc. may be used to describe various information in this article, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this article, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "at the time of..." or "when..." or "in response to determination". Furthermore, as used in this article, the singular forms "one", "one" and "the" are intended to also include plural forms, unless there is an opposite indication in the context. It should be further understood that the terms "comprising", "including" indicate that there are the described features, steps, operations, elements, components, projects, kinds, and/or groups, but do not exclude the existence, occurrence or addition of one or more other features, steps, operations, elements, components, projects, kinds, and/or groups. The terms "or", "and/or", "including at least one of the following" etc. used in this application can be interpreted as inclusive, or mean 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 only occur when a combination of elements, functions, steps or operations are inherently mutually exclusive in some manner.
应该理解的是,虽然本申请实施例中的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of 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 other steps or at least a portion of the sub-steps or stages of other steps.
取决于语境,如在此所使用的词语“如果”、“若”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。类似地,取决于语境,短语“如果确定”或“如果检测(陈述的条件或事件)”可以被解释成为“当确定时”或“响应于确定”或“当检测(陈述的条件或事件)时”或“响应于检测(陈述的条件或事件)”。 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 determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
需要说明的是,在本文中,采用了诸如S10、S20等步骤代号,其目的是为了更清楚简要地表述相应内容,不构成顺序上的实质性限制,本领域技术人员在具体实施时,可能会先执行S20后执行S10等,但这些均应在本申请的保护范围之内。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 sequence. 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.
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
本发明实施例提供了一种滤波方法,参照图2,图2为本发明一种滤波方法第一实施例的流程示意图,该滤波方法可以适用于处理视频数据的解码方法流程中,也可以适用于处理视频数据的编码方法流程中。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 a decoding method flow for processing video data, and can also be applied to an encoding method flow for processing video data.
本实施例中,所述滤波方法包括以下步骤:In this embodiment, the filtering method includes the following steps:
步骤S10:确定当前滤波单元对应的滤波策略和所处的权限区域,所述权限区域为图像中具有权限等级的图像区域。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.
本实施例的执行主体可为滤波设备,滤波设备可以以各种形式来实施。例如本申请中描述的滤波设备可以包括诸如平板电脑、笔记本电脑、掌上电脑、摄像机、等移动终端或智能终端,以及诸如台式计算机等固定终端设备,这些设备均具备图像处理的功能,后续描述中将以滤波设备为例进行说明。The execution subject of this embodiment may be a filtering device, and the filtering device may be implemented in various forms. For example, the filtering device described in this application may include mobile terminals or intelligent terminals such as tablet computers, laptop computers, PDAs, cameras, and fixed terminal devices such as desktop computers. These devices all have image processing functions, and the filtering device will be used as an example for explanation in the subsequent description.
参照图3,其为一种视频编码框架,该视频编码框架包括预测、变换、量化、熵编码和滤波等模块,其中:预测模块包括帧内预测和帧间预测,帧内预测是利用当前块周围的重建像素进行预测,去除空间冗余;帧间预测是利用时域参考帧上的重建像素进行预测,去除时间冗余。变换模块是将空域的残差信息线性映射到变换域(如频域)上,目标是使能量更集中,去除信号的频域相关性。理论上的变换矩阵是可逆的,不会带来信号损失。量化模块是一个“多对一”的映射过程,不可逆,会带来信号损失;好处是能够大幅度缩减信号的取值范围,使得编码器能够用少量的符号给出原始信号的很好的近似,从而提高压缩率。熵编码模块是基于信息熵原理的无损编码方式,把一系列用来表示视频序列的元素符号(如变换系数和模式信息等)转变为一个二进制码流,去除这些视频元素符号的统计冗余。滤波模块会对重建图像进行增强,目标是使重建图像更接近原始图像,同时削减块效应和振铃效应的影响,提升重建图像的质量。Referring to FIG3 , it is a video coding framework, which includes prediction, transformation, quantization, entropy coding and filtering modules, wherein: the prediction module includes intra-frame prediction and inter-frame prediction, intra-frame prediction is to use the reconstructed pixels around the current block for prediction to remove spatial redundancy; inter-frame prediction is to use the reconstructed pixels on the time domain reference frame for prediction to remove temporal redundancy. The transformation module linearly maps the residual information in the spatial domain to the transformation domain (such as the frequency domain), with the goal of making the energy more concentrated and removing the frequency domain correlation of the signal. The theoretical transformation matrix is reversible and will 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 use a small number of symbols to give a good approximation of the original signal, thereby improving the compression rate. The entropy coding module is a lossless coding method based on the principle of information entropy, which converts a series of element symbols used to represent the video sequence (such as transform coefficients and mode information, etc.) into a binary code stream to remove the statistical redundancy of these video element symbols. The filtering module will enhance the reconstructed image with the goal of making the reconstructed image closer to the original image, while reducing the impact of blocking and ringing effects and improving the quality of the reconstructed image.
在一种可选的实施例中,本实施例中滤波操作针对的是编码图像的滤波操作,而编码图像中的不同区域拥有不同权限,这种权限可以是一种保密等级或者其他访问权限的等级。对于拥有最高权限的用户,可以看到所有区域的正确内容。对于拥有最低权限的用户,只能看到与自身权限相等的区域的正确内容,无法看到比自身权限更高的区域的正确内容,例如,这些高权限区域呈现给低权限用户的是带马赛克的或者被遮蔽的内容。权限区域的一种应用场景是为拥有不同权限的用户呈现不同范围的正确图像,权限越高的用户所看到的正确图像范围越大,被遮蔽的图像范围越小。In an optional embodiment, the filtering operation in this embodiment is for filtering operations of encoded images, 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 present mosaic or obscured content to low-authority users. One application scenario of permission areas 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.
但是目前的滤波方式对权限区域内的样本不进行滤波,会极大影响图像的主客观质量。本实施例中为了解决上述技术问题,根据滤波操作以及权限区域的权限等级,对不同权限等级的权限区域进行有约束的滤波操作,例如对于高权限区域的滤波不做限制,因为周围的参考样本信息都可获取;对于低权限区域的滤波,若参考样本不可得(例如参考样本位于高权限区域),则要进行有约束的滤波操作。However, the current filtering method does not filter samples within the permission area, which will greatly affect the subjective and objective quality of the image. In order to solve the above technical problems, in this embodiment, according to the filtering operation and the permission level of the permission area, a constrained filtering operation is performed on the permission areas of different permission levels. For example, there is no restriction on filtering in high-authority areas because the surrounding reference sample information can be obtained; for filtering in low-authority areas, if the reference sample is not available (for example, the reference sample is located in the high-authority area), a constrained filtering operation is required.
本实施例中在对图像进行滤波时,是以滤波单元作为滤波过程中的基本单元进行滤波的,在进行滤波时,可以对每一个滤波单元进行依次滤波操作,也可以对多个滤波单元同时进行滤波操作,每一个滤波单元对应于图像中的一个图像子区域。而相对的,权限区域则是具有权限等级的图像区域,针对单个图像来说,该图像具有多个滤波单元,同时也具有多个权限区域,滤波单元的数量与权限区域的数量之间并不具有对应的关系。一个权限区域内可以包含多个滤波单元,例如权限区域X内可以包含一个滤波单元A, 也可以同时包含两个滤波单元A和B。进一步地,一个滤波单元也可以处于多个不同的权限区域内,例如滤波单元C可以处于权限区域X内,也可以同时跨权限区域X和Y。In this embodiment, when filtering an image, filtering is performed using a filtering unit as the basic unit in the filtering process. When filtering, each filtering unit may be filtered in sequence, or multiple filtering units may be filtered simultaneously. Each filtering unit corresponds to an image sub-region in 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 multiple permission regions. There is no corresponding relationship between the number of filtering units and the number of permission regions. A permission region may contain multiple filtering units. For example, permission region X may contain one filtering unit A. It may also include two filter units A and B. Furthermore, a filter unit may also be located in multiple different authority areas, for example, filter unit C may be located in authority area X, or may span authority areas X and Y at the same time.
滤波单元在水平和垂直方向将图像划分成多个图像区域,本实施例中还可以将图像按照色度和亮度划分为色度分量以及亮度分量,这两个分量中所包含的滤波单元是对应的。一个滤波单元可以包含上述两个分量,一个分量也可以包含多个滤波单元,本实施例中以滤波单元为例对整个图像的滤波过程进行说明。本实施例中单个图像所划分的滤波单元的数量和大小,以及权限区域的数量以及大小可以根据实际图像处理需求进行相应地设置,本实施例中对此不加以限制。The filtering unit divides the image into multiple image areas 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, and the filtering units contained in these two components are corresponding. A filtering unit can include the above two components, and a component can also include 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 by 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 this is not limited in this embodiment.
在一种可选的实施例中,在对滤波单元进行滤波操作时,是按照对应的滤波策略执行的,而每一个滤波单元可以允许执行不同的滤波策略,以当前滤波单元为例,也即当前滤波单元所执行的滤波策略可以与其他滤波单元的滤波策略相同,也可以与其他滤波单元的滤波策略不同。本实施例中滤波策略是由标志信息所决定的,标志信息可以在序列级(或为SPS(Sequence Parameter Set,序列参数集)级)、或图像级(或为PPS(Picture Parameter Set,图像参数集)级或帧级)、或Slice级、或Tile级、或滤波单元级(或为CTU(Coding Tree Unit,编码树单元)/CTB/LCU(Largest Coding Unit,最大编码单元)/LCB(Largest Coding Block,最大编码块)级)传输,该标志信息是从码流中解析出来的,基于解析出的标志信息即可确定每一个滤波单元所对应的滤波策略,所述滤波策略的级别还可以是patch级。其中,用于管理或控制若干个图像的语法可以称为序列级;用于管理或控制单帧图像的语法可以称为图像级;用于管理或控制包括若干个编码单元的并行单元(即图像区域)的语法可以称为Slice级、或Tile级、或Patch级;用于管理或控制最大编码单元的语法可以称为LCU级;用于管理或控制滤波单元的语法可以称为滤波单元级。一个滤波单元可以包括多个最大编码单元,一个最大编码单元也可以包括多个滤波单元。In an optional embodiment, when filtering the filter unit, it is performed according to the corresponding filtering strategy, and each filter unit can be allowed to execute different filtering strategies. Taking the current filter unit as an example, the filtering strategy executed by the current filter unit can be the same as the filtering strategy of other filter units, or it can be different from the filtering strategy of other filter units. In this embodiment, the filtering strategy is determined by the flag information, and the flag information can be transmitted at the sequence level (or SPS (Sequence Parameter Set) level), or the image level (or PPS (Picture Parameter Set) level or frame level), or Slice level, or Tile level, or filter unit level (or 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 filter unit can be determined based on the parsed flag information. The level of the filtering strategy can also be patch level. Among them, the syntax used to manage or control several images can be called sequence level; the syntax used to manage or control a single frame image can be called image level; the syntax used to manage or control a parallel unit (i.e., an image area) including several coding units can be called slice level, tile level, or patch level; the syntax used to manage or control a maximum coding unit can be called LCU level; the syntax used to manage or control a filtering unit can be called filtering unit level. A filtering unit can include multiple maximum coding units, and a maximum coding unit can also include multiple filtering units.
步骤S20:根据所述权限区域的权限等级确定所述当前滤波单元内样本的权限等级。Step S20: Determine the permission level of the samples in the current filtering unit according to the permission level of the permission area.
在一种可选的实施例中,每一个滤波单元内都包括至少一个样本,该样本为像素的色度样本或亮度样本,滤波单元内各个样本的权限等级由滤波单元所处的权限区域的权限等级决定,权限等级可以是保密等级或者其他访问权限的等级。In an optional embodiment, each filtering unit includes at least one sample, which is a chromaticity sample or a brightness sample of a pixel. The authority level of each sample in the filtering unit is determined by the authority level of the authority area in which the filtering unit is located. The authority level may be a confidentiality level or other access permission level.
由于本实施例中滤波单元可以处于一个权限区域内,也可以同时处于多个权限区域内,因此滤波单元内各个样本的权限等级并非都是相同的,本实施例中针对上述两种情况分别进行说明。针对第一种情况,也即滤波单元处于一个权限区域内时,在这种情况下,滤波单元内各个样本也全部处于该权限区域内,此时滤波单元内各个样本的权限等级与该权限区域的权限等级一致,例如当前滤波单元处于权限区域X内时,当前滤波单元所有样本的权限等级均为权限区域X所具有的权限等级。针对第二情况,也即滤波单元处于多个权限区域内时,在这种情况下,滤波单元内的样本也相应的处于不同的权限区域内,滤波单元内样本的权限与所在权限区域的权限等级一致,例如当前滤波单元同时处于权限区域X和Y内时,此时当前滤波单元内的一部分样本处于权限区域X内,另一部分样本处于权限区域Y内,处于权限区域X内的样本的权限等级为权限区域X所具有的权限等级,处于权限区域Y内的样本的权限等级为权限区域Y所具有的权限等级。Since the filter unit in this embodiment can be in one permission area or in multiple permission areas at the same time, the permission levels of each sample in the filter unit are not all the same. In this embodiment, the above two situations are described separately. For the first situation, that is, when the filter unit is in one permission area, in this case, all samples in the filter unit are also in the permission area. At this time, the permission level of each sample in the filter unit is consistent with the permission level of the permission area. For example, when the current filter unit is in permission area X, the permission level of all samples in the current filter unit is the permission level of permission area X. For the second situation, that is, when the filter unit is in multiple permission areas, in this case, the samples in the filter unit are also in different permission areas accordingly, and the permission of the samples in the filter unit is consistent with the permission level of the permission area. For example, when the current filter unit is in permission areas X and Y at the same time, at this time, part of the samples in the current filter 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.
步骤S30:根据所述样本的权限等级对所述当前滤波单元内的样本进行分类。Step S30: Classify the samples in the current filtering unit according to the authority levels of the samples.
在一种可选的实施例中,在确定当前滤波单元内各个样本的权限等级之后,本实施例中可以根据各个样本的权限等级为当前滤波单元内的所有样本进行分类,本实施例中针对各个样本的权限等级可以将当前滤波单元内的所有样本划分成第一样本和第 二样本,本实施例中针对当前滤波单元内的样本进行分类的具体过程可以按照如下方式实现。In an optional embodiment, after determining the authority level of each sample in the current filtering unit, in this embodiment, all samples in the current filtering unit can be classified according to the authority level of each sample. 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. Second, samples, the specific process of classifying the samples in the current filtering unit in this embodiment can be implemented as follows.
本实施例中提供一种实现方式,具体为根据各个样本的权限等级可以确定当前滤波单元内高权限等级的样本以及低权限等级的样本,根据样本权限等级的高低对当前滤波单元内的所有样本进行分类,可选地,可以将高权限等级的样本作为第一样本,将低权限等级的样本作为第二样本。An implementation method is provided in this embodiment, specifically, samples with high authority levels and samples with low authority levels in the current filtering unit can be determined according to the authority levels of each sample, and all samples in the current filtering unit are classified according to the authority levels of the samples. Optionally, samples with high authority levels can be used as first samples, and samples with low authority levels can be used as second samples.
本实施例中进一步提供另一种实现方式,具体为当前滤波单元内在滤波过程中需要使用参考块信息,并且将样本的权限等级判断参考块的权限等级进行比较,基于比较结果对当前滤波单元内的所有样本进行分类,可选地,可以将权限等级低于或等于参考块的权限等级的样本作为第一样本,将权限等级高于参考块的权限等级的样本作为第二样本。Another implementation method is further provided in the present embodiment, 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.
本实施例中进一步提供另一种实现方式,具体为当前滤波单元内在滤波过程中需要参考样本,并将样本的权限等级判断参考样本的权限等级进行比较,基于比较结果对当前滤波单元内的所有样本进行分类,可选地,可以将权限等级低于或等于参考样本的权限等级的样本作为第一样本,将权限等级高于参考样本的权限等级的样本作为第二样本。Another implementation method is further provided in the present embodiment, specifically, a reference sample is required during the filtering process in 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.
上述方式仅为举例说明,实际滤波过程中还可以选择上述方式之外的其他方式,本实施例中对此不加以限制。The above-mentioned methods are only examples. In the actual filtering process, other methods besides the above-mentioned methods may be selected, which is not limited in this embodiment.
在一种可选的实施例中,第一样本可为不可滤波样本,第二样本可为可滤波样本。In an optional embodiment, the first sample may be a non-filterable sample, and the second sample may be a filterable sample.
步骤S40:根据所述滤波策略和分类结果对所述当前滤波单元执行相应的滤波操作。Step S40: performing corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result.
在一种可选的实施例中,本实施例中针对各个样本的权限等级可以将当前滤波单元内的所有样本划分成可滤波样本和不可滤波样本,其中,可滤波样本为可以直接进行滤波操作的样本,不可滤波样本为无法直接进行滤波操作的样本。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.
在一种可选的实施例中,码流中解析出的标志信息用于确定当前滤波单元所对应的滤波策略,权限等级用于对当前滤波单元内的样本进行分类,由于滤波单元内样本分类情况的不同,即使两个滤波单元具有相同的滤波策略,最后在执行滤波操作之后的结果也可能是不同的。例如假设滤波策略为部分滤波,部分滤波策略为对滤波单元内的第一样本(也即不可滤波样本)不执行滤波操作,对滤波单元内的第二样本(也即可滤波样本)执行滤波操作,由于滤波单元内样本分类情况的不同,导致每一个滤波单元内的第一样本以及第二样本的数量也不同,因此最终滤波结果也是不同的。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 samples in the filtering unit, even if two filtering units have the same filtering strategy, the 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 the first sample and the second sample in each filtering unit is also different, so the final filtering result is also different.
在一种可选的实施例中,滤波策略至少包括全滤波、部分滤波以及全不滤波三种方式,基于样本的分类结果可以确定当前滤波单元的样本至少包括存在至少一个不可滤波样本和/或存在至少一个可滤波样本的情况。其中,全滤波为当存在至少一个可滤波样本时,对当前滤波单元内的所有样本均进行滤波操作,部分滤波为对当前滤波单元内的不可滤波样本不进行滤波操作,对可滤波样本进行滤波操作,全不滤波为当存在至少一个不可滤波样本时,对当前滤波单元的所有样本均不执行滤波操作。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 the situation where there is 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 of the current filtering unit.
在一种可选的实施例中,在对样本进行滤波操作时采取的是预设滤波方式,本实施例中的预设滤波方式包括去块滤波、样点自适应补偿、增强样点自适应补偿、跨分量样点自适应补偿以及自适应环路滤波中的至少一项,然后按照对应的方式对样本进行滤波操作即可。与现有的对权限区域内样本均不执行滤波操作不同的是,本实施例中是 在预设滤波方式的基础上结合权限区域中样本的权限等级执行滤波操作,实现了对不同权限等级的权限区域进行有约束的滤波,从而提升图像的主客观质量。In an optional embodiment, a preset filtering method is adopted when filtering the 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. Then, the samples are filtered in the corresponding manner. Different from the existing method that does not perform filtering operations on samples in the permission area, in this embodiment, Based on the preset filtering method, the filtering operation is performed in combination with the permission level of the samples in the permission area, thereby realizing constrained filtering of permission areas with different permission levels, thereby improving the subjective and objective quality of the image.
本实施例通过确定当前滤波单元对应的滤波策略和所处的权限区域;根据所述权限区域的权限等级确定所述当前滤波单元内样本的权限等级;根据所述样本的权限等级对所述当前滤波单元内的样本进行分类;根据所述滤波策略和分类结果对所述当前滤波单元执行相应的滤波操作,根据滤波策略对各个权限区域内不同权限等级的样本执行不同的滤波操作,实现了对权限区域进行有约束的滤波操作,提升了图像的主客观质量。This embodiment determines the filtering strategy corresponding to the current filtering unit and the permission area it is in; determines the permission level of samples in the current filtering unit according to the permission level of the permission area; classifies the samples in the current filtering unit according to the permission 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 permission levels in each permission area according to the filtering strategy, thereby realizing constrained filtering operations on the permission area and improving the subjective and objective quality of the image.
参考图4,图4为本发明一种滤波方法第二实施例的流程示意图。Refer to FIG. 4 , which is a flow chart of a second embodiment of a filtering method according to the present invention.
基于上述第一实施例,本实施例滤波方法中进一步包括:Based on the above first embodiment, the filtering method of this embodiment further includes:
步骤S301:将所述当前滤波单元内在滤波过程中需要使用参考块信息,且至少一个参考块不可得的样本作为不可滤波样本。Step S301: samples in the current filtering unit that need to use reference block information during filtering and for which at least one reference block is unavailable are regarded as unfilterable samples.
在一种可选的实施例中,本实施例中可以基于参考块相关的信息对当前滤波单元内的可滤波样本和不可滤波样本进行判断。具体地,针对当前滤波单元内的某一个样本来讲,首先需要判断该样本在滤波过程中需要使用参考块信息,如果需要用到参考块信息,则进一步判断是否存在至少一个参考块不可得,若同时满足上述两个条件,则可以确定该样本即为不可滤波样本。其中,参考块是进行滤波决策和/或实施滤波操作所需要的块。反之,如果不使用参考块信息;或者使用参考块信息,且所有参考块信息均可得,无法直接断定该样本是否可滤波,需要进一步根据参考样本的情况判断该样本是否可滤波。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.
在一种可选的实施例中,针对当前滤波单元内的样本在滤波过程中是否需要使用参考块信息本实施例中可以根据预设滤波方式确定,其中,预设滤波方式包括去块滤波、样点自适应补偿、增强样点自适应补偿、跨分量样点自适应补偿以及自适应环路滤波中的至少一项。In an optional embodiment, whether reference block information needs to be used in the filtering process for 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.
本实施例中先以预设滤波方式为去块滤波进行说明。参照图5,按照去块滤波方式在计算边界强度时需要用到的边界两侧的P块和Q块,去块滤波过程中会用到参考块的编码信息,包括预测方式、非零变换系数、参考图像以及运动矢量等信息,采取这种滤波方式对样本进行滤波时,样本会用到参考块信息,并且所需要用到的为P块和Q块两个参考块。In this embodiment, the preset filtering method is first used as the deblocking filter for explanation. Referring to FIG5 , according to the deblocking filtering method, the P blocks and Q blocks on both sides of the boundary are required when calculating the boundary strength. The coding information of the reference block is used in the deblocking filtering process, including the prediction method, non-zero transform coefficients, reference images, and motion vectors. When this filtering method is used to filter the sample, the sample will use the reference block information, and the two reference blocks required are the P block and the Q block.
本实施例中进一步再以预设滤波方式为样点自适应补偿的滤波方式进行说明,样点自适应补偿的滤波方式包括多种不同的模式,例如边界补偿、边带补偿以及参数融合等模式,以参数融合模式为例,参照图8,参数融合模式是指对于一个SAO(Sample Adaptive Offset,样点自适应补偿)滤波单元来讲,其SAO参数直接使用相邻滤波单元(左边或上边)的SAO参数,其参考块是左侧或上侧的SAO滤波单元。A、B、C均表示SAO滤波单元,当C块进行SAO参数决策时,可以有3种情况:(a)直接使用A块的参数;(b)直接使用B块的参数;(c)通过分析自身像素块的特点,选择不同于A块和B块的参数。采取这种滤波方式对样本进行滤波时,样本会用到参考块信息,并且以C块进行SAO参数决策时为例,所需要用到的为A块和B块两个参考块。上述为针对不同滤波方式是否需要用到参考块信息的举例说明,在具体实施中,还可以按照其他方式判断样本在滤波过程中是否需要用到参考块信息,本实施例中对此不加以限制。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, referring to FIG8 , the parameter fusion mode means that for a SAO (Sample Adaptive Offset) filter unit, its SAO parameters directly use the SAO parameters of the adjacent filter unit (left or top), and its reference block is the SAO filter unit on the left or top. A, B, and C all represent SAO filter units. When block C makes SAO parameter decisions, there are three situations: (a) directly use the parameters of block A; (b) directly use the parameters of block B; (c) select parameters different from block A and block B by analyzing the characteristics of its own pixel block. When this filtering mode is used to filter the sample, the sample will use the reference block information, and when block C makes SAO parameter decisions as an example, the two reference blocks required are block A and block B. The above are examples for explaining whether reference block information is needed for different filtering methods. In specific implementations, whether reference block information is needed for samples during filtering may also be determined in other ways, which is not limited in this embodiment.
在一种可选的实施例中,本实施例中可以通过样本的权限与参考块的权限进一步判断样本所需要的参考块是否可得。具体地,针对当前滤波单元内的某一个样本来讲,需要获取该样本的权限以及该样本所需要用到的参考块的权限,可以通过样本所在的权限区域确定对应的权限,参考块内也包括有多个样本,参考块的权限为参考块内所有样 本的最高权限,例如参考块内有样本Q、W以及E,假设样本Q的权限最高,则参考块的权限与样本Q的权限一致。然后先将参考块的权限与样本的权限进行比较,如果参考块的权限低于或等于所述样本的权限,则进一步判断是否满足以下预设条件。预设条件可以为参考块已解码或已编码,也即针对编码端,还需要保证参考块已编码,或者针对解码端,还需要保证参考块已解码。预设条件还可以为参考块与样本位于同一个Slice或Tile。预设条件还可以为参考块与样本位于不同的Slice或Tile,且允许对Slice或Tile的边界进行滤波。如果同时满足权限高低的判断条件以及预设条件中的任一项,则认定该参考块可得。In an optional embodiment, in this embodiment, whether the reference block required by the sample is available can be further determined by the permission of the sample and the permission of the reference block. Specifically, for a sample in the current filtering unit, it is necessary to obtain the permission of the sample and the permission of the reference block required by the sample. The corresponding permission can be determined by the permission area where the sample is located. The reference block also includes multiple samples, and the permission of the reference block is the permission of all samples in the reference block. The highest authority of the reference block. For example, there are samples Q, W and E in the reference block. Assuming that sample Q has the highest authority, the authority of the reference block is consistent with that of sample Q. Then compare the authority of the reference block with that of the sample. If the authority of the reference block is lower than or equal to that of the sample, further determine whether the following preset conditions are met. The preset condition may be that the reference block has been decoded or encoded, that is, for the encoding end, it is also necessary to ensure that the reference block has been encoded, or for the decoding end, it is also necessary to ensure that the reference block has been decoded. The preset condition may also be that the reference block and the sample are located in the same Slice or Tile. The preset condition may also be that the reference block and the sample are located in different Slices or Tiles, and filtering of the boundaries of the Slices or Tiles is allowed. If the judgment condition of the authority level and any one of the preset conditions are met at the same time, the reference block is deemed to be available.
在一种可选的实施例中,本实施例中在判断不可得参考块之后,还可以通过推导的参考块信息替换不可得参考块的信息,从而将不可得参考块转换为可得参考块。本实施例中针对推导的参考块信息提供一种实现方式,具体为针对编码端,通过不可得参考块周围的已编码块推导参考块信息,针对解码端,通过不可得参考块周围的已解码块推导参考块信息,并且需要强调的是,由于不可得参考块的权限通常高于样本的权限,因此本实施例中这些已解码块或已编码块的权限需要低于或等于样本的权限。In an optional embodiment, after determining that the reference block is unavailable, the information of the unavailable reference block may be replaced by the derived reference block information, thereby converting the unavailable reference block into an available reference block. In this embodiment, an implementation method is provided for the derived reference block information, specifically, for the encoding end, the reference block information is derived by the encoded blocks around the unavailable reference block, and for the decoding end, the reference block information is derived by the decoded blocks around the unavailable reference block, and it should be emphasized that since the authority of the unavailable reference block is usually higher than the authority of the sample, the authority of these decoded blocks or encoded blocks in this embodiment needs to be lower than or equal to the authority of the sample.
本实施例中还提供另一种实现方式,具体为通过预设信息推导参考块信息,其中,预设信息包括默认的滤波参数、预测方式、非零变换系数、参考图像以及运动矢量等信息。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 methods, non-zero transform coefficients, reference images, motion vectors and other information.
步骤S302:将所述当前滤波单元内在滤波过程中需要参考样本,且至少一个参考样本不可得的样本作为不可滤波样本。Step S302: taking 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.
步骤S303:将所述当前滤波单元内在滤波过程中需要参考样本,且所有参考样本都不可得的样本作为不可滤波样本。Step S303: taking 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.
步骤S304:将所述当前滤波单元内在滤波过程中需要参考样本,且在所有参考样本中不可得参考样本的占比大于或等于预设值的样本作为不可滤波样本。Step S304: samples that require reference samples in 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.
在一种可选的实施例中,本实施例中还可以根据参考样本信息对当前滤波单元内的可滤波样本和不可滤波样本进行判断,其中,参考样本是进行滤波决策和/或实施滤波操作所需要的样本。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.
在一种可选的实施例中,针对当前滤波单元内的某一个样本来讲,需要先获取该样本的参考样本,在确定参考样本之后,进一步判断参考样本是否可得,最终基于参考样本是否可得的判断结果确定该样本是否为不可滤波样本,具体的判断过程可以按照如下方式实现。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.
本实施例中提供一种实现方式,在确定需要使用参考样本且存在至少一个参考样本不可得时,则认定该样本为不可滤波样本。例如当前滤波单元内样本S对应的参考样本为S1、S2以及S3,假设S1、S2以及S3中至少有一个为不可得参考样本时,则可以认定该样本S即为不可滤波样本。This embodiment provides an implementation method, when it is determined that a reference sample needs to be used and at least one reference sample is unavailable, the sample is identified 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 if at least one of S1, S2, and S3 is an unavailable reference sample, the sample S can be identified as an unfilterable sample.
本实施例中提供另一种实现方式,在确定需要使用参考样本且所有的参考样本均不可得时,则认定该样本为不可滤波样本。例如当前滤波单元内样本S对应的参考样本为S1、S2以及S3,假设S1、S2以及S3全部为不可得参考样本,则可以认定样本S即为不可滤波样本。This embodiment provides another implementation method, when it is determined that a reference sample needs to be used and all reference samples are unavailable, the sample is identified 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 assuming that S1, S2 and S3 are all unavailable reference samples, the sample S can be identified as an unfilterable sample.
本实施例中提供另一种实现方式,在确定需要使用参考样本且不可的参考样本的占比大于或等于预设值时,则认定该样本为不可滤波样本。例如当前滤波单元内样本S对应的参考样本为S1、S2以及S3,假设S1和S2为不可得参考样本,S3为可得参考样本,此时可以计算出不可得参考样本的占比为2/3,又假设占比得预设值为50%,则 通过可以确定不可得参考样本的占比大于预设值,此时则可以认定样本S即为不可滤波样本。其中,预设值可以根据实际滤波需求进行相应地设置,本实施例中对此不加以限制。This embodiment provides another implementation method. When it is determined that a reference sample needs to be used and the proportion of unavailable reference samples is greater than or equal to a preset value, the sample is considered 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%, then By determining that the proportion of unavailable reference samples is greater than a preset value, it can be determined that sample S is an unfilterable sample. The preset value can be set accordingly according to actual filtering requirements, which is not limited in this embodiment.
进一步地,本实施例中可以基于预设滤波方式的不同,确定样本所对应的参考样本,本实施例中进一步针对各种不同的滤波方式进行举例说明。Furthermore, in this embodiment, the reference sample corresponding to the sample may be determined based on different preset filtering methods. In this embodiment, examples are further provided for various filtering methods.
在一种可选的实施例中,以滤波方式为去块滤波进行说明。去块滤波模块需要对所有PU(Prediction Unit,预测单元)和TU(Transform Unit,变换单元)边界中的8x8块边界进行处理,包括两个环节:滤波决策和滤波操作。首先进行滤波决策,以得到边界的滤波强度(不滤波、弱滤波或强滤波)以及滤波参数。然后进行滤波操作,即根据所选择的滤波强度及滤波参数对像素进行相应的修正。去块滤波算法对不同的视频内容及不同的编码参数具有自适应能力,即不同的块边界自适应选择是否滤波及滤波强度。例如,对平滑区域的不连续边界做强滤波,对纹理丰富区域做弱滤波或不滤波。另外,在片级允许根据不同视频序列的个体特征调节滤波参数(即β和tc),即对滤波参数增加偏移值进行微调,如此就可增加或减少滤波强度,优化解码视频质量,获得比默认值更好的效果。值得注意的是,虽然去块滤波的最小单元是8x8块边界,但是实际是将8x8块边界分成两部分独立进行去块滤波,如图5和6所示,垂直边界以8x4为基本单位,水平边界以4x8为基本单位。进一步以垂直边界的去块滤波方式为例进行说明,参照图5所示,针对这种滤波方式,参考样本可以为滤波过程中所需要用到的样本,也即参考样本是计算边界强度和实施滤波操作所需要的样本。具体地,根据不同的滤波操作,例如亮度强滤波、亮度弱滤波和色度滤波,参考样本可以为图5中所有样本或部分样本。进一步地,去块滤波还可以水平边界进行操作,水平边界的去块滤波如图6所示,同样地,根据不同的滤波操作,参考样本可以为图6中P块和Q块的所有样本或部分样本。In an optional embodiment, the deblocking filter is described in a filtering manner. The deblocking filter module needs to process the 8x8 block boundaries in all PU (Prediction Unit) and TU (Transform Unit) boundaries, including two links: filtering decision and filtering operation. First, a filtering decision is made to obtain the filtering strength (no filtering, weak filtering or strong filtering) and filtering parameters of the boundary. Then the filtering operation is performed, that is, the pixels are corrected accordingly according to the selected filtering strength and filtering parameters. The deblocking filter algorithm has the ability to adapt to different video contents and different encoding parameters, that is, different block boundaries are adaptively selected whether to filter and the filtering strength. For example, strong filtering is performed on the discontinuous boundaries of the smooth area, and weak filtering or no filtering is performed on the texture-rich area. In addition, at the slice level, the filtering parameters (i.e., β and tc) are allowed to be adjusted according to the individual characteristics of different video sequences, that is, the filtering parameters are fine-tuned by adding offset values, so that the filtering strength can be increased or decreased, the decoded video quality can be optimized, and better results can be obtained 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 is based on 8x4 as the basic unit, and the horizontal boundary is based on 4x8 as the basic unit. Further take the deblocking filtering method of the vertical boundary as an example for explanation, as shown in Figure 5, for this filtering method, the reference sample can be the sample required in the filtering process, that is, the reference sample is the sample required for calculating the boundary strength and implementing the filtering operation. Specifically, according to different filtering operations, such as strong brightness filtering, weak brightness filtering and chroma filtering, the reference sample can be all or part of the samples in Figure 5. Further, the deblocking filter can also be operated on the horizontal boundary, and the deblocking filter of the horizontal boundary is shown in Figure 6. Similarly, according to different filtering operations, the reference sample can be all or part of the samples of the P block and Q block in Figure 6.
在一种可选的实施例中,以滤波方式为样点自适应补偿进行说明。样点自适应补偿以CTB(Coding Tree Block,树形编码块)为基本单位,通过选择一个合适的分类器将重建像素划分类别,然后对不同类别像素使用不同的补偿值,可以有效提高视频的主客观质量。SAO包括两大类的补偿形式,分别是边界补偿(Edge Offset,EO)和边带补偿(Band Offset,BO),此外为了节省编码参数的码率,还引入了参数融合技术。边界补偿技术是通过比较当前像素值与相邻像素值的大小对当前像素进行分类,然后对同类像素补偿相同的数值,不同类像素的补偿值可以不同。根据选取的相邻像素的位置差异,边界补偿共分为4种模式:水平方向(EO_0)、垂直方向(EO_1)、135度方向(EO_2)和45度方向(EO_3),如图7所示,其中c表示当前像素,a和b表示相邻像素。参照图7,针对这种滤波方式,可以通过将当前滤波单元内任一样本周围预设数量的样本作为参考样本。如图7所示,参考样本为当前样本周围的2个样本,例如c为当前样本,则a和b即为参考样本。进一步地,边带补偿是根据像素强度值进行分类,将像素范围等分成32条边带,对每条边带根据自身特点进行补偿,且同一边带使用相同的补偿值。例如,对于8比特图像,像素值的范围是[0,255],分成32条边带,每条边带包含8个像素值,边带的索引范围是[0,31]。参数融合模式是指对于一个CTB来讲,其SAO参数直接使用相邻块(左边或上边)的SAO参数,而这一模式不涉及参考样本,可以见上文所述的参考块的获取过程。In an optional embodiment, the sample adaptive compensation is described in a filtering manner. Sample adaptive compensation uses CTB (Coding Tree Block) as the basic unit. By selecting a suitable classifier to classify the reconstructed pixels into categories, and then using different compensation values for pixels of different categories, the subjective and objective quality of the video can be effectively improved. SAO includes two major types of compensation forms, namely edge compensation (Edge Offset, EO) and sideband compensation (Band Offset, BO). In addition, in order to save the bit rate of encoding parameters, parameter fusion technology is also introduced. Boundary compensation technology is to classify the current pixel by comparing the size of the current pixel value with the adjacent pixel value, and then compensate the same value for the same type of pixels. The compensation values of different types of pixels can be different. According to the position difference of the selected adjacent pixels, the boundary compensation is divided into 4 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, where c represents the current pixel, and a and b represent adjacent pixels. Referring to FIG7 , 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 FIG7 , the reference samples are two samples around the current sample. For example, if c is the current sample, a and b are reference samples. Furthermore, the sideband compensation is classified according to the pixel intensity value, and the pixel range is equally divided into 32 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 top), and this mode does not involve reference samples. See the reference block acquisition process described above.
在一种可选的实施例中,以滤波方式为增强样点自适应补偿进行说明。在采取增强样点自适应补偿方式时,对于亮度样本,首先分别按照两个维度将所有像素分成C1和C2个种类,然后将两个维度的类别做笛卡尔积,得到最终的分类结果Ct=C1×C2。对于色度样本,只采用第二维度进行分类(即C2),通过查表得到最终的分类结果Ct。每一个类别的样本都有一个偏移值,在码流中传输。ESAO同时支持图像级控制 开关和LCU(Largest Coding Unit)级控制开关。对于第一个维度的C1类,分类模板如图9所示。对于当前像素,初始类别设置为cx=0,然后从左往右、从上往下依次和周围8个像素比较大小,如果周围像素比当前像素大,则cx加1;否则,cx减1(第二种方法是cx不变),遍历完成后就得到了当前像素的最终类别。由此可知,cx取值范围是[-8,8](第二种方法是[0,8]),所以C1=17(第二种方法是9)。两种方法采用哪种由编码端决定,在图像头传输标识信息。图9C1类的分类模板对于第二个维度的C2类,将[0,(1<<bitdepth)-1]范围的像素值按照大小间隔均匀划分为C2个类,C2的大小由编码端决定,并在图像头传输。不妨设当前像素值为y,则分类公式为cy=(y*C2)>>bitdepth,其中cy是处于[0,C2]之间的一个具体类别。参照图9,针对这种滤波方式,也可以通过将当前滤波单元内任一样本周围预设数量的样本作为参考样本。如图9所示,参考样本为当前样本周围的8个样本,例如图9中阴影部分为当前样本,阴影部分周围的8个非阴影部分即为该当前样本的参考样本。In an optional embodiment, the enhanced sample adaptive compensation is described in a filtering manner. When the enhanced sample adaptive compensation method is adopted, for the luminance sample, all pixels are first divided into C1 and C2 categories according to two dimensions, and then the categories of the two dimensions are Cartesian product to obtain the final classification result Ct = C1 × C2. For the chrominance sample, only the second dimension is used for classification (ie C2), and the final classification result Ct is obtained by table lookup. Each category of samples has an offset value, which is transmitted in the bitstream. ESAO also supports image-level control The switch and LCU (Largest Coding Unit) level control switch. 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 the size is compared with the surrounding 8 pixels from left to right and from top to bottom. If the surrounding pixels are larger than the current pixel, cx is increased by 1; otherwise, cx is reduced by 1 (the second method is that cx remains unchanged). After the traversal is completed, 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 used is determined by the encoder, and the identification information is transmitted in the image header. Figure 9 Classification template of C1 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 according to the size interval. The size of C2 is determined by the encoder and transmitted in the image header. Suppose the current pixel value is y, then the classification formula is cy=(y*C2)>>bitdepth, where cy is a specific category between [0,C2]. Referring to FIG9, for this filtering method, a preset number of samples around any sample in the current filtering unit can also be used as reference samples. As shown in FIG9, the reference samples are the 8 samples around the current sample. For example, the shaded portion in FIG9 is the current sample, and the 8 non-shaded portions around the shaded portion are the reference samples of the current sample.
在一种可选的实施例中,以滤波方式为跨分量样点自适应补偿进行说明。跨分量样点自适应补偿是根据对应的亮度样本值来对当前的色度样本进行分类,然后按照类别叠加一个偏移值,该技术只支持BO(Band Offset)的分类方法。具体做法是,将亮度样本的取值范围均匀划分为BandNum个条带,每个条带为一个类别,将当前色度样本对应的亮度样本值落入的条带类别作为当前色度样本的类别,然后为色度样本叠加上该类别对应的偏移值。参照图10,针对这种滤波方式,也可以通过将当前滤波单元内任一样本周围预设数量的样本作为参考样本。这种滤波方式中样本与参考样本处于不同的分量,例如当前的色度样本的参考样本是周围的9个亮度样本之一,如图10所示,c为当前色度样本,0~8为周围的9个亮度样本,从这9个亮度样本选择一个亮度样本作为当前色度样本的参考样本。In an optional embodiment, the adaptive compensation of cross-component samples is described in a filtering manner. Adaptive compensation of cross-component samples is to classify the current chrominance sample according to the corresponding luminance sample value, and then superimpose an offset value according to the category. This technology only supports the BO (Band Offset) classification method. Specifically, the value range of the luminance sample is evenly divided into BandNum strips, each strip is a category, and the strip category into which the luminance sample value corresponding to the current chrominance sample falls is used as the category of the current chrominance sample, and then the chrominance sample is superimposed with the offset value corresponding to the category. Referring to Figure 10, for 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 chrominance sample is one of the surrounding 9 luminance samples. As shown in Figure 10, c is the current chrominance 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 of the current chrominance sample.
在一种可选的实施例中,以滤波方式为自适应环路滤波进行说明。自适应环路滤波中对于亮度分量,将一帧图像划分为4x4个系数区域(如图14所示),同一个系数区域内的像素采用同一组滤波系数。按照系数区域的扫描顺序,相邻的两个系数区域可以合并为一个新的区域,合并后的区域可以继续和其相邻的区域进行合并,直到整帧图像都为一个系数区域。因此,一帧图像的滤波器系数组数等于合并后的系数区域个数,取值范围是[1,16]。码流中需要传输本帧图像的滤波器系数组数(即合并后的系数区域个数),每个区域的大小(即合并后的每个区域分别包含了几个原始系数区域),以及每一组滤波器系数。对于色度分量,一帧图像使用一个滤波器(即整帧图像对应一个系数区域和一组滤波器系数),Cb和Cr分量有各自的滤波器。参照图11和图12,其中,自适应环路滤波滤波器形状如图11所示,增强型自适应环路滤波滤波器形状如图12所示,针对这种滤波方式,可以当前样本为中心的、滤波器覆盖范围内的周围样本作为参考样本,图11和图12所示即为滤波器覆盖范围内的周围样本,也即参考样本。其中,滤波器覆盖范围可以基于不同标准进行设置,本实施例中对此不加以限制。In an optional embodiment, adaptive loop filtering is described in a filtering manner. In adaptive loop filtering, for the luminance component, a frame of image is divided into 4x4 coefficient areas (as shown in FIG. 14 ), and 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 area until the entire frame of image is a coefficient area. Therefore, the number of filter coefficient groups of a frame of image is equal to the number of merged coefficient areas, and the value range is [1,16]. The number of filter coefficient groups of this frame of image (i.e., the number of merged coefficient areas), the size of each area (i.e., each merged area contains several original coefficient areas), and each set of filter coefficients need to be transmitted in the code stream. For the chrominance component, a frame of image uses a filter (i.e., the entire frame of image corresponds to a coefficient area and a 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, which are 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., reference samples. The filter coverage range can be set based on different standards, which is not limited in this embodiment.
在确定参考样本之后,本实施例中可以通过样本的权限与参考样本的权限进一步判断样本所需要的参考样本是否可得。具体地,针对当前滤波单元内的某一个样本来讲,需要获取该样本的权限以及该样本所需要用到的参考样本的权限,可以通过样本所在的权限区域以及参考样本所在的权限区域确定对应的权限,然后先将参考样本的权限与样本的权限进行比较,如果参考样本的权限低于或等于所述样本的权限,则进一步判断是否满足以下预设条件。预设条件可以为参考样本已解码或已编码,也即针对编码端,还需要保证参考样本已编码,或者针对解码端,还需要保证参考样本已解码。预设条件还可以为参考样本与样本位于同一个Slice或Tile。预设条件还可以为参考样本与样本位于不同的Slice或Tile,且允许对Slice或Tile的边界进行滤波。如果同时满足权限高低的判断条件以及预设条件中的任一项,则认定该参考样本可得。 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 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 filtering is allowed on the boundaries of the Slice or Tile. If the judgment condition of the authority level and any one of the preset conditions are met at the same time, the reference sample is deemed to be available.
进一步地,本实施例中在判断不可得参考样本之后,还可以通过推导的参考样本信息替换不可得参考样本的信息,从而将不可得参考样本转换为可得参考样本。本实施例中针对推导的参考样本信息提供一种实现方式,具体为针对编码端,通过不可得参考样本周围的已编码样本推导参考样本信息,针对解码端,通过不可得参考样本周围的已解码样本推导参考样本信息,并且需要强调的是,由于不可得参考样本的权限通常高于样本的权限,因此本实施例中这些已解码样本或已编码样本的权限需要低于或等于样本的权限。Furthermore, in this embodiment, after determining that the reference sample is unavailable, the information of the unavailable reference sample can be replaced by the derived reference sample information, thereby converting the unavailable reference sample into an available reference sample. In this embodiment, an implementation method is provided for the derived reference sample information, specifically, for the encoding end, the reference sample information is derived by the encoded samples around the unavailable reference sample, and for the decoding end, the reference sample information is derived by the decoded samples around the unavailable reference sample, and it should be emphasized that, since the authority of the unavailable reference sample is usually higher than the authority of the sample, in this embodiment, the authority of these decoded samples or encoded samples needs to be lower than or equal to the authority of the sample.
本实施例中还提供另一种实现方式,具体为通过预设信息推导参考样本信息,其中,预设信息包括默认的样本值。This embodiment also provides another implementation manner, which is to derive reference sample information through preset information, wherein the preset information includes a default sample value.
本实施例通过参考块信息或者参考样本信息对当前滤波单元内的不可滤波样本和可滤波样本进行分类,同时还能够将不可得参考块或者不可得参考样本转换为可得参考块或可得参考样本,通过上述方式能够准确识别出不可滤波样本和可滤波样本,然后再执行相应的滤波策略,能够有效提升图像的主客观质量。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. The above method can accurately identify the unfilterable samples and filterable samples, and then execute the corresponding filtering strategy, which can effectively improve the subjective and objective quality of the image.
参考图13,图13为本发明一种滤波方法第二实施例的流程示意图。Refer to FIG. 13 , which is a flow chart of a second embodiment of a filtering method according to the present invention.
基于上述第一实施例,本实施例滤波方法中进一步包括:Based on the above first embodiment, the filtering method of this embodiment further includes:
步骤S401:对所述当前滤波单元内的第一样本不执行滤波操作,并对所述当前滤波单元内的第二样本执行滤波操作。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.
本实施例中的预设滤波方式包括去块滤波、样点自适应补偿、增强样点自适应补偿、跨分量样点自适应补偿以及自适应环路滤波中的至少一项,滤波操作的具体过程可以按照如下方式实现。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.
在一种可选的实施例中,当滤波策略为部分滤波时,无论当前滤波单元内不可滤波样本以及可滤波样本的数量为多少,所执行的滤波操作均为对滤波单元内的第一样本(不可滤波样本)不执行滤波操作,对滤波单元内的第二样本(可滤波样本)执行滤波操作。假设当前滤波单元内不可滤波样本为N个,可滤波样本为M个,对这N个不可滤波样本不执行滤波操作,对这M个可滤波样本执行滤波操作。In an optional embodiment, when the filtering strategy is partial filtering, no matter how many unfilterable samples and filterable samples there are in the current filtering unit, the filtering operation performed is not to 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.
在一种可选的实施例中,为当滤波策略为全不滤波时,这种情况下,需要先判断当前滤波单元内是否存在不可滤波样本,如果存在不可滤波样本,则对当前滤波单元内所有的样本均不执行滤波操作。假设当前滤波单元内不可滤波样本为N个,可滤波样本为M个,对当前滤波单元内的所有样本也即M+N个样本均不执行滤波操作。In an optional embodiment, when the filtering strategy is no filtering, in this case, it is necessary to first determine whether there are unfilterable samples in the current filtering unit. If there are unfilterable samples, no filtering operation is performed on all 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 all samples in the current filtering unit, that is, M+N samples.
在一种可选的实施例中,为当滤波策略为全滤波时,这种情况下,需要先判断当前滤波单元内是否存在可滤波样本,如果存在可滤波样本,则对当前滤波单元内所有的样本均执行滤波操作。进一步地,当前滤波单元内是否存在可滤波样本包含两种情况,第一种情况为当前滤波单元内全部为可滤波样本,例如当前滤波单元内包含N个样本,且这N个样本均为可滤波操作,则可以对这N个可滤波样本执行滤波操作。第二种情况为当前滤波单元存在不可滤波样本,针对这种情况,在执行全滤波策略时,需要先将当前滤波单元内的不可滤波样本全部转换为可滤波样本,最后再对所有的可滤波样本执行滤波操作,例如当前滤波单元内包含N个可滤波样本和M个不可滤波样本,先将这M个不可滤波样本转换为M个可滤波样本,最后再对N+M个可滤波样本执行滤波操作。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. Further, whether there are filterable samples in the current filtering unit includes two situations. The first situation is that all the samples in the current filtering unit are filterable samples. For example, the current filtering unit contains N samples, and these N samples are all filterable samples, then the filtering operation can be performed on these N filterable samples. The second situation is that there are non-filterable samples in the current filtering unit. For this situation, when executing the full filtering strategy, it is necessary to first convert all the non-filterable samples in the current filtering unit into filterable samples, and finally perform the filtering operation on all the filterable samples. For example, the current filtering unit contains N filterable samples and M non-filterable samples. First, convert these M non-filterable samples into M filterable samples, and finally perform the filtering operation on N+M filterable samples.
在一种可选的实施例中,可以通过推导参考块或参考样本的信息将当前滤波单元内的不可滤波样本转换为可滤波样本,其中,参考块是指在样本滤波过程中所需要用到的相邻块,参考样本是指在样本滤波过程中所需要用到的周围样本。本实施例中针对推导参考块或参考样本的信息的获取方式提供一种实现方式,具体为通过所述权限区域 内部及周围的可得块或可得样本推导参考块或参考样本的信息,可得块或可得样本可与不可滤波样本处于同一权限区域,也可以处于不同的权限区域,本实施例中对此不加以限制。其中,可得块或可得样本的权限需要低于或等于不可滤波样本的权限,针对解码端,可得块或可得样本为已解码的块或样本,针对编码端,可得块或可得样本为已编码的块或样本。In an optional embodiment, the non-filterable samples in the current filtering unit can be converted into filterable samples by deriving information of reference blocks or reference samples, wherein the reference blocks refer to adjacent blocks required for sample filtering, and the reference samples refer to surrounding samples required for sample filtering. This embodiment provides an implementation method for obtaining information of derived reference blocks or reference samples, specifically, by using the permission area The available blocks or available samples inside and around the reference block or reference sample are used to derive information of the reference block or reference sample. The available blocks or available samples may be in the same authority area as the non-filterable samples, or may be in different authority areas, which is not limited in this embodiment. Among them, the authority of the available blocks or available samples needs to be lower than or equal to the authority 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.
本实施例中针对推导参考块或参考样本的信息的获取方式提供另一种实现方式,具体为通过预设信息推导参考块或参考样本的信息,其中,预设信息包括默认的样本值、滤波参数、预测方式、非零变换系数、参考图像以及运动矢量等信息。In this embodiment, another implementation method is provided for obtaining the information of the reference block or reference sample, specifically deriving the information of the reference block or 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.
本实施例通过根据滤波策略对各个权限区域内不同权限等级的样本执行不同的滤波操作,实现了对权限区域进行有约束的滤波操作,提升了图像的主客观质量。This embodiment performs different filtering operations on samples of different permission levels in each permission area according to the filtering strategy, thereby realizing constrained filtering operations on the permission area and improving the subjective and objective quality of the image.
参照图14,图14为本发明滤波装置第一实施例的结构框图。Refer to FIG. 14 , which is a structural block diagram of a first embodiment of a filtering device according to the present invention.
如图14所示,本发明实施例提出的滤波装置包括:As shown in FIG14 , the filtering device provided in the embodiment of the present invention includes:
获取模块10,用于确定当前滤波单元对应的滤波策略和所处的权限区域,所述权限区域为图像中具有权限等级的图像区域。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.
识别模块20,用于根据所述权限区域的权限等级确定所述当前滤波单元内样本的权限等级。The identification module 20 is used to determine the permission level of the sample in the current filtering unit according to the permission level of the permission area.
分类模块30,用于根据所述样本的权限等级对所述当前滤波单元内的样本进行分类。The classification module 30 is used to classify the samples in the current filtering unit according to the authority level of the samples.
滤波模块40,用于根据所述滤波策略和分类结果对所述当前滤波单元执行相应的滤波操作。The filtering module 40 is used to perform corresponding filtering operations on the current filtering unit according to the filtering strategy and the classification result.
本实施例通过确定当前滤波单元对应的滤波策略和所处的权限区域;根据所述权限区域的权限等级确定所述当前滤波单元内样本的权限等级;根据所述样本的权限等级对所述当前滤波单元内的样本进行分类;根据所述滤波策略和分类结果对所述当前滤波单元执行相应的滤波操作,根据滤波策略对各个权限区域内不同权限等级的样本执行不同的滤波操作,实现了对权限区域进行有约束的滤波操作,提升了图像的主客观质量。This embodiment determines the filtering strategy corresponding to the current filtering unit and the permission area it is in; determines the permission level of samples in the current filtering unit according to the permission level of the permission area; classifies the samples in the current filtering unit according to the permission 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 permission levels in each permission area according to the filtering strategy, thereby realizing constrained filtering operations on the permission area and improving the subjective and objective quality of the image.
在一实施例中,所述滤波策略由从码流中解析出的标志信息确定,所述标志信息用于在序列级、图像级、Slice级、Tile级或滤波单元级传输。In one 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, a picture level, a slice level, a tile level, or a filtering unit level.
在一实施例中,所述权限区域包含至少一个滤波单元,所述当前滤波单元允许跨越多个权限区域,所述滤波单元包括至少一个样本;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;
所述识别模块20,还用于所述当前滤波单元内的样本的权限等级与样本所在的权限区域一致。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.
在一实施例中,所述当前滤波单元为滤波过程中的基本单元且不同的滤波单元允许执行不同的滤波操作;In one embodiment, the current filtering unit is a basic unit in the filtering process and different filtering units allow different filtering operations to be performed;
所述滤波模块40,还用于对所述当前滤波单元内的第一样本不执行滤波操作,并对所述当前滤波单元内的第二样本执行滤波操作;或,对所述当前滤波单元内的所有样本均执行滤波操作;或,对所述当前滤波单元内的所有样本均不执行滤波操作。The filtering module 40 is further used 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.
在一实施例中,所述第一样本为不可滤波样本,所述第二样本为可滤波样本。In one embodiment, the first sample is a non-filterable sample, and the second sample is a filterable sample.
在一实施例中,所述滤波模块40,还用于通过推导参考块或参考样本的信息将所述当前滤波单元内的不可滤波样本转换为可滤波样本,并对所有可滤波样本均执行滤波操作,所述推导参考块或参考样本的信息是通过所述权限区域内部及周围的可得块或 可得样本推导出的,或者是通过预设信息推导出的;其中,所述可得块或可得样本为权限低于或等于所述不可滤波样本的权限,并且已解码或已编码的块或样本。In one embodiment, the filtering module 40 is further configured to convert the non-filterable samples in the current filtering unit into filterable samples by deriving information of reference blocks or reference samples, and perform filtering operations on all filterable samples, wherein the information of the derived reference blocks or reference samples is obtained by obtaining available blocks or samples in and around the permission area. The available block or available sample is derived from the available sample, or is derived through preset information; wherein the available block or available sample is a block or sample whose authority is lower than or equal to the authority of the non-filterable sample and has been decoded or encoded.
在一实施例中,所述分类模块30,还用于将所述当前滤波单元内在滤波过程中需要使用参考块信息,且至少一个参考块不可得的样本作为不可滤波样本;将所述当前滤波单元内在滤波过程中需要参考样本,且至少一个参考样本不可得的样本作为不可滤波样本;将所述当前滤波单元内在滤波过程中需要参考样本,且所有参考样本都不可得的样本作为不可滤波样本;将所述当前滤波单元内在滤波过程中需要参考样本,且在所有参考样本中不可得参考样本的占比大于或等于预设值的样本作为不可滤波样本。In one embodiment, the classification module 30 is further used to treat samples that require reference block information during the filtering process in the current filtering unit and for which at least one reference block is unavailable as unfilterable samples; treat samples that require reference samples during the filtering process in the current filtering unit and for which at least one reference sample is unavailable as unfilterable samples; treat samples that require reference samples during the filtering process in the current filtering unit and for which all reference samples are unavailable as unfilterable samples; and treat samples that require reference samples during the filtering process in the current filtering unit 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.
在一实施例中,所述分类模块30,还用于根据预设滤波方式确定所述当前滤波单元内的样本在滤波过程中是否需要使用参考块信息;通过所述样本的权限与所述参考块的权限判断所述参考块是否可得。In one embodiment, the classification module 30 is further used to determine whether the samples in the current filtering unit need 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 samples and the permissions of the reference block.
在一实施例中,所述参考块是进行滤波决策和/或实施滤波操作所需要的块,所述参考块包括至少一个样本,所述参考块的权限为所述参考块内所有样本的最高权限。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.
在一实施例中,所述分类模块30,还用于若参考块的权限低于或等于所述样本的权限,且至少满足以下预设条件中的一项,则确定所述参考块可得;所述预设条件包括:所述参考块已解码或已编码;所述参考块与所述样本位于同一个Slice或Tile;所述参考块与所述样本位于不同的Slice或Tile,且允许对Slice或Tile的边界进行滤波。In one embodiment, the classification module 30 is further used 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 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.
在一实施例中,所述滤波装置还包括转换模块;In one embodiment, the filtering device further comprises a conversion module;
所述转换模块,用于通过不可得参考块周围权限低于或等于所述样本的权限的已解码块或已编码块推导参考块信息,和/或,通过预设信息推导参考块信息;通过推导的参考块信息替换所述不可得参考块的信息,以使所述不可得参考块转换为可得参考块。The conversion module is used to derive reference block information through decoded blocks or encoded blocks with authority lower than or equal to the authority of the sample around the unavailable reference block, and/or derive reference block information through preset information; replace 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.
在一实施例中,所述分类模块30,还用于根据预设滤波方式获取所述当前滤波单元内任一样本对应的参考样本;通过所述样本的权限与所述参考样本的权限判断所述参考样本是否可得。In one embodiment, the classification module 30 is further used 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 authority of the sample and the authority of the reference sample.
在一实施例中,所述参考样本是进行滤波决策和/或实施滤波操作所需要的样本。In one embodiment, the reference samples are samples required for making filtering decisions and/or performing filtering operations.
在一实施例中,所述分类模块30,还用于若参考样本的权限低于或等于所述样本的权限,且至少满足以下预设条件中的一项,则确定所述参考样本可得;所述预设条件包括:所述参考样本已解码或已编码;所述参考样本与所述样本位于同一个Slice或Tile;所述参考样本与所述样本位于不同的Slice或Tile,且允许对Slice或Tile的边界进行滤波。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 boundaries is allowed.
在一实施例中,所述滤波装置还包括转换模块;In one embodiment, the filtering device further comprises a conversion module;
所述转换模块,用于通过不可得参考样本周围权限低于或等于所述样本的权限的已解码样本或已编码样本推导参考样本信息,和/或通过预设信息推导参考样本信息;通过推导的参考样本信息替换所述不可得参考样本的信息,以使所述不可得参考样本转换为可得参考样本。The conversion module is used to derive reference sample information through decoded samples or encoded samples whose authority around the unavailable reference sample is lower than or equal to the authority of the sample, and/or derive reference sample information through preset information; replace 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.
在一实施例中,所述预设滤波方式包括以下至少一项:去块滤波;样点自适应补偿;增强样点自适应补偿;跨分量样点自适应补偿;自适应环路滤波。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.
此外,为实现上述目的,本发明还提出一种滤波设备,所述滤波设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的滤波程序,所述滤波程序配置为实现如上文所述的滤波方法。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.
此外,本发明实施例还提出一种存储介质,所述存储介质上存储有滤波程序, 所述滤波程序被处理器执行时实现如上文所述的滤波方法的步骤。In addition, an embodiment of the present invention further provides a storage medium, wherein a filtering program is stored on the storage medium. When the filtering program is executed by the processor, the steps of the filtering method described above are implemented.
由于本存储介质采用了上述所有实施例的全部技术方案,因此至少具有上述实施例的技术方案所带来的所有有益效果,在此不再一一赘述。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.
应当理解的是,以上仅为举例说明,对本发明的技术方案并不构成任何限定,在具体应用中,本领域的技术人员可以根据需要进行设置,本发明对此不做限制。It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.
需要说明的是,以上所描述的工作流程仅仅是示意性的,并不对本发明的保护范围构成限定,在实际应用中,本领域的技术人员可以根据实际的需要选择其中的部分或者全部来实现本实施例方案的目的,此处不做限制。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 them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
另外,未在本实施例中详尽描述的技术细节,可参见本发明任意实施例所提供的滤波方法,此处不再赘述。In addition, for technical details that are not described in detail 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.
此外,需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如只读存储器(Read Only Memory,ROM)/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which 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 a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。 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 specification 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 (19)

  1. 一种滤波方法,其特征在于,所述滤波方法包括:A filtering method, characterized in that the filtering method comprises:
    确定当前滤波单元对应的滤波策略和所处的权限区域,所述权限区域为图像中具有权限等级的图像区域;Determine the filtering strategy corresponding to the current filtering unit and the authority area in which it is located, wherein the authority area is an image area in the image with an authority level;
    根据所述权限区域的权限等级确定所述当前滤波单元内样本的权限等级;Determining the permission level of the samples 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;
    根据所述滤波策略和分类结果对所述当前滤波单元执行相应的滤波操作。A corresponding filtering operation is performed on the current filtering unit according to the filtering strategy and the classification result.
  2. 如权利要求1所述的滤波方法,其特征在于,所述滤波策略由从码流中解析出的标志信息确定,所述标志信息用于在序列级、图像级、Slice级、Tile级或滤波单元级传输。The filtering method according to claim 1 is characterized in that 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.
  3. 如权利要求1所述的滤波方法,其特征在于,所述权限区域包含至少一个滤波单元,所述当前滤波单元允许跨越多个权限区域,所述滤波单元包括至少一个样本;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. 如权利要求3所述的滤波方法,其特征在于,所述当前滤波单元为滤波过程中的基本单元且不同的滤波单元允许执行不同的滤波操作;The filtering method according to claim 3, characterized in that the current filtering unit is a basic unit in the filtering process and different filtering units allow different filtering operations to be performed;
    所述根据所述滤波策略和分类结果对所述当前滤波单元执行相应的滤波操作,包括: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 all samples in the current filtering unit.
  5. 如权利要求4所述的滤波方法,其特征在于,所述第一样本为不可滤波样本,所述第二样本为可滤波样本。The filtering method according to claim 4 is characterized in that the first sample is a non-filterable sample and the second sample is a filterable sample.
  6. 如权利要求4所述的滤波方法,其特征在于,所述对所述当前滤波单元内的所有样本均执行滤波操作,包括:The filtering method according to claim 4, characterized in that the performing a filtering operation on all samples in the current filtering unit comprises:
    通过推导参考块或参考样本的信息将所述当前滤波单元内的不可滤波样本转换为可滤波样本,并对所有可滤波样本均执行滤波操作,所述推导参考块或参考样本的信息是通过所述权限区域内部及周围的可得块或可得样本推导出的,或者是通过预设信息推导出的;Converting the non-filterable samples in the current filtering unit into filterable samples by deriving information of a reference block or a reference sample, and performing a filtering operation on all filterable samples, wherein the information of the derived reference block or the reference sample is derived from available blocks or available samples in and around the permission area, or is derived from preset information;
    其中,所述可得块或可得样本为权限低于或等于所述不可滤波样本的权限,并且已解码或已编码的块或样本。The available blocks or available samples are blocks or samples that have authority lower than or equal to authority of the non-filterable samples and have been decoded or encoded.
  7. 如权利要求5所述的滤波方法,其特征在于,包括以下至少一项:The filtering method according to claim 5, characterized in that it comprises at least one of the following:
    将所述当前滤波单元内在滤波过程中需要使用参考块信息,且至少一个参考块不可得的样本作为不可滤波样本;Taking 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;
    将所述当前滤波单元内在滤波过程中需要参考样本,且至少一个参考样本不可得的样本作为不可滤波样本;Taking samples in the current filtering unit that require reference samples during filtering and for which at least one reference sample is unavailable as unfilterable samples;
    将所述当前滤波单元内在滤波过程中需要参考样本,且所有参考样本都不可得的样本作为不可滤波样本;或The samples in the current filtering unit that require reference samples in the filtering process and for which all reference samples are unavailable are regarded as unfilterable samples; or
    将所述当前滤波单元内在滤波过程中需要参考样本,且在所有参考样本中不可得参 考样本的占比大于或等于预设值的样本作为不可滤波样本。The reference samples required in the filtering process of the current filtering unit and 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. 如权利要求7所述的滤波方法,其特征在于,所述滤波方法还包括:The filtering method according to claim 7, characterized in that the filtering method further comprises:
    根据预设滤波方式确定所述当前滤波单元内的样本在滤波过程中是否需要使用参考块信息;Determine whether the samples in the current filtering unit need to use reference block information during the filtering process according to a preset filtering mode;
    通过所述样本的权限与所述参考块的权限判断所述参考块是否可得。Whether the reference block is available is determined by the authority of the sample and the authority of the reference block.
  9. 如权利要求8所述的滤波方法,其特征在于,所述参考块是进行滤波决策和/或实施滤波操作所需要的块,所述参考块包括至少一个样本,所述参考块的权限为所述参考块内所有样本的最高权限。The filtering method as described in claim 8 is characterized in that 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.
  10. 如权利要求8所述的滤波方法,其特征在于,所述通过所述样本的权限与所述参考块的权限判断所述参考块是否可得,包括:The filtering method according to claim 8, wherein the determining whether the reference block is available by the authority of the sample and the authority of the reference block comprises:
    若参考块的权限低于或等于所述样本的权限,且至少满足以下预设条件中的一项,则确定所述参考块可得;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;
    所述预设条件包括:The preset conditions include:
    所述参考块已解码或已编码;The reference block has been decoded or encoded;
    所述参考块与所述样本位于同一个Slice或Tile;或The reference block and the sample are located in the same Slice or Tile; or
    所述参考块与所述样本位于不同的Slice或Tile,且允许对Slice或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.
  11. 如权利要求10所述的滤波方法,其特征在于,所述若参考块的权限低于或等于所述样本的权限,且至少满足以下预设条件中的一项,则确定所述参考块可得之后,还包括:The filtering method according to claim 10, characterized in that 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, after determining that the reference block is available, it also 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. 如权利要求7所述的滤波方法,其特征在于,所述滤波方法还包括:The filtering method according to claim 7, characterized in that the filtering method further comprises:
    根据预设滤波方式获取所述当前滤波单元内任一样本对应的参考样本;Acquire 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. 如权利要求12所述的滤波方法,其特征在于,所述参考样本是进行滤波决策和/或实施滤波操作所需要的样本。The filtering method according to claim 12, characterized in that the reference samples are samples required for making filtering decisions and/or implementing filtering operations.
  14. 如权利要求12所述的滤波方法,其特征在于,所述通过所述样本的权限与所述参考样本的权限判断所述参考样本是否可得,包括:The filtering method according to claim 12, wherein the determining whether the reference sample is available based on the authority of the sample and the authority of the reference sample comprises:
    若参考样本的权限低于或等于所述样本的权限,且至少满足以下预设条件中的一项,则确定所述参考样本可得;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 preset conditions include:
    所述参考样本已解码或已编码;The reference sample has been decoded or encoded;
    所述参考样本与所述样本位于同一个Slice或Tile;或The reference sample and the sample are located in the same Slice or Tile; or
    所述参考样本与所述样本位于不同的Slice或Tile,且允许对Slice或Tile的边界进行滤波。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. 如权利要求14所述的滤波方法,其特征在于,所述若参考样本的权限低于或 等于所述样本的权限,且至少满足以下预设条件中的一项,则确定所述参考样本可得之后,还包括:The filtering method according to claim 14, characterized in that if the authority of the reference sample is lower than or is equal to the authority of the sample, and at least one of the following preset conditions is met, then after determining that the reference sample is available, the method further includes:
    通过不可得参考样本周围权限低于或等于所述样本的权限的已解码样本或已编码样本推导参考样本信息,和/或通过预设信息推导参考样本信息;The reference sample information is derived by using decoded samples or encoded samples with authority lower than or equal to that of the sample around the unavailable reference sample, and/or the reference sample information is derived 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. 如权利要求8或12所述的滤波方法,其特征在于,所述预设滤波方式包括以下至少一项:The filtering method according to claim 8 or 12, characterized in that the preset filtering mode includes at least one of the following:
    去块滤波;Deblocking filtering;
    样点自适应补偿;Sample adaptive compensation;
    增强样点自适应补偿;Enhanced sample point adaptive compensation;
    跨分量样点自适应补偿;或Adaptive compensation across component samples; or
    自适应环路滤波。Adaptive loop filtering.
  17. 一种滤波设备,其特征在于,所述滤波设备包括:存储器、处理器及存储在所述存储器上并在所述处理器上运行的滤波程序,所述滤波程序配置为实现如权利要求1至16中任一项所述的滤波方法。A filtering device, characterized in that the filtering device comprises: 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. 一种存储介质,其特征在于,所述存储介质上存储有滤波程序,所述滤波程序被处理器执行时实现如权利要求1至16任一项所述的滤波方法。A storage medium, characterized in that a filtering program is stored on the storage medium, and when the filtering program is executed by a 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, used to determine the filtering strategy corresponding to the current filtering unit and the authority area in which it is located, wherein the authority area is an image area in the image with an authority level;
    识别模块,用于根据所述权限区域的权限等级确定所述当前滤波单元内样本的权限等级;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, used for classifying 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.
PCT/CN2024/072131 2022-11-14 2024-01-12 Filtering method, device, and storage medium WO2024104506A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211426315.3 2022-11-14
CN202211426315.3A CN118042164A (en) 2022-11-14 2022-11-14 Filtering method, device and storage medium

Publications (1)

Publication Number Publication Date
WO2024104506A1 true WO2024104506A1 (en) 2024-05-23

Family

ID=90994026

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/072131 WO2024104506A1 (en) 2022-11-14 2024-01-12 Filtering method, device, and storage medium

Country Status (2)

Country Link
CN (1) CN118042164A (en)
WO (1) WO2024104506A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006129178A (en) * 2004-10-29 2006-05-18 Victor Co Of Japan Ltd Video monitoring system and image pickup device used in the same
CN110971915A (en) * 2018-09-28 2020-04-07 杭州海康威视数字技术股份有限公司 Filtering method and device
CN111247796A (en) * 2017-10-20 2020-06-05 韩国电子通信研究院 Image encoding/decoding method and apparatus, and recording medium storing bit stream
CN114640846A (en) * 2021-02-23 2022-06-17 杭州海康威视数字技术股份有限公司 Filtering method, device and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006129178A (en) * 2004-10-29 2006-05-18 Victor Co Of Japan Ltd Video monitoring system and image pickup device used in the same
CN111247796A (en) * 2017-10-20 2020-06-05 韩国电子通信研究院 Image encoding/decoding method and apparatus, and recording medium storing bit stream
CN110971915A (en) * 2018-09-28 2020-04-07 杭州海康威视数字技术股份有限公司 Filtering method and device
CN114640846A (en) * 2021-02-23 2022-06-17 杭州海康威视数字技术股份有限公司 Filtering method, device and equipment

Also Published As

Publication number Publication date
CN118042164A (en) 2024-05-14

Similar Documents

Publication Publication Date Title
KR100871646B1 (en) H.264 spatial error concealment based on the intra-prediction direction
US10904524B2 (en) Adaptive loop filtering for high dynamic range video
KR101266168B1 (en) Method and apparatus for encoding, decoding video
EP2777255B1 (en) Method and device for optimizing encoding/decoding of compensation offsets for a set of reconstructed samples of an image
GB2531004A (en) Residual colour transform signalled at sequence level for specific coding modes
JP2018101863A (en) Image processing system, image processing method, and program
CA2664668A1 (en) Intra prediction encoding control method and apparatus, program therefor, and storage medium which stores the program
WO2018219663A1 (en) A method and a device for picture encoding and decoding
US20230206602A1 (en) Methods and systems for image compensation
CN110913215B (en) Method and device for selecting prediction mode and readable storage medium
WO2024104506A1 (en) Filtering method, device, and storage medium
CN111770334A (en) Data encoding method and device, and data decoding method and device
JP2001251627A (en) Coder, coding method and recording medium recorded with program
CN116016937A (en) Sample self-adaptive compensation method and device in video coding
WO2022077490A1 (en) Intra prediction method, encoder, decoder, and storage medium
JP7517780B2 (en) Video encoding/decoding method, recording medium and program
WO2022174469A1 (en) Illumination compensation method, encoder, decoder, and storage medium
CN113132724B (en) Encoding and decoding method, device and equipment thereof
EP3481064B1 (en) Adaptive loop filtering for high dynamic range video
CN110249630A (en) De-block effect filter and method
WO2023109766A1 (en) In-loop filtering method, video encoding method, video decoding method, electronic device, and medium
WO2024016775A1 (en) Data processing method and apparatus, and device
WO2023130226A1 (en) Filtering method, decoder, encoder and computer-readable storage medium
JP7460802B2 (en) Image enhancement method and device
WO2024007116A1 (en) Decoding method, encoding method, decoder, and encoder

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24726509

Country of ref document: EP

Kind code of ref document: A1