Patent Description:
Digital video apparatuses such as digital televisions, digital live broadcast systems, wireless broadcast systems, Personal Digital Assistants (PDA), laptop or desktop computers, digital cameras, digital recording apparatuses, digital media players, video game apparatuses, video game consoles, cellular or satellite radio telephones, and video conferencing apparatuses are currently widely used. The digital video apparatus usually compresses a video by using a video compression technology with a block-based hybrid video encoding framework, for example, MPEG-<NUM>/<NUM> or the latest video encoding standard H. <NUM>/HEVC, so as to transmit, receive, and store digital video information more efficiently.

Adaptive loop filter (ALF) is one of important technologies for video encoding and decoding. In ALF, a reconstructed image obtained through encoding/decoding is filtered, to improve quality of the reconstructed image and reduce distortion of the image.

In existing adaptive loop filter, when filtering processing is being performed on an image, a luma sample and a chroma sample are separately processed, and respective filter coefficients are separately transmitted for the luma sample and the chroma sample. Consequently, bit rate overheads for transmission increase.

<NPL>, document JVET-E0079rs discloses a unified adaptive loop filter for luma and chroma. It discloses that the luma and chroma blocks with the same class index are merged together as one class to share the same one adaptive loop filter.

For better understanding of the embodiments of this application, the following first describes a YCbCr model, a luma sample, and a chroma sample in the embodiments of this application.

The YCbCr model is a color model different from an RGB model. Luma and chroma are represented together in the RGB model, while luma and chroma are separately represented in the YCbCr model. The YCbCr model includes three components Y, Cb, and Cr, where Y is a luma component, Cb is a first chroma component, and Cr is a second chroma component (certainly, Cr may be referred to as a first chroma component, and Cb may be referred to as a second chroma component). The first chroma component and the second chroma component may be collectively referred to as a chroma component.

Therefore, samples (pixels) of an image based on the YCbCr model include a luma sample (pixel), a first chroma sample (pixel), and a second chroma sample (pixel). The first chroma sample and the second chroma sample may be collectively referred to as a chroma sample.

Samples of an image based on the YCbCr model are sampled in different sampling formats. The following briefly describes several common sampling formats: <NUM>:<NUM>:<NUM>, <NUM>:<NUM>:<NUM>, <NUM>:<NUM>:<NUM>, and <NUM>:<NUM>:<NUM> respectively with reference to <FIG>.

In <FIG>, each small rectangle represents one sample, and different circles respectively represent luma sampling, first-chroma sampling, and second-chroma sampling.

As shown in <FIG>, luma sampling and chroma sampling (including first-chroma sampling and second-chroma sampling) are performed on each sample. In other words, on every four samples, luma sampling is performed four times, first-chroma sampling is performed four times, and second-chroma sampling is performed four times. This sampling format is referred to as <NUM>:<NUM>:<NUM>.

A human eye is more sensitive to luma than chroma. Therefore, to reduce bit rate overheads, a chroma sampling ratio may usually be less than a luma sampling ratio when samples of an image based on the YCbCr model are sampled (as shown in <FIG>, luma sampling is performed on each sample, and chroma sampling may be performed once on every two or four samples).

As shown in <FIG>, luma sampling is performed on each sample, and chroma sampling is performed once on every two samples in a horizontal direction. In other words, on every four samples, luma sampling is performed four times, first-chroma sampling is performed twice, and second-chroma sampling is performed twice. This sampling format is referred to as <NUM>:<NUM>:<NUM>. In <FIG>, a sampling ratio of first chroma or second chroma is half of a luma sampling ratio.

As shown in <FIG>, luma sampling is performed on each sample, and chroma sampling is performed once on every four samples in a horizontal direction. In other words, on every four samples, luma sampling is performed four times, first-chroma sampling is performed once, and second-chroma sampling is performed once. This sampling format is referred to as <NUM>:<NUM>:<NUM>. In <FIG>, a sampling ratio of first chroma or second chroma is a quarter of a luma sampling ratio.

As shown in <FIG>, luma sampling is performed on each sample, first-chroma sampling is performed once on every two of samples in a first row, and second-chroma sampling is performed once on every two of samples in a second row. This sampling format is referred to as <NUM>:<NUM>:<NUM>. First chroma and second chroma are separately sampled in <FIG>, while first chroma and second chroma are sampled together in <FIG>. In other words, in <FIG>, if chroma sampling needs to be performed on a sample, first-chroma sampling and second-chroma sampling need to be performed, while in <FIG>, if chroma sampling needs to be performed on a sample, first-chroma sampling or second-chroma sampling may be selected.

It should be understood that in the embodiments of this application, a sampling format of samples of a to-be-processed image may be any one of the sampling formats in <FIG>.

In existing adaptive loop filter, a luma sample and a chroma sample are separately processed when filtering processing is performed on samples of an image. Luma samples are classified into N types based on a relationship between a current luma sample and a neighboring luma sample. A same adaptive filter is used (in other words, a same group of filter coefficients is used) for a same type of luma sample, and a same adaptive filter or different adaptive filters may be used for different types of luma samples. However, conventionally, chroma samples are not classified based on a relationship between a current chroma sample and a neighboring chroma sample, and another adaptive filter is used (in other words, another group of filter coefficients is used) to perform filtering processing on chroma samples of an entire image.

Because a luma sample and a chroma sample are separately filtered by using corresponding filters, both a filter coefficient of the chroma sample and a filter coefficient of the luma sample need to be transmitted. Consequently, bit rate overheads for transmission increase.

Therefore, the embodiments of this application provide an image filtering method, to determine a filter coefficient of a chroma sample based on a filter coefficient of a luma sample. Therefore, only the filter coefficient of the luma sample needs to be transmitted, and the filter coefficient of the chroma sample may be determined based on the filter coefficient of the luma sample, so that bit rate overheads for transmission can be reduced.

<FIG> is a schematic flowchart of an adaptive loop filter method according to an embodiment of this application. The method in <FIG> includes the following steps.

Determine a filter coefficient of a chroma filter based on a filter coefficient of a luma filter.

The luma filter is applied to perform filtering processing on luma samples of a to-be-processed image.

