Methods and apparatus of using bilateral filter for video coding
By signaling bilateral filter options at the slice level and using coding unit information, the method optimizes filter strength and selection in video coding systems, enhancing video quality and encoding efficiency.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- MEDIATEK INC
- Filing Date
- 2025-11-06
- Publication Date
- 2026-05-15
AI Technical Summary
Existing video coding systems, such as VVC, face challenges in optimizing the bilateral filter process at the slice level to improve video quality, as current methods lack flexibility and efficiency in adjusting filter strength and options based on coding unit information.
The method involves signaling bilateral filter options at the slice level to control the bilateral filter process, allowing for adjustments in filter strength and QP offset based on coding unit information, including transform block size, aspect ratio, neighboring modes, variance, and gradient magnitude, and utilizing sample-based classification to select samples for filtering.
This approach enhances video coding performance by optimizing filter application based on specific coding conditions, leading to improved video quality and encoding efficiency.
Smart Images

Figure CN2025133109_15052026_PF_FP_ABST
Abstract
Description
METHODS AND APPARATUS OF USING BILATERAL FILTER FOR VIDEO CODINGCROSS REFERENCE TO RELATED APPLICATIONS
[0001] The present invention is a non-Provisional Application of and claims priority to U.S. Provisional Patent Application No. 63 / 716,762, filed on November 6, 2024. The U.S. Provisional Patent Application is hereby incorporated by reference in its entirety.FIELD OF THE INVENTION
[0002] The present invention relates to video coding system. In particular, the present invention relates to slice-level indication of bilateral filter options to control bilateral filter process to improve the performance. BACKGROUND AND RELATED ART
[0003] Versatile video coding (VVC) is the latest international video coding standard developed by the Joint Video Experts Team (JVET) of the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Moving Picture Experts Group (MPEG) . The standard has been published as an ISO standard: ISO / IEC 23090-3: 2021, Information technology -Coded representation of immersive media -Part 3: Versatile video coding, published Feb. 2021. VVC is developed based on its predecessor HEVC (High Efficiency Video Coding) by adding more coding tools to improve coding efficiency and also to handle various types of video sources including 3-dimensional (3D) video signals.
[0004] Fig. 1A illustrates an exemplary adaptive Inter / Intra video encoding system incorporating loop processing. For Intra Prediction 110, the prediction data is derived based on previously coded video data in the current picture. For Inter Prediction 112, Motion Estimation (ME) is performed at the encoder side and Motion Compensation (MC) is performed based on the result of ME to provide prediction data derived from other picture (s) and motion data. Switch 114 selects Intra Prediction 110 or Inter Prediction 112 and the selected prediction data is supplied to Adder 116 to form prediction errors, also called residues. The prediction error is then processed by Transform (T) 118 followed by Quantization (Q) 120. The transformed and quantized residues are then coded by Entropy Encoder 122 to be included in a video bitstream corresponding to the compressed video data. The bitstream associated with the transform coefficients is then packed with side information such as motion and coding modes associated with Intra prediction and Inter prediction, and other information such as parameters associated with loop filters applied to underlying image area. The side information associated with Intra Prediction 110, Inter prediction 112 and in-loop filter 130, is provided to Entropy Encoder 122 as shown in Fig. 1A. When an Inter-prediction mode is used, a reference picture or pictures have to be reconstructed at the encoder end as well. Consequently, the transformed and quantized residues are processed by Inverse Quantization (IQ) 124 and Inverse Transformation (IT) 126 to recover the residues. The residues are then added back to prediction data 136 at Reconstruction (REC) 128 to reconstruct video data. The reconstructed video data may be stored in Reference Picture Buffer 134 and used for prediction of other frames.
[0005] As shown in Fig. 1A, incoming video data undergoes a series of processing in the encoding system. The reconstructed video data from REC 128 may be subject to various impairments due to a series of processing. Accordingly, in-loop filter 130 is often applied to the reconstructed video data before the reconstructed video data are stored in the Reference Picture Buffer 134 in order to improve video quality. For example, deblocking filter (DF) , Sample Adaptive Offset (SAO) and Adaptive Loop Filter (ALF) may be used. The loop filter information may need to be incorporated in the bitstream so that a decoder can properly recover the required information. Therefore, loop filter information is also provided to Entropy Encoder 122 for incorporation into the bitstream. In Fig. 1A, Loop filter 130 is applied to the reconstructed video before the reconstructed samples are stored in the reference picture buffer 134. The system in Fig. 1A is intended to illustrate an exemplary structure of a typical video encoder. It may correspond to the High Efficiency Video Coding (HEVC) system, VP8, VP9, H. 264 or VVC.
[0006] The decoder, as shown in Fig. 1B, can use some of the functional blocks as the encoder. For example, the decoder can reuse Inverse Quantization 124 and Inverse Transform 126; however, Transform 118 and Quantization 120 are not needed at the decoder. Instead of Entropy Encoder 122, the decoder uses an Entropy Decoder 140 to decode the video bitstream into quantized transform coefficients and needed coding information (e.g. ILPF information, Intra prediction information and Inter prediction information) . The Intra prediction 150 at the decoder side does not need to perform the mode search. Instead, the decoder only needs to generate Intra prediction according to Intra prediction information received from the Entropy Decoder 140. Furthermore, for Inter prediction, the decoder only needs to perform motion compensation (MC 152) according to Inter prediction information received from the Entropy Decoder 140 without the need for motion estimation.
[0007] In VVC, the Sequence Parameter Set (SPS) and the Picture Parameter Set (PPS) contain high-level syntax elements that apply to entire coded video sequences and pictures, respectively. The Picture Header (PH) and Slice Header (SH) contain high-level syntax elements that apply to a current coded picture and a current coded slice, respectively.
[0008] In VVC, a coded picture is partitioned into non-overlapped square block regions represented by the associated coding tree units (CTUs) . A coded picture can be represented by a collection of slices, each comprising an integer number of CTUs. The individual CTUs in a slice are processed in raster-scan order. A bi-predictive (B) slice may be decoded using intra prediction or inter prediction with at most two motion vectors and reference indices to predict the sample values of each block. A predictive (P) slice is decoded using intra prediction or inter prediction with at most one motion vector and reference index to predict the sample values of each block. An intra (I) slice is decoded using intra prediction only.
[0009] Bilateral Filter in ECM
[0010] The BIF is disclosed in JVET-AI2025. The filter is carried out in the Sample Adaptive Offset (SAO) loop-filter stage, as shown in Fig. 2, where both the bilateral filter (BIF) 210 and SAO 220 are using samples from deblocking as input. Each filter creates an offset per sample, and they are added to the input sample and then clipped, before proceeding to ALF.
[0011] In detail, the output sample IOUT is obtained as: IOUT=clip3 (IC+ΔIBIF+ΔISAO) , (1) where IC is the input sample from deblocking, ΔIBIF is the offset from the bilateral filter and ΔISAO is the offset from SAO.
[0012] The implementation provides the possibility for the encoder to enable or disable filtering at the CTU and slice level. The encoder makes a decision by evaluating the RDO cost.
[0013] For CTUs that are filtered, the filtering process proceeds as follows.
[0014] At the picture border, where samples are unavailable, the bilateral filter uses extension (e.g. sample repetition) to replace the unavailable samples. For virtual boundaries, the behaviour is the same as for SAO, i.e., no filtering. When crossing horizontal CTU borders, the bilateral filter can access the same samples as SAO. For example, if the centre sample IC (see Fig. 3) is located on the top line of a CTU, INW, IA and INE are read from the CTU above, just like SAO does, but IAA is padded, so no extra line buffer is needed compared to JVET-P0073.
[0015] The samples surrounding the centre sample IC are denoted according to Fig. 3, where A, B, L and R stand for above, below, left and right respectively and where NW, NE, SW, SE stands for north-west etc. Likewise, AA stands for above-above, BB for below-below etc. This diamond shape is different from JVET-P0073 which used a square filter support, not using IAA, IBB, ILL, or IRR.
[0016] Each surrounding sample IA, IR etc will contribute with a corresponding modifier value μΔIA, μΔIR, etc. These are calculated in the following way: Starting with the contribution from the sample to the right, IR, we calculate the difference ΔIR= (|IR-IC|+4) >>3, (2) where |·| denotes absolute value. For data that is not 10-bit, we use ΔIR= (|IR-IC|+2n-6) >> (n-7) instead, where n = 8 for 8-bit data etc. The resulting value is now clipped so that it is smaller than 16: sIR=min (15, ΔIR) . (3)
[0017] The modifier value is now calculated as: where LUTROW [] is an array of 16 values determined by the value of qpb = clip (0, 25, QP +bilateral_filter_qp_offset-17) : {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, } , if qpb = 0 {0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, } , if qpb = 1 {0, 2, 2, 2, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, } , if qpb = 2 {0, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, -1, } , if qpb = 3 {0, 3, 3, 3, 2, 2, 1, 2, 1, 1, 1, 1, 0, 1, 1, -1, } , if qpb = 4 {0, 4, 4, 4, 3, 2, 1, 2, 1, 1, 1, 1, 0, 1, 1, -1, } , if qpb = 5 {0, 5, 5, 5, 4, 3, 2, 2, 2, 2, 2, 1, 0, 1, 1, -1, } , if qpb = 6 {0, 6, 7, 7, 5, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, -1, } , if qpb = 7 {0, 6, 8, 8, 5, 4, 3, 3, 3, 3, 3, 2, 1, 2, 2, -2, } , if qpb = 8 {0, 7, 10, 10, 6, 4, 4, 4, 4, 3, 3, 2, 2, 2, 2, -2, } , if qpb = 9 {0, 8, 11, 11, 7, 5, 5, 4, 5, 4, 4, 2, 2, 2, 2, -2, } , if qpb = 10 {0, 8, 12, 13, 10, 8, 8, 6, 6, 6, 5, 3, 3, 3, 3, -2, } , if qpb = 11 {0, 8, 13, 14, 13, 12, 11, 8, 8, 7, 7, 5, 5, 4, 4, -2, } , if qpb = 12 {0, 9, 14, 16, 16, 15, 14, 11, 9, 9, 8, 6, 6, 5, 6, -3, } , if qpb = 13 {0, 9, 15, 17, 19, 19, 17, 13, 11, 10, 10, 8, 8, 6, 7, -3, } , if qpb = 14 {0, 9, 16, 19, 22, 22, 20, 15, 12, 12, 11, 9, 9, 7, 8, -3, } , if qpb = 15 {0, 10, 17, 21, 24, 25, 24, 20, 18, 17, 15, 12, 11, 9, 9, -3, } , if qpb = 16 {0, 10, 18, 23, 26, 28, 28, 25, 23, 22, 18, 14, 13, 11, 11, -3, } , if qpb = 17 {0, 11, 19, 24, 29, 30, 32, 30, 29, 26, 22, 17, 15, 13, 12, -3, } , if qpb = 18 {0, 11, 20, 26, 31, 33, 36, 35, 34, 31, 25, 19, 17, 15, 14, -3, } , if qpb = 19 {0, 12, 21, 28, 33, 36, 40, 40, 40, 36, 29, 22, 19, 17, 15, -3, } , if qpb = 20 {0, 13, 21, 29, 34, 37, 41, 41, 41, 38, 32, 23, 20, 17, 15, -3, } , if qpb = 21 {0, 14, 22, 30, 35, 38, 42, 42, 42, 39, 34, 24, 20, 17, 15, -3, } , if qpb = 22 {0, 15, 22, 31, 35, 39, 42, 42, 43, 41, 37, 25, 21, 17, 15, -3, } , if qpb = 23 {0, 16, 23, 32, 36, 40, 43, 43, 44, 42, 39, 26, 21, 17, 15, -3, } , if qpb = 24 {0, 17, 23, 33, 37, 41, 44, 44, 45, 44, 42, 27, 22, 17, 15, -3, } , if qpb = 25
[0018] This is different from JVET-P0073 where 5 such tables are used, and the same table is reused for multiple QP-values.
[0019] As described in JVET-N0493 Section 3.1.3, these values can be stored using six bits per entry resulting in 26*16*6 / 8=312 bytes or 300 bytes if excluding the first row which is all zeros.
[0020] The modifier values for and are calculated from IL, IA and IB in the same way. For diagonal samples INW, INE, ISE, and ISW, and the samples two steps away IAA, IBB, IRR and ILL, the calculation also follows Equations 2 and 3, but uses a value shifted by 1. Using the diagonal sample ISE as an example, we get and the other diagonal samples and two-steps-away samples are calculated likewise. The modifier values are summed together
[0021] Note that equals for the previous sample. Likewise, equals for the sample above, and similar symmetries can be found also for the diagonal-and two-steps-away modifier values. This means that in a hardware implementation, it is sufficient to calculate the six values and and the remaining six values can be obtained from previously calculated values.
[0022] The msum value is now multiplied either by c = 1, 2 or 3, which can be done using a single adder and logic AND gates in the following way: cv=k1& (msum<<1) +k2&msum, (7) where &denotes “logic AND” operation and k1 is the most significant bit of the multiplier c and k2 is the least significant bit. The value to multiply with is obtained using the minimum block dimension D=min (width, height) as shown in Table : Table 1. Obtaining the c parameter from the minimum size D = min (width, height) of the block.
[0023] Finally, the bilateral filter offset ΔIBIF is calculated. For full strength filtering, we use ΔIBIF= (cv+16) >>5, (8) whereas for half-strength filtering, we instead use ΔIBIF= (cv+32) >>6. (9)
[0024] A general formula for n-bit data is to use where bilateral_filter_strength can be 0 or 1 and is signalled in the PPS.
[0025] Bilateral Inloop Filter on Chroma
[0026] Same as BIF-luma, proposed BIF-chroma 410 is also performed in parallel with the SAO 420 and CCSAO 430 process as shown in Fig. 4. BIF-chroma, CCSAO and SAO use the same chroma samples produced by the deblocking filter as input and generate three offsets per chroma sample in parallel. Then these three offsets are added to the input chroma sample to obtain a sum, which is then clipped to form the final output chroma sample value. The proposed BIF-chroma provides an on / off control mechanism on the CTU level and slice level.
[0027] The filtering process of BIF-chroma is similar to that of BIF-luma. For a chroma sample, a 5×5 diamond shape filter is used for generating the filtering offset. The difference between the central sample and each surrounding sample is calculated first. The coefficient for each reference sample is extracted from a pre-defined look-up-table based on the calculated difference directly. The coefficients used for chroma components are retrained, different from those from BIF-luma. In the BIF-luma design, the block-level filtering strength parameter c is determined based on luma TU size and CU mode. While in the BIF-chroma design, the parameter for chroma components is determined based on the chroma TU size and mode when dual-tree partitioning is enabled for the current slice and based on the corresponding luma TU size and mode when dual-tree partitioning is disabled.
[0028] Dynamic Scaling of Bilateral Filter (JVET-AE0044)
[0029] In the proposed solution, the base LUT size is preserved, but the content of the base LUT is changed and the calculation of is also changed. The proposed method uses three scale factors (C1, 0, C1, 1 and C2, 0) to pre-compute three LUTs for three different neighbor distances i.e. : LUTi, j, ROW [k] =(Ci, j·LUTROW [k] +4)>>3, (for each qpb) and the averaging linear interpolation for the half of the values of the cut off least significant bits, i.e. : where v1 and v2 are successive entries of LUTi, j, ROW [sIR] . For chroma, the number of cut off bits is decreased from 3 to 2.
[0030] In the proposed method, the number of cut off bits in Equation 8 is increased from 5 to 8 and where is based on the TU’s shape sizes and is based on the mean absolute difference (MAD) of the TU. Both and are calculated using LUTs. More precisely, let LUTw, h be a 2D 8×8 lookup table with non-negative 8-bit integer values, and let LUTMAD be a 1D 16-entry lookup table with non-negative 8-bit integer values, then these scale factors are defined as follows:
[0031] The MAD of a (h×w) -size TU with the channel samples denoted by si, j is defined as follows:
[0032] In total, four 64-byte tables LUTw, h and four 16-byte tables LUTMAD are introduced (for luma / chroma component, for intra / inter prediction) .
[0033] Note that CTU is a constant for all samples of the same channel inside one TU.
[0034] Variance-Based Classification for In-Loop Filtering (JVET-AE0131)
[0035] In this contribution, a variance-based classification for BIF and ALF is proposed.
[0036] For BIF, the variance of a TU is utilized to identify the texture strength. More filter strengths are introduced into BIF. The filtering strength is determined by the variance.
[0037] For ALF, each classification unit is classified into 2 levels of texture strength based on variance and boundary position jointly. Then the texture strength levels are further combined with the existing classifiers to output the final classification results
[0038] In the present invention, methods and apparatus for slice level indication of bilateral filter options to control bilateral filter process are disclosed to improve the performance. BRIEF SUMMARY OF THE INVENTION
[0039] A method and apparatus for video coding are disclosed. According to the method, input data for a current block is received, wherein the input data comprises reconstructed samples of the current block. One or more bilateral filter options are determined in a slice level, wherein said one or more bilateral filter options are determined by a syntax or implicitly decided according to coding information of coding unit (CU) or transform unit (TU) , and wherein the coding information of CU or TU includes a transform block (TB) size, a quantization parameter (QP) , a width / height aspect ratio, a neighbouring mode, at least one of variance, mean value and gradient magnitude from a predictor of the TB, or a combination thereof. Bilateral filtering is applied to the input data according to said one or more bilateral filter options to derive a set of bilateral filter offsets, wherein the input data satisfies a predefined combination of prediction mode and CBF (Coded Block Flag) value. A target reconstructed sample is adjusted using one or more offsets including the set of bilateral filter offsets.
[0040] In one embodiment, the syntax indicating said one or more bilateral filter options is signalled or parsed in the slice level.
[0041] In one embodiment, the combination of the prediction mode and the CBF value corresponds to a combination of inter mode and the CBF value equal to 0 indicating no residual data in a residual block.
[0042] In one embodiment, said one or more bilateral filter options comprise QP (Quantization Parameter) offset, filter strength, filter strength adjustment, or a combination thereof. In one embodiment, the QP offset or the filter strength is predefined implicitly according to coding information of CU (Coding Unit) or TU (Transform Unit) . In one embodiment, the QP offset or the coding information of CU or TU comprises TB (Transform Block) size, QP, width / height aspect ratio, neighbouring modes, or a combination thereof.
[0043] In one embodiment, the QP offset or the filter strength is predefined implicitly according to one or more predictor features of the current block. In one embodiment, said one or more predictor features of a current TB comprise variance, mean value, or gradient magnitude.
[0044] In one embodiment, said one or more bilateral filter options comprise a mode of adjustment to a value of filter strength according to TB shape sizes and / or mean absolute difference of the TB.
[0045] In one embodiment, sample-based classification is used to select the reconstructed samples to be filtered by the bilateral filtering. In one embodiment, the sample-based classification calculates a first parameter corresponding to a sum of or a mean of absolute differences between a target sample and neighbouring samples of the target sample, and then compares the first parameter with a predefined first threshold. In one embodiment, the sample-based classification further calculates second parameters corresponding to horizontal, vertical, and diagonal edge strengths for the target sample, and combines the second parameters with the first parameter, and wherein each edge strength is determined by combining gradient values of neighbouring samples of the target sample.
[0046] In one embodiment, said one or more bilateral filter options are signalled or parsed at the slice level to indicate a mode utilizing the sample-based classification to select the reconstructed samples to be filtered by the bilateral filtering with predefined filter strength under a predefined combination of the prediction mode and the CBF value.
[0047] In one embodiment, said one or more bilateral filter options are signalled or parsed at the slice level to indicate an adjustment to filter strength of the bilateral filtering to be applied to selected samples by the sample-based classification under the predefined combination of prediction mode and CBF value.
[0048] In one embodiment, adjustment to filter strength of the bilateral filtering to be applied to selected samples by the sample-based classification under the predefined combination of prediction mode and CBF value is predefined. In one embodiment, the sample-based classification is based on one or more coding parameters comprising boundary strength (BS) in deblocking filter operation, residual data magnitude, sample position in a coding unit, predictor variance, or a combination thereof. In one embodiment, the sample-based classification compares values of said one or more coding parameters with one or more predefined thresholds to classify to-be-filtered samples.
[0049] In one embodiment, said one or more bilateral filter options are signalled or parsed to indicate adjustment to filter strength of the bilateral filtering to be applied to selected samples by the sample-based classification under the predefined combination of prediction mode and CBF value.
[0050] In one embodiment, a Gaussian filter is applied to the set of bilateral filter offsets to smooth changes of the set of bilateral filter offsets between to-be-filtered samples.
[0051] In one embodiment, an SAO (Sample Adaptive Offset) process is applied to the input data to derive a set of SAO values, wherein the SAO process and the bilateral filtering are applied to the input data in parallel. In one embodiment, a Gaussian filter is applied to the set of SAO values to smooth changes of the set of SAO values between to-be-filtered samples.BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Fig. 1A illustrates an exemplary adaptive Inter / Intra video coding system incorporating loop processing.
[0053] Fig. 1B illustrates a corresponding decoder for the encoder in Fig. 1A.
[0054] Fig. 2 illustrates an example of bilateral filter implemented in parallel with the sample adaptive offset (SAO) loop-filter stage.
[0055] Fig. 3 illustrates an example of naming convention for samples surrounding the centre sample, IC.
[0056] Fig. 4 illustrates an example of chroma bilateral filter implemented in parallel with SAO and CCSAO.
[0057] Fig. 5 illustrates an example of Gaussian filter for smoothing filter offsets.
[0058] Fig. 6 illustrates a flowchart of an exemplary video coding system that uses slice level indication of bilateral filter options to control bilateral filter process according to an embodiment of the present invention.DETAILED DESCRIPTION OF THE INVENTION
[0059] It will be readily understood that the components of the present invention, as generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following more detailed description of the embodiments of the systems and methods of the present invention, as represented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. References throughout this specification to “one embodiment, ” “an embodiment, ” or similar language mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present invention. Thus, appearances of the phrases “in one embodiment” or “in an embodiment” in various places throughout this specification are not necessarily all referring to the same embodiment.
[0060] Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. One skilled in the relevant art will recognize, however, that the invention can be practiced without one or more of the specific details, or with other methods, components, etc. In other instances, well-known structures, or operations are not shown or described in detail to avoid obscuring aspects of the invention. The illustrated embodiments of the invention will be best understood by reference to the drawings, wherein like parts are designated by like numerals throughout. The following description is intended only by way of example, and simply illustrates certain selected embodiments of apparatus and methods that are consistent with the invention as claimed herein.
[0061] Improvement of BIF
[0062] In one embodiment, a bilateral_filter_option is signalled at the slice level to indicate the mode of QP offset or / and filter strength adjustment that apply to a predefined combination of prediction mode and CBF value. In the previous methods, qp_offset and bilateral_filter_strength are signalled in the PPS and applied across the entire sequence. Signalling bilateral_filter_option at the slice level allows adjustment to the slice.
[0063] Example 1: The bilateral_filter_option represents the mode selected to reducing the BIF filter strength for the TU coded in the inter mode with CBF zero. In this scenario, if bilateral_filter_option is equal to 0, BIF is not applied to the TU coded in the inter mode with CBF zero as in the previous method. If bilateral_filter_option equals 1, the BIF is applied to the TU coded in the inter mode with CBF zero but with half strength. The bilateral_filter_option can be designed for the selection of smaller or larger filter strength settings. In another case, the corresponding filter strength can be predefined implicitly according to the coding information of CU or TU, such as TB size, QP, width / height aspect ratio, neighbouring modes, and / or some features from the predictor of current TB, such as variance, mean value, gradient magnitude, and so on.
[0064] Example 2: The bilateral_filter_option represents the mode selected to adjust the QP offset setting for the TU coded in the inter mode with CBF zero as bilateral_filter_qp_offset does in the previous method. In this scenario, if bilateral_filter_option is equal to 0, BIF is not applied to the TU coded in the inter mode with CBF zero as in the previous method. If bilateral_filter_option equals 1, BIF is applied to the TU coded in the inter mode with CBF zero and the QP offset is set to 2 for the selection of qpb for the LUT. The bilateral_filter_option can be designed for the selection of smaller or larger QP offset settings. In another case, the corresponding QP offset can be predefined implicitly according to the coding information of CU or TU, such as TB size, QP, width / height aspect ratio, neighbouring modes, and / or some features from the predictor of the current TB, such as variance, mean value, gradient magnitude, and so on.
[0065] In another embodiment, a bilateral_filter_option is signalled at the slice level to indicate the mode of the adjustment to CTU that should apply to a predefined combination of prediction mode and CBF value. Signalling bilateral_filter_option at the slice level allows adjustment to the slice.
[0066] Example 3: The bilateral_filter_option represents the mode selected for the offset adjustment of the CTU for the TU coded in the inter mode with CBF zero. In this scenario, if bilateral_filter_option is equal to 0, BIF is not applied to the TU coded in the inter mode with CBF zero as in the previous method and CTU is not modified. If bilateral_filter_option equals 1, CTU is decreased by 3 and minimum value of the decreased CTU should be greater or equal to zero for the TU coded in the inter mode with CBF zero. The bilateral_filter_option can be designed for the selection of smaller or larger CTU offset settings. In another case, the corresponding offset adjustment of the CTU can be predefined implicitly according to the coding information of CU or TU, such as TB size, QP, width / height aspect ratio, neighbouring modes, and / or some features from the predictor of the current TB, such as variance, mean value, gradient magnitude, and so on.
[0067] In another embodiment, a bilateral_filter_option is signalled at the slice level to indicate the mode that utilizes the sample-based classification to select samples that will be filtered by BIF with predefined filter strength under a predefined combination of prediction mode and CBF value. The sample-based classification calculates the sum or the mean of the absolute difference between the current sample and its neighbouring samples, and then compares it with a predefined threshold. The sample-based classification can also calculate the sample’s horizontal, vertical, and diagonal edge strength, and combine those values with the sum or mean of the absolute difference mentioned above to classify the sample. The edge strength is determined by the combination of the gradient value of the sample’s neighbouring samples.
[0068] Example 4: The bilateral_filter_option represents the mode selected to apply the BIF to the samples belonging to the chosen class derived according to the sample-based classification inside the TU coded in the inter mode with CBF zero. In this scenario, if bilateral_filter_option is equal to 0, BIF is not applied to the TU coded in the inter mode with CBF zero as in the previous method. The sample-based classification calculates the Sum of the Absolute Difference (SAD) between the sample and neighbouring samples that are 2-pixel away and then compares the SAD value with a predefined threshold. It also calculates the horizontal / vertical edge strength Ehv and diagonal edge strength Ed, and then compares them with predefined threshold values. The derivation of the edge strength is the same method as ALF utilized in the ECM software. In this scenario, if bilateral_filter_option is equal to 0, BIF is not applied to the TU coded in the inter mode with CBF zero as in the previous method. If bilateral_filter_option equals 1, then BIF is applied to the samples with SAD greater than 128 and the (Ehv × Ed) smaller than 32 inside the TU coded in the inter mode with CBF zero with filter strength CTU set to 3. The bilateral_filter_option can be designed for the selection of different combinations of the classifications and filter settings. In the above example, the values of thresholds or offset, such as128, 32, or 3 can be predefined implicitly according to the coding information of CU or TU, such as TB size, QP, width / height aspect ratio, neighbouring modes, and / or some features from the predictor of current TB, such as variance, mean value, gradient magnitude, and so on, or explicitly signalled in the bitstream.
[0069] In another embodiment, an Gaussian filter is applied to the filter offset like ΔIBIF and ΔISAO, to smooth the change of the filter offset values between samples.
[0070] Example 5: In example 4, there are samples with zero filter offset and samples with nonzero filter offset inside the TU after the classification and filtering process. The following type of Gaussian filter as shown in Fig. 5 can be applied to the filter offsets to smooth the change across the pixels.
[0071] Example 6: There may be samples with zero filter offset inside one TU and samples with nonzero filter offset in the adjacent TU in the previous method. The above type of Gaussian filter can be applied to the filter offsets of the TU boundary samples or entire TU samples to smooth the change across the pixels. In another case, Gaussian filter can be applied to the filter offsets to smooth the change across the pixels, when the current to-be-processed TB meets one constraint defined by the combination of prediction mode, CBF value, QP, TB size, CU size, or residual magnitudes.
[0072] In another embodiment, BIF with a predefined adjustment to the filter strength is applied to the selected samples derived according to the sample-based classification under a predefined combination of prediction mode and CBF value. The sample-based classification calculates the sum or the mean of the absolute difference between the current sample and its neighbouring samples, and then compares it with a predefined threshold. The sample-based classification can also calculate the sample’s horizontal, vertical, and diagonal edge strength, and combine those values with the sum or the mean of the absolute difference mentioned above to classify the sample. The edge strength is determined by the combination of the gradient value of the sample’s neighbouring samples.
[0073] Example 7: In the previous method, the samples inside the TU coded in the inter mode with CBF zero are not filtered by BIF. In this example, BIF with a predefined 1 / 4 scaled down to the filter strength is applied to those samples inside the TU coded in the inter mode with CBF zero, where the samples belong to the chosen class derived according to the sample-based classification. The example of the sample-based classification is mentioned in Example 4.
[0074] In another embodiment, a bilateral_filter_option is signalled at the slice level to indicate the adjustment to the filter strength of the BIF that is applied to the selected samples according to the sample-based classification under a predefined combination of prediction mode and CBF value. The sample-based classification calculates the sum or the mean of the absolute difference between the current sample and its neighbouring samples, and then compares it with a predefined threshold. The sample-based classification can also calculate the sample’s horizontal, vertical, and diagonal edge strength and combine those values with the sum or mean of the absolute difference mentioned above to classify the samples. The edge strength is determined by the combination of the gradient value of the sample’s neighbouring samples.
[0075] Example 8: The bilateral_filter_option represents the mode selected to apply the BIF to the samples belong to the chosen class derived according to the sample-based classification inside the TU coded in the inter mode with CBF zero. In this scenario, if bilateral_filter_option is equal to 0, BIF is not applied to the TU coded in the inter mode with CBF zero as in the previous method. If bilateral_filter_option equals 1, BIF with 1 / 4 scaled down to the filter strength is applied to those samples that belong to the chosen class derived according to the sample-based classification. The example of the sample-based classification is mentioned in Example 4. The bilateral_filter_option can be designed for the selection of different combinations of the classifications and the adjustment to the filter strength of the BIF.
[0076] In another embodiment, BIF with a predefined adjustment to the filter strength is applied to the selected samples by the sample-based classification under a predefined combination of prediction mode and CBF value. The sample-based classification utilizes boundary strength (BS) in deblocking filter operation, residual data magnitude, sample position in the coding unit, predictor variance, or a combination of those values. The sample-based classification compares those values with a predefined threshold to classify the samples. The sample-based classification can also check if those values fall in a certain range.
[0077] Example 9: In the previous method, the samples inside the TU coded in the inter mode with CBF zero are not filtered by BIF. The sample-based classification checks the BS value of the sample. If BS > 0, BIF with a predefined 1 / 2 scaled down to the filter strength is applied to those samples inside the TU coded in the inter mode with CBF zero.
[0078] Example 10: In the previous method, the samples inside the TU coded in the inter mode with CBF zero are not filtered by BIF. The sample-based classification compares the predictor variance of the sample. If it is greater than 8, BIF with a predefined 1 / 4 scaled down to the filter strength is applied to those samples inside the TU coded in the inter mode with CBF zero.
[0079] Example 11: In the previous method, the samples inside the TU coded in the inter mode have the same filter strength. The sample-based classification checks the sample position in the coding unit. If the sample falls in the range of 2 pixels adjacent to the TU boundary, BIF with a predefined 1 / 2 scaled down to the filter strength is applied to those samples inside the TU.
[0080] Example 12: Combining Examples 9, 10 and 11. The filter strength of the BIF for the sample is set to the minimum setting of filter strength from the results of those sample-based classification.
[0081] In another embodiment, a bilateral_filter_option is signalled at the slice level to indicate the adjustment to the filter strength of the BIF that is applied to the selected samples by the sample-based classification under a predefined combination of prediction mode and CBF value. The sample-based classification utilizes boundary strength (BS) in deblocking filter operation, residual data magnitude, sample position in the coding unit, predictor variance, or a combination of those values. The sample-based classification compares those values with a predefined threshold to classify the samples. The sample-based classification can also check if those values fall in a certain range.
[0082] Example 13. The bilateral_filter_option represents the mode selected to apply the BIF to the samples belong to the chosen class. In this scenario, if bilateral_filter_option is equal to 0, filter strength is the same as in the previous method. If bilateral_filter_option equals 1, BIF with modified filter strength is applied as illustrated in Example 9, 10, 11 or 12. The bilateral_filter_option can be designed for the selection of different combinations of the classifications and the adjustment to the filter strength of the BIF.
[0083] The foregoing proposed methods of indication bilateral filter options in a slice level can be implemented in encoders and / or decoders. For example, the proposed method can be implemented in an in-loop filtering module of an encoder, and / or an in-loop filtering module of a decoder. With reference to the exemplary encoder and decoder in Fig. 1A and Fig. 1B, any of the proposed methods can be implemented in ILPF 130. Any of the proposed methods can also be implemented as a circuit coupled to In-Loop Filter module at the decoder or the encoder. However, the decoder or encoder may also use additional processing unit to implement the required processing for the proposed methods. While the In-Loop Filter modules are shown as individual processing units, they may correspond to executable software or firmware codes stored on a media, such as hard disk or flash memory, for a CPU (Central Processing Unit) or programmable devices (e.g. DSP (Digital Signal Processor) or FPGA (Field Programmable Gate Array) ) .
[0084] Fig. 6 illustrates a flowchart of an exemplary video coding system that uses slice level indication of bilateral filter options to control bilateral filter process according to an embodiment of the present invention. The steps shown in the flowchart may be implemented as program codes executable on one or more processors (e.g., one or more CPUs) at the encoder side. The steps shown in the flowchart may also be implemented based on hardware such as one or more electronic devices or processors arranged to perform the steps in the flowchart. According to the method, input data for a current block is received in step 610, wherein the input data comprises reconstructed samples of the current block. One or more bilateral filter options are determined in a slice level in step 620, wherein said one or more bilateral filter options are determined by a syntax or implicitly decided according to coding information of coding unit (CU) or transform unit (TU) , and wherein the coding information of CU or TU includes a transform block (TB) size, a quantization parameter (QP) , a width / height aspect ratio, a neighbouring mode, at least one of variance, mean value and gradient magnitude from a predictor of the TB, or a combination thereof. Bilateral filtering is applied to the input data according to said one or more bilateral filter options to derive a set of bilateral filter offsets in step 630, wherein the input data satisfies a predefined combination of prediction mode and CBF (Coded Block Flag) value. A target reconstructed sample is adjusted using one or more offsets including the set of bilateral filter offsets in step 640.
[0085] The flowchart shown is intended to illustrate an example of video coding according to the present invention. A person skilled in the art may modify each step, re-arranges the steps, split a step, or combine steps to practice the present invention without departing from the spirit of the present invention. In the disclosure, specific syntax and semantics have been used to illustrate examples to implement embodiments of the present invention. A skilled person may practice the present invention by substituting the syntax and semantics with equivalent syntax and semantics without departing from the spirit of the present invention.
[0086] The above description is presented to enable a person of ordinary skill in the art to practice the present invention as provided in the context of a particular application and its requirement. Various modifications to the described embodiments will be apparent to those with skill in the art, and the general principles defined herein may be applied to other embodiments. Therefore, the present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed. In the above detailed description, various specific details are illustrated in order to provide a thorough understanding of the present invention. Nevertheless, it will be understood by those skilled in the art that the present invention may be practiced.
[0087] Embodiment of the present invention as described above may be implemented in various hardware, software codes, or a combination of both. For example, an embodiment of the present invention can be one or more circuit circuits integrated into a video compression chip or program code integrated into video compression software to perform the processing described herein. An embodiment of the present invention may also be program code to be executed on a Digital Signal Processor (DSP) to perform the processing described herein. The invention may also involve a number of functions to be performed by a computer processor, a digital signal processor, a microprocessor, or field programmable gate array (FPGA) . These processors can be configured to perform particular tasks according to the invention, by executing machine-readable software code or firmware code that defines the particular methods embodied by the invention. The software code or firmware code may be developed in different programming languages and different formats or styles. The software code may also be compiled for different target platforms. However, different code formats, styles and languages of software codes and other means of configuring code to perform the tasks in accordance with the invention will not depart from the spirit and scope of the invention.
[0088] The invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described examples are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope.
Claims
1.A method for in-loop filtering of reconstructed video data, the method comprising:receiving input data for a current block, wherein the input data comprises reconstructed samples of the current block;determining one or more bilateral filter options in a slice level, wherein said one or more bilateral filter options are determined by a syntax or implicitly decided according to coding information of coding unit (CU) or transform unit (TU) , and wherein the coding information of CU or TU includes a transform block (TB) size, a quantization parameter (QP) , a width / height aspect ratio, a neighbouring mode, at least one of variance, mean value and gradient magnitude from a predictor of the TB, or a combination thereof;applying bilateral filtering to the input data according to said one or more bilateral filter options to derive a set of bilateral filter offsets, wherein the input data satisfies a predefined combination of prediction mode and CBF (Coded Block Flag) value; andadjusting a target reconstructed sample using one or more offsets including the set of bilateral filter offsets.2.The method of Claim 1, wherein the syntax indicating said one or more bilateral filter options is signalled or parsed in the slice level.3.The method of Claim 1, wherein the combination of the prediction mode and the CBF value corresponds to a combination of inter mode and the CBF value equal to 0 indicating no residual data in a residual block.4.The method of Claim 1, wherein said one or more bilateral filter options comprise QP (Quantization Parameter) offset, filter strength, filter strength adjustment, or a combination thereof.5.The method of Claim 4, wherein the QP offset or the filter strength is predefined implicitly according to coding information of CU (Coding Unit) or TU (Transform Unit) .6.The method of Claim 5, wherein the QP offset or the coding information of CU or TU comprises TB (Transform Block) size, QP, width / height aspect ratio, neighbouring modes, or a combination thereof.7.The method of Claim 4, wherein the QP offset or the filter strength is predefined implicitly according to one or more predictor features of the current block.8.The method of Claim 7, wherein said one or more predictor features of a current TB comprise variance, mean value, or gradient magnitude.9.The method of Claim 1, wherein said one or more bilateral filter options comprise a mode of adjustment to a value of filter strength according to TB shape sizes and / or mean absolute difference of the TB.10.The method of Claim 1, wherein sample-based classification is used to select the reconstructed samples to be filtered by the bilateral filtering.11.The method of Claim 10, wherein the sample-based classification calculates a first parameter corresponding to a sum of or a mean of absolute differences between a target sample and neighbouring samples of the target sample, and then compares the first parameter with a predefined first threshold.12.The method of Claim 11, wherein the sample-based classification further calculates second parameters corresponding to horizontal, vertical, and diagonal edge strengths for the target sample, and combines the second parameters with the first parameter, and wherein each edge strength is determined by combining gradient values of neighbouring samples of the target sample.13.The method of Claim 10, wherein said one or more bilateral filter options are signalled or parsed at the slice level to indicate a mode utilizing the sample-based classification to select the reconstructed samples to be filtered by the bilateral filtering with predefined filter strength under a predefined combination of the prediction mode and the CBF value.14.The method of Claim 10, wherein said one or more bilateral filter options are signalled or parsed at the slice level to indicate an adjustment to filter strength of the bilateral filtering to be applied to selected samples by the sample-based classification under the predefined combination of prediction mode and CBF value.15.The method of Claim 10, wherein adjustment to filter strength of the bilateral filtering to be applied to selected samples by the sample-based classification under the predefined combination of prediction mode and CBF value is predefined.16.The method of Claim 15, wherein the sample-based classification is based on one or more coding parameters comprising boundary strength (BS) in deblocking filter operation, residual data magnitude, sample position in a coding unit, predictor variance, or a combination thereof.17.The method of Claim 16, wherein the sample-based classification compares values of said one or more coding parameters with one or more predefined thresholds to classify to-be-filtered samples.18.The method of Claim 10, wherein said one or more bilateral filter options are signaled or parsed to indicate adjustment to filter strength of the bilateral filtering to be applied to selected samples by the sample-based classification under the predefined combination of prediction mode and CBF value.19.The method of Claim 1, wherein a Gaussian filter is applied to the set of bilateral filter offsets to smooth changes of the set of bilateral filter offsets between to-be-filtered samples.20.The method of Claim 1, wherein an SAO (Sample Adaptive Offset) process is applied to the input data to derive a set of SAO values, wherein the SAO process and the bilateral filtering are applied to the input data in parallel.21.The method of Claim 20, wherein a Gaussian filter is applied to the set of SAO values to smooth changes of the set of SAO values between to-be-filtered samples.22.An apparatus for video coding, the apparatus comprising one or more electronics or processors arranged to:receive input data for a current block, wherein the input data comprises reconstructed samples of the current block;determine one or more bilateral filter options in a slice level, wherein said one or more bilateral filter options are determined by a syntax or implicitly decided according to coding information of coding unit (CU) or transform unit (TU) , and wherein the coding information of the CU or TU includes a transform block (TB) size, a quantization parameter (QP) , a width / height aspect ratio, a neighbouring mode, at least one of variance, mean value and gradient magnitude from a predictor of the TB, or a combination thereof;apply bilateral filtering to the input data according to said one or more bilateral filter options to derive a set of bilateral filter offsets, wherein the input data satisfies a predefined combination of prediction mode and CBF (Coded Block Flag) value; andadjust a target reconstructed sample using one or more offsets including the set of bilateral filter offsets.