Local blur and illumination compensation
A method of video decoding includes calculating filter coefficients of a filter operation based on neighboring reconstructed samples of a current block and neighboring reconstructed samples of a reference block for the current block. A positional relationship of the neighboring reconstructed samples of the current block to the current block is the same as a positional relationship of the neighboring reconstructed samples of the reference block to the reference block. The method includes applying the filter operation with the filter coefficients to plural reference samples of the reference block to generate a corresponding filtered reference sample of the respective reference sample, determining a predicted sample for a sample of the current block based on the filtered reference sample and an offset, and reconstructing the current block based on the predicted sample.
1 . A method of video decoding, the method comprising:
decoding prediction information of a current block that is a part of a current picture in a video bitstream, the prediction information indicating a reference block for the current block;
calculating filter coefficients of a filter operation based on neighboring reconstructed samples of the current block and neighboring reconstructed samples of the reference block, a positional relationship of the neighboring reconstructed samples of the current block to the current block being the same as a positional relationship of the neighboring reconstructed samples of the reference block to the reference block;
applying the filter operation with the filter coefficients to plural reference samples of the reference block by multiplying each reference sample and neighboring samples of the reference sample with a respective calculated filter coefficient of the filter operation and summing the multiplied reference sample with the multiplied neighboring samples to generate a corresponding filtered reference sample of the respective reference sample;
determining a predicted sample for a sample of the current block based on the filtered reference sample and an offset; and
reconstructing the current block based on the predicted sample.
2 . The method of claim 1 , wherein
the neighboring reconstructed samples of the current block include one or more rows of neighboring reconstructed samples above the current block and the neighboring reconstructed samples of the reference block include one or more rows of neighboring reconstructed samples above the reference block when the one or more rows of the neighboring reconstructed samples above the current block and the one or more rows of the neighboring reconstructed samples above the reference block are available.
3 . The method of claim 1 , wherein
the neighboring reconstructed samples of the current block include one or more columns of neighboring reconstructed samples left of the current block and the neighboring reconstructed samples of the reference block include one or more columns of neighboring reconstructed samples left of the reference block when the one or more columns of the neighboring reconstructed samples left of the current block and the one or more columns of the neighboring reconstructed samples left of the reference block are available.
4 . The method of claim 1 , wherein the filter operation includes one of a one-dimensional (1D) finite impulse response (FIR) filter or a two-dimensional (2D) FIR filter.
5 . The method of claim 4 , wherein the 1D FIR filter or the 2D FIR filter is symmetric.
6 . The method of claim 1 , wherein each of the filter coefficients is a ratio of two integers.
7 . The method of claim 6 , wherein a denominator of each ratio is a power of two.
8 . The method of claim 1 , wherein the offset is a ratio of two integers.
9 . The method of claim 8 , wherein a denominator of each ratio is a power of two.
10 . The method of claim 1 , wherein
the neighboring reconstructed samples of the current block are included in a first above template that includes one or more rows of neighboring reconstructed samples above the current block and the neighboring reconstructed samples of the reference block are included in a second above template that includes one or more rows of neighboring reconstructed samples above the reference block;
the method further includes:
calculating second filter coefficients of a second filter operation based on a first left template including one or more columns of neighboring reconstructed samples left of the current block and a second left template including one or more columns of neighboring reconstructed samples left of the reference block; and
applying the second filter operation with the second filter coefficients to plural second reference samples of the reference block by multiplying each second reference sample and neighboring samples of the second reference sample with a respective calculated second filter coefficient of the second filter operation and summing the multiplied second reference sample with the multiplied neighboring samples to generate a corresponding second filtered reference sample; and
the determining the predicted sample includes:
determining a first predicted sample for the sample of the current block based on the filtered reference sample and the offset;
determining a second predicted sample for the sample of the current block based on the second filtered reference sample and a second offset; and
determining the predicted sample based on the first predicted sample and the second predicted sample.
11 . The method of claim 10 , wherein the predicted sample is determined based on the first predicted sample when (i) the first above template and the second above template are available and (ii) a width of the first above template and the second above template is greater than a pre-determined length.
12 . The method of claim 10 , the predicted sample is determined based on the second predicted sample when (i) the first left template and the second left template are available and (ii) a height of the first left template and the second left template is greater than a pre-determined length.
13 . The method of claim 10 , wherein the predicted sample is an average of the first predicted sample and the second predicted sample.
14 . The method of claim 1 , wherein
the neighboring reconstructed samples of the current block include one or more rows of neighboring reconstructed samples above the current block and the neighboring reconstructed samples of the reference block include one or more rows of neighboring reconstructed samples above the reference block.
15 . The method of claim 1 , wherein
the neighboring reconstructed samples of the current block include one or more columns of neighboring reconstructed samples left of the current block and the neighboring reconstructed samples of the reference block include one or more columns of neighboring reconstructed samples left of the reference block.
16 . A method of video encoding, the method comprising:
calculating filter coefficients of a filter operation based on neighboring reconstructed samples of a current block that is a part of a current picture and neighboring reconstructed samples of a reference block, a positional relationship of the neighboring reconstructed samples of the current block to the current block being the same as a positional relationship of the neighboring reconstructed samples of the reference block to the reference block;
applying the filter operation with the filter coefficients to plural reference samples of the reference block by multiplying each reference sample and neighboring samples of the reference sample with a respective calculated filter coefficient of the filter operation and summing the multiplied reference sample with the multiplied neighboring samples to generate a corresponding filtered reference sample of the respective reference sample;
determining a predicted sample for a sample of the current block based on the filtered reference sample and an offset; and
encoding the current block based on the predicted sample.
17 . The method of claim 16 , wherein the neighboring reconstructed samples of the current block include one or more rows of neighboring reconstructed samples above the current block and the neighboring reconstructed samples of the reference block include one or more rows of neighboring reconstructed samples above the reference block when the one or more rows of the neighboring reconstructed samples above the current block and the one or more rows of the neighboring reconstructed samples above the reference block are available.
18 . The method of claim 16 , wherein the neighboring reconstructed samples of the current block include one or more columns of neighboring reconstructed samples left of the current block and the neighboring reconstructed samples of the reference block include one or more columns of neighboring reconstructed samples left of the reference block when the one or more columns of the neighboring reconstructed samples left of the current block and the one or more columns of the neighboring reconstructed samples left of the reference block are available.
19 . The method of claim 16 , wherein the filter operation includes one of a one-dimensional (1D) finite impulse response (FIR) filter or a two-dimensional (2D) FIR filter.
20 . A non-transitory computer-readable storage medium storing instructions which when executed by a processor cause the processor to perform a method of encoding a video bitstream comprising:
calculating filter coefficients of a filter operation based on neighboring reconstructed samples of a current block that is a part of a current picture and neighboring reconstructed samples of a reference block, a positional relationship of the neighboring reconstructed samples of the current block to the current block being the same as a positional relationship of the neighboring reconstructed samples of the reference block to the reference block;
applying the filter operation with the filter coefficients to plural reference samples of the reference block by multiplying each reference sample and neighboring samples of the reference sample with a respective calculated filter coefficient of the filter operation and summing the multiplied reference sample with the multiplied neighboring samples to generate a corresponding filtered reference sample of the respective reference sample;
determining a predicted sample for a sample of the current block based on the filtered reference sample and an offset;
encoding, in the video bitstream, the current block based on the predicted sample; and
transmitting the video bitstream.