All filter coefficients of the luma filter present a first geometric distribution, all filter coefficients of the chroma filter present a second geometric distribution, the first geometric distribution and the second geometric distribution are similar shapes, and a filter coefficient of the chroma filter at an edge of the second geometric distribution is calculated by using one or more filter coefficients of the luma filter at an edge of the first geometric distribution. For example, a filter type of each of the luma filter and the chroma filter may be any one of a tap filter with <NUM>×<NUM> diamond shape, a tap filter with <NUM>×<NUM> diamond shape, and a tap filter with <NUM>×<NUM> diamond shape shown in <FIG>. It should be understood that a distribution of the tap filter with <NUM>×<NUM> diamond shape, a distribution of the tap filter with <NUM>×<NUM> diamond shape, and a distribution of the tap filter with <NUM>×<NUM> diamond shape are geometrically similar shapes. Certainly, each of the chroma filter and the luma filter may be another type of filter. For example, the luma filter may be a filter with a filter coefficient distribution shown in <FIG>.

In addition, chroma samples may include a first chroma sample (Cb) and a second chroma sample (Cr). The filter coefficient that is determined based on the filter coefficient of the luma filter and that is of the chroma filter used to perform filtering processing on the chroma samples may be a filter coefficient of a chroma filter that is determined based on the filter coefficient of the luma filter and that is of a chroma filter used toperform filtering processing on the first chroma sample and/or the second chroma sample.

In this case, a same chroma filter may be used to perform filtering processing on a first chroma sample and a second chroma sample at a same sampling location.

Respectively perform filtering processing on the luma samples and the chroma samples by using the luma filter and the chroma filter.

In this application, a filter coefficient of a chroma sample can be determined based on a filter coefficient of a luma sample. Therefore, only the filter coefficient of the luma sample needs to be transmitted, and the filter coefficient of the chroma sample may be determined based on the filter coefficient of the luma sample, so that bit rate overheads for transmission can be reduced.

Specifically, when the method in <FIG> is performed by an encoder, the encoder may determine the filter coefficient of the chroma sample based on the filter coefficient of the luma sample, and encode only the filter coefficient of the luma sample, without encoding the filter coefficient of the chroma sample, so that bitstreams can be reduced, and encoding and decoding efficiency can be improved.

When the method in <FIG> is performed by a decoder, the decoder may obtain the filter coefficient of the luma filter based on a bitstream, and then determine the filter coefficient of the chroma filter based on the filter coefficient of the luma filter.

Optionally, the determining a filter coefficient of a chroma filter based on a filter coefficient of a luma filter includes: determining a third-type filter coefficient of the chroma filter based on a first-type filter coefficient of the luma filter; and determining a fourth-type filter coefficient of the chroma filter based on a second-type filter coefficient of the luma filter.

The fourth-type filter coefficient is a filter coefficient of the chroma filter at the edge of the second geometric distribution, the third-type filter coefficient is a filter coefficient of the chroma filter other than the fourth-type filter coefficient, the first-type filter coefficient is a filter coefficient at a same location relative to a geometric center in the first geometric distribution as the third-type filter coefficient relative to a geometric center in the second geometric distribution, and the second-type filter coefficient is a filter coefficient of the luma filter other than the first-type filter coefficient.

In other words, a center filter coefficient of the chroma filter, namely, a filter coefficient at a location of the geometric center in the second geometric distribution, may be determined based on a center filter coefficient of the luma filter, and the filter coefficient of the chroma filter at the edge of the second geometric distribution may be determined based on the filter coefficient of the luma filter relatively at the edge of the first geometric distribution. It should be understood that the center filter coefficient of the chroma filter may be determined based on the center filter coefficient of the luma filter in at least two implementations. In one implementation, a center represents a single point at a central location, and a filter coefficient of the chroma filter at a central location may be determined based on a filter coefficient of the luma filter at a central location. In the other implementation, a center is a non-peripheral location relative to an edge, namely, several points around a single point at a central location that fall within a specific range, and a center filter coefficient of the chroma filter may be determined based on weighted values of several center filter coefficients of the luma filter.

Specifically, for example, for a tap filter with <NUM>×<NUM> diamond shape, as shown in <FIG>, a point L20 is a filter coefficient at a geometric central location that is also referred to as a center filter coefficient in this specification. L0, L1, L2, L3, L4, L8, and the like are filter coefficients relatively at an edge of a geometric distribution that are also referred to as peripheral filter coefficients in this specification. It should be understood that L2 is not located at the edge of the geometric distribution, but is more approximate to the edge than the center filter coefficient, and therefore is referred to as a filter coefficient relatively at the edge of the geometric distribution.

Specifically, the determining a third-type filter coefficient of the chroma filter based on a first-type filter coefficient of the luma filter may include: assigning a value of a first luma filter coefficient in the first-type filter coefficient to a first chroma filter coefficient in the third-type filter coefficient, where a location of the first chroma filter coefficient relative to the geometric center in the second geometric distribution is the same as a location of the first luma filter coefficient relative to the geometric center in the first geometric distribution, in other words, using any luma filter coefficient in the first-type filter coefficient as a chroma filter coefficient in the third-type filter coefficient, where a location of the chroma filter coefficient relative to the center filter coefficient of the chroma filter is the same as a location of the luma filter coefficient relative to the center filter coefficient of the luma filter.

Because the luma sample and the chroma sample respectively processed by using the luma filter and the chroma filter are located at a same sampling location, a relatively desirable filtering effect can be achieved by performing filtering processing on the chroma sample by using the chroma filter determined based on the luma filter.

Optionally, in an embodiment, the determining a fourth-type filter coefficient of the chroma filter based on a second-type filter coefficient of the luma filter includes: using a sum of a value of a second luma filter coefficient in the second-type filter coefficient and a value of at least one third luma filter coefficient that has a neighborhood relationship with the second luma filter coefficient, as a value of a second chroma filter coefficient in the fourth-type filter coefficient, where a location of the second chroma filter coefficient relative to the geometric center in the second geometric distribution is the same as a location of the second luma filter coefficient relative to the geometric center in the first geometric distribution, in other words, using, as a fourth filter coefficient in the fourth-type filter coefficient, a sum of any third-type filter coefficient in the second-type filter coefficient and a filter coefficient adjacent to the third-type filter coefficient, where a location of the fourth filter coefficient relative to the center filter coefficient of the chroma filter is the same as a location of the third-type filter coefficient relative to the center filter coefficient of the luma filter.

It should be understood that the at least one third luma filter coefficient that has a neighborhood relationship with the second luma filter coefficient includes a second-type filter coefficient adjacent to or spaced by K (K is an integer greater than or equal to <NUM>) from the second luma filter coefficient in the first geometric distribution.

More specifically, the at least one third luma filter coefficient that has a neighborhood relationship with the second luma filter coefficient includes a second-type filter coefficient that is adjacent to or spaced by K from the second luma filter coefficient in the first geometric distribution and that is farther from the geometric center in the first geometric distribution than the second luma filter coefficient, where K is an integer greater than or equal to <NUM>.

In other words, the at least one third luma filter coefficient may be a second-type filter coefficient that is in filter coefficients around the second luma filter coefficient and that is farther from the geometric center in the first geometric distribution.

It should be understood that when K=<NUM>, it indicates that there is another filter coefficient between two filter coefficients on a two-dimensional plane. For example, in <FIG>, an interval between L0 and L6 is <NUM>, an interval between L1 and L3 is <NUM>, and an interval between L1 and L13 is <NUM>. In addition, for some filters with a relatively large quantity of taps (for example, <NUM>×<NUM> taps), a value of K may be an integer greater than <NUM>.

The filter coefficient adjacent to the third-type filter coefficient may be a filter coefficient that is adjacent to the third-type filter coefficient and that is located on the periphery of the third-type filter coefficient.

Optionally, in an embodiment, the method in <FIG> further includes: determining that a quantity of taps of the luma filter is greater than or equal to a preset value.

For example, when the quantity of taps of the luma filter is greater than or equal to <NUM>×<NUM>, a chroma filter coefficient may be determined based on a luma filter coefficient according to the method in <FIG>.

By using specific examples, the following describes in detail how to determine the third-type filter coefficient and the fourth-type filter coefficient of the chroma filter based on the first-type filter coefficient and the second-type filter coefficient of the luma filter.

The luma filter is a tap filter with <NUM>×<NUM> diamond shape (as shown in <FIG>), and the chroma filter is a tap filter with <NUM>×<NUM> diamond shape (as shown in <FIG>). In this case, third-type filter coefficients are specifically C6, C2, and C5, fourth-type filter coefficients are specifically C0, C1, C3, and C4, first-type filter coefficients are specifically L20, L12, and L19, and second-type filter coefficients are specifically L0, L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L13, L14, L15, L16, L17, and L18.

Relative locations of the first-type filter coefficients (L20, L12, and L19) in the first geometric distribution of the luma filter are respectively the same as relative locations of the third-type filter coefficients (C6, C2, and C5) in the second geometric distribution of the chroma filter.

Relative locations, in the luma filter, of L6, L11, L13, and L18 in the second-type filter coefficients are respectively the same as relative locations of the fourth-type filter coefficients C0, C1, C3, and C4 in the chroma filter.

In this case, the following may be obtained: <MAT> <MAT> and <MAT>.

The relative locations of C6, C2, and C5 in the chroma filter are the same as the relative locations of L20, L12, and L19 in the luma filter, and a value of a related coefficient of the luma filter may be directly determined as a filter coefficient, at a corresponding location, of the chroma filter.

In addition, the following may be further obtained: <MAT> <MAT> <MAT> and <MAT>.

That is, a sum of L6 at a same location as C0, and L0, L1, L2, and L3 on the peripheral of L6 is used as C0, a sum of L11 at a same location as C1, and L4, L5, and L10 on the peripheral of L11 is used as C1, a sum of L13 at a same location as C3, and L7, L8, and L14 on the peripheral of L13 is used as C3, and a sum of L18 at a same location as C4, and L9, L15, L16, and L17 on the peripheral of L18 is used as C4.

In another example, C0 to C6 may be calculated in a plurality of other manners. Examples are as follows: <MAT> <MAT> or <MAT> <MAT> <MAT> <MAT> <MAT> or <MAT> and <MAT> or <MAT>.

It should be understood that the plurality of foregoing manners of calculating C0 to C6 and combinations thereof are not limited in different examples.

It should be understood that when the filter coefficients of the chroma filter present another geometric distribution, there are also a plurality of similar calculation manners, and this is not limited.

The luma filter is a tap filter with <NUM>×<NUM> diamond shape (as shown in <FIG>), and the chroma filter is a tap filter with <NUM>×<NUM> diamond shape (as shown in <FIG>). In this case, third-type filter coefficients are specifically C6, C2, and C5, fourth-type filter coefficients are specifically C0, C1, C3, and C4, first-type filter coefficients are specifically M12, M6, and M11, and second-type filter coefficients are specifically M0, M1, M2, M3, M4, M5, M7, M8, M9, and M10.

Relative locations of the first-type filter coefficients (M12, M6, and M11) in the luma filter are respectively the same as relative locations of the third-type filter coefficients (C6, C2, and C5) in the chroma filter.

Relative locations, in the luma filter, of M2, M5, M7, and M10 in the second-type filter coefficients are respectively the same as relative locations of the fourth-type filter coefficients C0, C1, C3, and C4 in the chroma filter.

The relative locations of C6, C2, and C5 in the chroma filter are the same as the relative locations of M12, M6, and M11 in the luma filter, and a value of a related coefficient of the luma filter may be directly determined as a filter coefficient, at a corresponding location, of the chroma filter.

That is, a sum of M2 at a same location as C0 and M0 on the periphery of M2 is used as C0, a sum of M5 at a same location as C1, and M1 and M4 on the periphery of M5 is used as C1, a sum of M7 at a same location as C3, and M3 and M8 on the periphery of M7 is used as C3, and a sum of M10 at a same location as C4 and M9 on the periphery of M10 is used as C4.

When the luma filter and the chroma filter each are a tap filter with <NUM>×<NUM> diamond shape, as shown in <FIG> and <FIG>, assuming that a filter shown in <FIG> is a luma filter and a filter shown in <FIG> is a chroma filter, because the chroma filter and the luma filter are identical in shape, a filter coefficient of the luma filter may be directly determined as a filter coefficient, at a corresponding location, of the chroma filter. That is, filter coefficients C0 to C6 of the luma filter are directly determined as filter coefficients NO to N6 of the chroma filter respectively.

It should be understood that a tap filter with <NUM>×<NUM> diamond shape is used only as an example herein. When the luma filter and the chroma filter each are another type of filter, a filter coefficient of the luma filter may be directly determined as a filter coefficient, at a corresponding location, of the chroma filter.

The luma filter is a filter with a <NUM>×<NUM> cross and <NUM>×<NUM> rectangular taps (as shown in <FIG>), and the chroma filter is a tap filter with <NUM>×<NUM> diamond shape (as shown in <FIG>). In this case, third-type filter coefficients are specifically C1, C2, C3, C5, and C6, fourth-type filter coefficients are specifically C0 and C4, first-type filter coefficients are specifically L2, L3, L4, L7, and L8, and second-type filter coefficients are specifically L0, L1, L5, and L6.

Relative locations of the first-type filter coefficients (L2, L3, L4, L7, and L8) in the luma filter are respectively the same as relative locations of the third-type filter coefficients (C1, C2, C3, C5, and C6) in the chroma filter.

Relative locations, in the luma filter, of L1 and L6 in the second-type filter coefficients are respectively the same as relative locations of the fourth-type filter coefficients C0 and C4 in the chroma filter.

In this case, the following may be obtained: <MAT> <MAT> <MAT> <MAT> and <MAT>.

The relative locations of C1, C2, C3, C5, and C6 in the chroma filter are the same as the relative locations of L2, L3, L4, L7, and L8 in the luma filter, and a value of a related coefficient of the luma filter may be directly determined as a filter coefficient, at a corresponding location, of the chroma filter.

In addition, the following may be further obtained: <MAT> and <MAT>.

That is, a sum of L1 at a same location as C0 and L0 on the peripheral of L1 is used as C0, and a sum of L6 at a same location as C4 and L5 on the periphery of L6 is used as C4.

Optionally, in an embodiment, the method in <FIG> further includes: determining a quantity of taps of the luma filter. The determining a filter coefficient of a chroma filter based on a filter coefficient of a luma filter includes: when the quantity of taps of the luma filter is less than a preset value, using the filter coefficient of the luma filter as the filter coefficient of the chroma filter.

Specifically, the using the filter coefficient of the luma filter as the filter coefficient of the chroma filter includes: using a fourth luma filter coefficient of the luma filter as a fourth chroma filter coefficient of the chroma filter, where a location of the fourth chroma filter coefficient relative to a geometric center in the second geometric distribution is the same as a location of the fourth luma filter coefficient relative to a geometric center in the first geometric distribution, in other words, using any one of the filter coefficients (the fourth luma filter coefficient in the luma filter coefficients) of the luma filter as a fourth chroma filter coefficient of the chroma filter, where a location of the fourth chroma filter coefficient relative to the center filter coefficient of the chroma filter is the same as a location of the fourth luma filter coefficient relative to the center filter coefficient of the luma filter.

When the quantity of taps of the luma filter is relatively small, the filter coefficient of the luma filter may be directly used as the filter coefficient of the chroma filter (in this case, a same filter is used to perform filtering processing on the luma samples and the chroma samples), thereby simplifying a process of determining the filter coefficient of the chroma filter.

For example, when the luma filter is a tap filter with <NUM>×<NUM> diamond shape, a quantity of taps of the luma filter is less than a preset value. In this case, the chroma filter is also a tap filter with <NUM>×<NUM> diamond shape. When a filter coefficient of the chroma filter is being determined, a filter coefficient, at a corresponding location, of the luma filter may be directly determined as the filter coefficient of the chroma filter. As shown in <FIG> and <FIG>, assuming that filter coefficients in <FIG> are filter coefficients of the luma filter, and filter coefficients in <FIG> are filter coefficients of the chroma filter, values of M0 to M12 may be respectively used as values of L0 to L12.

For another example, when the luma filter is a tap filter with <NUM>×<NUM> diamond shape, a quantity of taps of the luma filter is less than a preset value. In this case, the chroma filter is also a tap filter with <NUM>×<NUM> diamond shape. When a filter coefficient of the chroma filter is being determined, a filter coefficient, at a corresponding location, of the luma filter may be directly determined as the filter coefficient of the chroma filter. As shown in <FIG> and <FIG>, assuming that filter coefficients in <FIG> are filter coefficients of the luma filter, and filter coefficients in <FIG> are filter coefficients of the chroma filter, values of C0 to C6 may be respectively used as values of NO to N6.

Optionally, in an embodiment, the method in <FIG> further includes: determining types of the luma samples to obtain a plurality of luma sample types; determining types of the chroma samples to obtain a plurality of chroma sample types, where any one of the plurality of chroma sample types is the same as a luma sample type corresponding to a same sampling location; determining luma filtering identification information of a luma sample, where the luma filtering identification information is used to indicate whether to perform filtering processing on the luma sample; and determining chroma filtering identification information of a chroma sample, where the chroma filtering identification information is used to indicate whether to perform chroma filtering on the chroma sample.

Optionally, in an embodiment, the method in <FIG> further includes: determining types of the luma samples to obtain a plurality of luma sample types; determining types of the chroma samples to obtain a plurality of chroma sample types, where any one of the plurality of chroma sample types is the same as a luma sample type corresponding to a same sampling location; and determining luma filtering identification information of a luma sample, where the luma filtering identification information is used to instruct to perform filtering processing on the luma sample and a chroma sample at a corresponding sampling location. In this embodiment, the luma filtering identification information is reused for filtering processing on the chroma sample.

Compared with a prior-art manner in which whether filtering is to be performed can be chosen only for a chroma sample (Cb or Cr) of an entire image, a chroma sample and a luma sample at a same sampling location are controlled by using a same filtering enabling/disabling function, so that enabling/disabling control can be implemented on a chroma sample at a finer granularity, thereby flexibly controlling filtering processing on the chroma sample and achieving a better filtering effect.

In other words, same control is used for a chroma sample and a luma sample at a same sampling location. If a luma sample is to be filtered, a chroma sample at a same sampling location as the luma sample needs to be filtered. If a luma sample is not to be filtered, a chroma sample at a same sampling location as the luma sample is not to be filtered either.

As shown in <FIG>, after samples of an image are classified into four types of luma samples, luma filtering identification information of a first-type luma sample to a third-type luma sample is "enable", and luma filtering identification information of a fourth-type luma sample is "disable", in other words, filtering processing is to be performed on the first-type luma sample to the third-type luma sample, and no filtering processing is to be performed on the fourth-type luma sample. A chroma sample (Cb or Cr), of the image, at a same sampling location as a luma sample is classified into a type with a same type number as that of the luma sample. To be specific, chroma samples, of the image, at same sampling locations as the first-type luma sample to the fourth-type luma sample are classified into a first-type chroma sample to a fourth-type chroma sample. A finally obtained classification result of the chroma samples is shown in <FIG>. Because filtering processing is to be performed on each of the first-type luma sample to the third-type luma sample, and no filtering processing is to be performed on the fourth-type luma sample, filtering processing is also to be performed on the first-type chroma sample to the third-type chroma sample (Cb or Cr), and no filtering processing is to be performed on the fourth-type chroma sample.

In this embodiment of this application, luma samples of an image may be classified according to C = <NUM>D + Â, where C is a final type number of a luma sample, D is texture directivity of an image region corresponding to the luma samples, and Â is change intensity of the image region corresponding to the luma samples.

The texture directivity D of the image region corresponding to the luma samples may be calculated according to the following steps:.

The change intensity Â of the image region corresponding to the luma samples may be calculated in the following manner:.

Therefore, the luma samples of the image may be classified according to C = <NUM>D + Â, and the luma samples of the image may be classified into <NUM> types according to the formula. Therefore, there may be <NUM> groups of corresponding adaptive filter coefficients.

Optionally, in an embodiment, when the method in <FIG> is applied to the decoder, before the determining a filter coefficient of a chroma filter based on a filter coefficient of a luma filter, the method in <FIG> further includes: parsing a bitstream to obtain the filter coefficient of the luma filter.

It should be understood that the decoder herein determines the filter coefficient of the chroma filter by using the filter coefficient of the luma filter, instead of obtaining the filter coefficient of the chroma filter by using a bitstream.

Optionally, in an embodiment, when the method in <FIG> is applied to the encoder, the method in <FIG> further includes: encoding the filter coefficient of the luma filter.

During encoding, the encoder only needs to encode the filter coefficient of the luma filter, and does not need to encode the filter coefficient of the chroma filter, thereby reducing bitstreams that need to be transmitted.

The foregoing describes the image filtering method in the embodiments of this application in detail with reference to <FIG>. The following describes image filtering apparatuses in the embodiments of this application in detail with reference to <FIG>. It should be understood that the image filtering apparatuses in <FIG> can implement the steps of the image filtering method described above. For brevity, repeated descriptions are appropriately omitted below.

In a specific implementation, the image filtering method includes: determining a filter coefficient of a chroma filter based on a filter coefficient of a luma filter, where the luma filter and the chroma filter are respectively applied to perform filtering processing on luma samples and chroma samples of a to-be-processed image, a filter coefficient distribution of the luma filter is shown in <FIG>, and a filter coefficient distribution of the chroma filter is shown in <FIG>; and respectively performing filtering processing on the luma samples and the chroma samples by using the luma filter and the chroma filter, where a relationship between filter coefficients of the luma filter and filter coefficients of the chroma filter is as follows: C6=L20; C2=L12; C5=L19; C0=l1×L1+<NUM>×L2+<NUM>×L3+<NUM>×L0+l6×L6; C1=l4×L4+<NUM>×L5+<NUM>×L10+l11×L11; C3=l7×L7+<NUM>×L8+<NUM>×L13+l14×L14; and C4=l9×L9+<NUM>×Ll5+<NUM>×L16+<NUM>×L17+l18×L18, where <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> are weighting coefficients.

In a specific implementation, each of the weighting coefficients <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> is <NUM>.

In a specific implementation, each of the weighting coefficients <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> is <NUM>.

In another specific implementation, the image filtering method includes: determining a filter coefficient of a chroma filter based on a filter coefficient of a luma filter, where the luma filter and the chroma filter are respectively applied to perform filtering processing on luma samples and chroma samples of a to-be-processed image, a filter coefficient distribution of the luma filter is shown in <FIG>, and a filter coefficient distribution of the chroma filter is shown in <FIG>; and respectively performing filtering processing on the luma samples and the chroma samples by using the luma filter and the chroma filter, where a relationship between filter coefficients of the luma filter and filter coefficients of the chroma filter is as follows: C6=L8; C5=L7; C2=L3; C1=L2; C3=L4; C0=c0×L0+c1×L1; and C4=c5×L5+c6×L6, where c0, c1, c5, and c6 are weighting coefficients.

It should be understood that in this embodiment, all the filter coefficients of the luma filter present a first geometric distribution, all the filter coefficients of the chroma filter present a second geometric distribution, and the first geometric distribution and the second geometric distribution are similar shapes, but are not similar images. However, it remains unchanged that a filter coefficient of the chroma filter at an edge of the second geometric distribution is calculated by using one or more filter coefficients of the luma filter at an edge of the first geometric distribution. It should be understood that in this specific implementation, the relationship between the filter coefficients of the luma filter and the filter coefficients of the chroma filter is determined based on the foregoing characteristics, but is not limited to the correspondence provided in this implementation.

In another specific implementation, each of the weighting coefficients c0, c1, c5, and c6 is <NUM>.

<FIG> is a schematic block diagram of an image filtering apparatus <NUM> according to an embodiment of this application. The image filtering apparatus <NUM> in <FIG> may perform the image filtering method in <FIG>, and the image filtering apparatus <NUM> includes:.

In this application, the filter coefficient of the chroma filter may be determined based on the filter coefficient of the luma filter, so that during bitstream transmission, only a bitstream corresponding to the filter coefficient of the luma filter needs to be transmitted, thereby reducing to-be-transmitted bitstreams.

Optionally, in an embodiment, the determining module <NUM> is specifically configured to: determine a third-type filter coefficient of the chroma filter based on a first-type filter coefficient of the luma filter; and determine a fourth-type filter coefficient of the chroma filter based on a second-type filter coefficient of the luma filter, where the fourth-type filter coefficient is a filter coefficient of the chroma filter at the edge of the second geometric distribution, the third-type filter coefficient is a filter coefficient of the chroma filter other than the fourth-type filter coefficient, the first-type filter coefficient is a filter coefficient at a same location relative to a geometric center in the first geometric distribution as the third-type filter coefficient relative to a geometric center in the second geometric distribution, and the second-type filter coefficient is a filter coefficient of the luma filter other than the first-type filter coefficient.

Optionally, in an embodiment, the determining module <NUM> is specifically configured to assign a value of a first luma filter coefficient in the first-type filter coefficient to a first chroma filter coefficient in the third-type filter coefficient, where a location of the first chroma filter coefficient relative to the geometric center in the second geometric distribution is the same as a location of the first luma filter coefficient relative to the geometric center in the first geometric distribution.

Optionally, in an embodiment, the luma filter is a tap filter with <NUM>×<NUM> diamond shape, the chroma filter is a tap filter with <NUM>×<NUM> diamond shape, the first geometric distribution is a <NUM>×<NUM> diamond distribution, the second geometric distribution is a <NUM>×<NUM> diamond distribution, the first-type filter coefficient includes L20, L12, and L19, and the third-type filter coefficient includes C6, C2, and C5, where the filter coefficients of the luma filter are L0, L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L20, L19, L18, L17, L16, L15, L14, L13, L12, L11, L10, L9, L8, L7, L6, L5, L4, L3, L2, L1, and L0 in the <NUM>×<NUM> diamond distribution based on a raster scanning order, the filter coefficients of the chroma filter are C0, C1, C2, C3, C4, C5, C6, C5, C4, C3, C2, C1, and C0 in the <NUM>×<NUM> diamond distribution based on a raster scanning order, and a location of L19 relative to L20 is the same as a location of C5 relative to C6. The determining module <NUM> is specifically configured to respectively use L20, L12, and L19 as C6, C2, and C5.

Optionally, in an embodiment, the determining module <NUM> is specifically configured to use a sum of a value of a second luma filter coefficient in the second-type filter coefficient and a value of at least one third luma filter coefficient that has a neighborhood relationship with the second luma filter coefficient, as a value of a second chroma filter coefficient in the fourth-type filter coefficient, where a location of the second chroma filter coefficient relative to the geometric center in the second geometric distribution is the same as a location of the second luma filter coefficient relative to the geometric center in the first geometric distribution.

Optionally, in an embodiment, the at least one third luma filter coefficient that has a neighborhood relationship with the second luma filter coefficient includes a second-type filter coefficient adjacent to or spaced by K from the second luma filter coefficient in the first geometric distribution, where K is an integer greater than or equal to <NUM>.

Optionally, in an embodiment, the luma filter is a tap filter with <NUM>×<NUM> diamond shape, the chroma filter is a tap filter with <NUM>×<NUM> diamond shape, the first geometric distribution is a <NUM>×<NUM> diamond distribution, the second geometric distribution is a <NUM>×<NUM> diamond distribution, the second-type filter coefficient includes L0, L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L13, L14, L15, L16, L17, and L18, and the fourth-type filter coefficient includes C0, C1, C3, and C4, where the filter coefficients of the luma filter are L0, L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L20, L19, L18, L17, L16, L15, L14, L13, L12, L11, L10, L9, L8, L7, L6, L5, L4, L3, L2, L1, and L0 in the <NUM>×<NUM> diamond distribution based on a raster scanning order, and the filter coefficients of the chroma filter are C0, C1, C2, C3, C4, C5, C6, C5, C4, C3, C2, C1, and C0 in the <NUM>×<NUM> diamond distribution based on a raster scanning order. The determining module <NUM> is specifically configured to: use a sum of L1, L2, L3, L0, and L6 as C0; use a sum of L4, L5, L10, and L11 as C1; use a sum of L7, L8, L13, and L14 as C3; and use a sum of L9, L15, L16, L17, and L18 as C4.

Optionally, in an embodiment, the determining module <NUM> is further configured to determine that a quantity of taps of the luma filter is greater than or equal to a preset value.

Optionally, in an embodiment, the determining module <NUM> is specifically configured to: determine a quantity of taps of the luma filter; and when the quantity of taps of the luma filter is less than a preset value, use the filter coefficient of the luma filter as the filter coefficient of the chroma filter.

Optionally, in an embodiment, the determining module <NUM> is specifically configured to use a fourth luma filter coefficient of the luma filter as a fourth chroma filter coefficient of the chroma filter, where a location of the fourth chroma filter coefficient relative to a geometric center in the second geometric distribution is the same as a location of the fourth luma filter coefficient relative to a geometric center in the first geometric distribution.

Optionally, in an embodiment, the image filtering apparatus <NUM> further includes:.

Optionally, in an embodiment, the image filtering apparatus <NUM> is applied to a decoder, and the image filtering apparatus <NUM> further includes:
a decoding module <NUM>, configured to parse a bitstream to obtain the filter coefficient of the luma filter.

Optionally, in an embodiment, the image filtering apparatus <NUM> is applied to an encoder, and the image filtering apparatus <NUM> further includes:
an encoding module <NUM>, configured to encode the filter coefficient of the luma filter.

<FIG> is a schematic block diagram of an image filtering apparatus according to an embodiment of this application. The image filtering apparatus <NUM> in <FIG> may perform the image filtering method in <FIG>, and the image filtering apparatus <NUM> includes:.

Optionally, in an embodiment, the processor <NUM> is specifically configured to: determine a third-type filter coefficient of the chroma filter based on a first-type filter coefficient of the luma filter; and determine a fourth-type filter coefficient of the chroma filter based on a second-type filter coefficient of the luma filter, where the fourth-type filter coefficient is a filter coefficient of the chroma filter at the edge of the second geometric distribution, the third-type filter coefficient is a filter coefficient of the chroma filter other than the fourth-type filter coefficient, the first-type filter coefficient is a filter coefficient at a same location relative to a geometric center in the first geometric distribution as the third-type filter coefficient relative to a geometric center in the second geometric distribution, and the second-type filter coefficient is a filter coefficient of the luma filter other than the first-type filter coefficient.

Optionally, in an embodiment, the processor <NUM> is specifically configured to assign a value of a first luma filter coefficient in the first-type filter coefficient to a first chroma filter coefficient in the third-type filter coefficient, where a location of the first chroma filter coefficient relative to the geometric center in the second geometric distribution is the same as a location of the first luma filter coefficient relative to the geometric center in the first geometric distribution.

Optionally, in an embodiment, the luma filter is a tap filter with <NUM>×<NUM> diamond shape, the chroma filter is a tap filter with <NUM>×<NUM> diamond shape, the first geometric distribution is a <NUM>×<NUM> diamond distribution, the second geometric distribution is a <NUM>×<NUM> diamond distribution, the first-type filter coefficient includes L20, L12, and L19, and the third-type filter coefficient includes C6, C2, and C5, where the filter coefficients of the luma filter are L0, L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L20, L19, L18, L17, L16, L15, L14, L13, L12, L11, L10, L9, L8, L7, L6, L5, L4, L3, L2, L1, and L0 in the <NUM>×<NUM> diamond distribution based on a raster scanning order, and the filter coefficients of the chroma filter are C0, C1, C2, C3, C4, C5, C6, C5, C4, C3, C2, C1, and C0 in the <NUM>×<NUM> diamond distribution based on a raster scanning order. The processor <NUM> is specifically configured to respectively use L20, L12, and L19 as C6, C2, and C5.

Optionally, in an embodiment, the processor <NUM> is specifically configured to use a sum of a value of a second luma filter coefficient in the second-type filter coefficient and a value of at least one third luma filter coefficient that has a neighborhood relationship with the second luma filter coefficient, as a value of a second chroma filter coefficient in the fourth-type filter coefficient, where a location of the second chroma filter coefficient relative to the geometric center in the second geometric distribution is the same as a location of the second luma filter coefficient relative to the geometric center in the first geometric distribution.

Optionally, in an embodiment, the luma filter is a tap filter with <NUM>×<NUM> diamond shape, the chroma filter is a tap filter with <NUM>×<NUM> diamond shape, the first geometric distribution is a <NUM>×<NUM> diamond distribution, the second geometric distribution is a <NUM>×<NUM> diamond distribution, the second-type filter coefficient includes L0, L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L13, L14, L15, L16, L17, and L18, and the fourth-type filter coefficient includes C0, C1, C3, and C4, where the filter coefficients of the luma filter are L0, L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L20, L19, L18, L17, L16, L15, L14, L13, L12, L11, L10, L9, L8, L7, L6, L5, L4, L3, L2, L1, and L0 in the <NUM>×<NUM> diamond distribution based on a raster scanning order, and the filter coefficients of the chroma filter are C0, C1, C2, C3, C4, C5, C6, C5, C4, C3, C2, C1, and C0 in the <NUM>×<NUM> diamond distribution based on a raster scanning order. The processor <NUM> is specifically configured to: use a sum of L1, L2, L3, L0, and L6 as C0; use a sum of L4, L5, L10, and L11 as C1; use a sum of L7, L8, L13, and L14 as C3; and use a sum of L9, L15, L16, L17, and L18 as C4.

Optionally, in an embodiment, the processor <NUM> is further configured to determine that a quantity of taps of the luma filter is greater than or equal to a preset value.

Optionally, in an embodiment, the processor <NUM> is specifically configured to: determine a quantity of taps of the luma filter; and when the quantity of taps of the luma filter is less than a preset value, use the filter coefficient of the luma filter as the filter coefficient of the chroma filter.

Optionally, in an embodiment, the processor <NUM> is specifically configured to use a fourth luma filter coefficient of the luma filter as a fourth chroma filter coefficient of the chroma filter, where a location of the fourth chroma filter coefficient relative to a geometric center in the second geometric distribution is the same as a location of the fourth luma filter coefficient relative to a geometric center in the first geometric distribution.

Optionally, in an embodiment, the processor <NUM> is specifically configured to: determine types of the luma samples to obtain a plurality of luma sample types; determine types of the chroma samples to obtain a plurality of chroma sample types, where any one of the plurality of chroma sample types is the same as a luma sample type corresponding to a same sampling location; and determine luma filtering identification information of a luma sample, where the luma filtering identification information is used to instruct to perform filtering processing on the luma sample and a chroma sample at a corresponding sampling location.

Optionally, in an embodiment, the image filtering apparatus <NUM> is applied to a decoder, and the processor <NUM> is further configured to parse a bitstream to obtain the filter coefficient of the luma filter.

Optionally, in an embodiment, the image filtering apparatus <NUM> is applied to an encoder, and the processor <NUM> is further configured to encode the filter coefficient of the luma filter.

It should be understood that the image filtering apparatus <NUM> and the image filtering apparatus <NUM> may be specifically located in an encoding and decoding device or a codec, and the encoding and decoding device or the codec may also perform the image filtering method described above.

With reference to <FIG>, the following describes in detail an encoding and decoding apparatus and an encoding and decoding system including an encoding and decoding apparatus. It should be understood that the encoding and decoding apparatus and the encoding and decoding system in <FIG> can perform the image filtering method in <FIG>.

<FIG> and <FIG> show an encoding and decoding apparatus <NUM> according to an embodiment of this application. The encoding and decoding apparatus <NUM> may be a mobile terminal or user equipment in a wireless communications system. It should be understood that this embodiment of this application may be implemented in any electronic device or apparatus that may need to encode and/or decode a video or an image.

The encoding and decoding apparatus <NUM> may include a housing <NUM> integrated into the device and protecting the device, a display <NUM> (which may be specifically a liquid crystal display), and a keypad <NUM>. The encoding and decoding apparatus <NUM> may include a microphone <NUM> or any appropriate audio input, and the audio input may be digital or analog signal input. The encoding and decoding apparatus <NUM> may further include an audio output device. In this embodiment of this application, the audio output device may be any one of the following: a headset <NUM>, a loudspeaker, an analog audio or digital audio output connection. The encoding and decoding apparatus <NUM> may also include a battery <NUM>. In another embodiment of this application, the device may be powered by any appropriate mobile energy device such as a solar cell, a fuel cell, or a clock generator. The apparatus may further include an infrared port <NUM> for performing near field communication with another device. In another embodiment, the encoding and decoding apparatus <NUM> may further include any appropriate near field communication function such as a Bluetooth wireless connection or a USB/firewire wired connection.

The encoding and decoding apparatus <NUM> may include a controller <NUM> or a processor configured to control the encoding and decoding apparatus <NUM>. The controller <NUM> may be connected to a memory <NUM>. In this embodiment of this application, the memory may store data in a form of an image and data in a form of an audio, and/or may store an instruction to be implemented on the controller <NUM>. The controller <NUM> may also be connected to a codec <NUM> adapted to implement encoding and decoding of audio and/or video data or encoding and decoding implemented with assistance of the controller <NUM>.

The encoding and decoding apparatus <NUM> may further include a card reader <NUM> and a smart card <NUM>, such as a universal integrated circuit card (Universal Integrated Circuit Card, UICC) and a UICC reader, configured to provide user information and adapted to provide authentication information for attempting to authenticate and authorizing a user on a network.

The encoding and decoding apparatus <NUM> may further include a radio interface circuit <NUM>, and the radio interface circuit is connected to the controller and is adapted to generate a wireless communication signal, for example, used to communicate with a cellular communications network, a wireless communications system, or a wireless local area network. The encoding and decoding apparatus <NUM> may further include an antenna <NUM>, and the antenna is connected to the radio interface circuit <NUM> and is configured to send radio frequency signals generated by the radio interface circuit <NUM> to (a plurality of) other apparatuses and configured to receive radio frequency signals from (the plurality of) other apparatuses.

In some embodiments of this application, the encoding and decoding apparatus <NUM> includes a camera that can record or detect a single frame, and the codec <NUM> or the controller receives and processes the single frame. In some embodiments of this application, the encoding and decoding apparatus <NUM> may receive to-be-processed video or image data from another device before transmitting and/or storing the to-be-processed video or image data. In some embodiments of this application, the encoding and decoding apparatus <NUM> may receive an image through a wireless or wired connection for encoding/decoding.

It should be understood that <FIG> is only an example diagram of the encoding and decoding apparatus <NUM> and each software module and each hardware module included in the encoding and decoding apparatus <NUM>, and there are a plurality of different implementations. For example, the keypad <NUM> may be a touchscreen, and the touchscreen may be a part of the display <NUM>. This is not limited.

<FIG> is a schematic block diagram of a video encoding and decoding system <NUM> according to an embodiment of this application. As shown in <FIG>, the video encoding and decoding system <NUM> includes a source apparatus <NUM> and a destination apparatus <NUM>. The source apparatus <NUM> generates encoded video data. Therefore, the source apparatus <NUM> may be referred to as a video encoding apparatus or a video encoding device. The destination apparatus <NUM> may decode the encoded video data generated by the source apparatus <NUM>. Therefore, the destination apparatus <NUM> may be referred to as a video decoding apparatus or a video decoding device. The source apparatus <NUM> and the destination apparatus <NUM> may be examples of a video encoding and decoding apparatus or a video encoding and decoding device. The source apparatus <NUM> and the destination apparatus <NUM> each may include a desktop computer, a mobile computing apparatus, a notebook (for example, a laptop) computer, a tablet computer, a set-top box, a handheld phone such as a smartphone, a television, a camera, a display apparatus, a digital media player, a video game console, an in-vehicle computer, or another similar device.

The destination apparatus <NUM> may receive the encoded video data from the source apparatus <NUM> through a channel <NUM>. The channel <NUM> may include one or more media and/or apparatuses capable of moving the encoded video data from the source apparatus <NUM> to the destination apparatus <NUM>. For example, the channel <NUM> may include one or more communications media that enable the source apparatus <NUM> to directly transmit the encoded video data to the destination apparatus <NUM> in real time. In this example, the source apparatus <NUM> may modulate the encoded video data according to a communication standard (for example, a wireless communication protocol), and may transmit modulated video data to the destination apparatus <NUM>. The one or more communications media may include a wireless communications medium and/or a wired communications medium such as a radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communications media may form a part of a packet-based network (for example, a local area network, a wide area network, or a global network (for example, the Internet)). The one or more communications media may include a router, a switch, a base station, or another device that facilitates communication from the source apparatus <NUM> to the destination apparatus <NUM>.

For another example, the channel <NUM> may include a storage medium for storing the encoded video data generated by the source apparatus <NUM>. In this example, the destination apparatus <NUM> may access the storage medium through disk access or card access. There may be a plurality of local access data storage media such as a Blu-ray disc, a DVD, a CD-ROM, a flash memory, or another appropriate digital storage medium for storing the encoded video data.

For another example, the channel <NUM> may include a file server or another intermediate storage apparatus for storing the encoded video data generated by the source apparatus <NUM>. In this example, the destination apparatus <NUM> may access, through streaming transmission or downloading, the encoded video data stored on the file server or the another intermediate storage apparatus. The file server may be a type of server that can store the encoded video data and that can transmit the encoded video data to the destination apparatus <NUM>. For example, the file server may include a web server (for example, used for a website), a file transfer protocol (FTP) server, a network-attached storage (NAS) apparatus, and a local disk drive.

The destination apparatus <NUM> may access the encoded video data through a standard data connection (for example, an Internet connection). Examples of the data connection include a wireless channel (for example, a Wi-Fi connection), a wired connection (for example, a DSL or a cable modem), or a combination thereof adapted to access the encoded video data stored on the file server. The encoded video data may be transmitted from the file server through streaming transmission, downloading transmission, or a combination thereof.

The image filtering method in this application is not limited to a wireless application scenario. For example, the image filtering method may be applied to a plurality of multimedia applications such as the following application: air television broadcasting, cable television transmitting, satellite television transmitting, video streaming transmission (for example, through the Internet), encoding of video data stored on a data storage medium, decoding of video data stored on a data storage medium, or another application. In some examples, the video encoding and decoding system <NUM> may be applied to support unidirectional or bidirectional video transmission to support applications such as video streaming transmission, video play, video broadcasting, and/or a video call.

In the example of <FIG>, the source apparatus <NUM> includes a video source <NUM>, a video encoder <NUM>, and an output interface <NUM>. In some examples, the output interface <NUM> may include a modulator/demodulator (modem) and/or a transmitter. The video source <NUM> may include a video capture apparatus (for example, a video camera), a video file including previously captured video data, a video input interface that is configured to receive video data from a video content provider, and/or a computer graphics system that is configured to generate video data, or a combination of the foregoing video data sources.

The video encoder <NUM> may encode video data that comes from the video source <NUM>. In some examples, the source apparatus <NUM> directly transmits encoded video data to the destination apparatus <NUM> through the output interface <NUM>. The encoded video data may also be stored on a storage medium or a file server for later access by the destination apparatus <NUM> for decoding and/or playing.

In the example of <FIG>, the destination apparatus <NUM> includes an input interface <NUM>, a video decoder <NUM>, and a display apparatus <NUM>. In some examples, the input interface <NUM> includes a receiver and/or a modem. The input interface <NUM> may receive the encoded video data through the channel <NUM>. The display apparatus <NUM> may be integrated with the destination apparatus <NUM> or may be external to the destination apparatus <NUM>. The display apparatus <NUM> usually displays decoded video data. The display apparatus <NUM> may include a plurality of display apparatuses such as a liquid crystal display (LCD), a plasma display, an organic light-emitting diode (OLED) display, or another type of display apparatus.

Claim 1:
An image filtering method, comprising:
determining (<NUM>) a filter coefficient of a chroma filter based on a filter coefficient of a luma filter, wherein filter coefficients of the luma filter present a first geometric distribution, filter coefficients of the chroma filter present a second geometric distribution; and
respectively performing (<NUM>) filtering processing on luma samples and chroma samples of a to-be-processed image by using the luma filter and the chroma filter;
characterized in that
a filter coefficient of the chroma filter at an edge of the second geometric distribution is calculated by using more than one filter coefficient of the luma filter at the first geometric distribution;
wherein a filter coefficient distribution of the luma filter being the first geometric distribution is shown in the following table:
<IMG>
wherein a filter coefficient distribution of the chroma filter being the second geometric distribution is shown in the following table:
<IMG>
and
wherein the filter coefficient of the chroma filter at an edge of the second geometric distribution comprises: Co, C1, C3, and C4,
wherein a relationship between filter coefficients of the luma filter and filter coefficients of the chroma filter is as follows: <MAT> <MAT> <MAT> <MAT> <MAT> <MAT> and <MAT>