Apparatus, a method and a computer program for video coding and decoding
A method comprising: obtaining an image block unit comprising samples in color channels of one or two chrominance channels and one luminance channel ( 800 ); reconstructing samples of said luminance channels of the image block unit ( 802 ); predicting samples of at least one color channel of image block unit using a cross-component prediction model based on reconstructed samples on a reference channel, wherein parameters of the cross-component prediction model are determined at least partly based on a plurality of reconstructed chrominance samples and their corresponding reconstructed luminance samples in neighboring image block units ( 804 ); predicting a plurality of color channel samples in said neighboring image block units co-locating at least part of the reconstructed chrominance and luminance samples using said cross-component prediction model ( 806 ); determining a difference between values of the predicted plurality of color channel samples in said neighboring image block and corresponding reconstructed color channel samples ( 808 ); and adjusting the parameters of the cross-component prediction model based on said difference ( 810 ).
1 . An apparatus comprising:
at least one processor; and
at least one memory storing instructions that, when executed by the at least one processor, cause the apparatus at least to:
obtain an image block unit comprising samples in color channels of one or two chrominance channels and one luminance channel;
reconstruct samples of said one luminance channel of the image block unit;
predict the samples of at least one color channel of the image block unit using a cross-component prediction model based on reconstructed samples on a reference channel, wherein parameters of the cross-component prediction model are determined at least partly based on a plurality of reconstructed chrominance samples and the corresponding reconstructed luminance samples in neighboring image block units;
predict a plurality of color channel samples in said neighboring image block units co-locating at least part of the reconstructed chrominance and luminance samples using the cross-component prediction model;
determine a first difference between values of the predicted plurality of color channel samples in said neighboring image block units and corresponding reconstructed color channel samples;
adjust one or more of the parameters of the cross-component prediction model based on said first difference;
select a different set of reconstructed chrominance and luminance samples in said neighboring image block units;
predict a plurality of chrominance channel samples in said neighboring image block units co-locating at least partly to said reconstructed chrominance and luminance samples using said cross-component prediction model with the adjusted parameters; and
determine a second difference between values of the predicted different set of chrominance channel samples in said neighboring image block units and corresponding reconstructed chrominance channel samples.
2 . The apparatus according to claim 1 , wherein the reference channel is a luminance channel.
3 . The apparatus according to claim 2 , wherein the apparatus is further caused to:
in response to the second difference being larger than the first difference, select a further different set of reconstructed chrominance and luminance samples in said neighboring image block units and repeat previous steps; and
in response to the second difference being smaller than the first difference, use said cross-component prediction model with the adjusted parameters for predicting color samples of a current image block unit.
4 . The apparatus according to claim 3 , wherein the selection of a further different set of reconstructed chrominance and luminance samples in said neighboring image block units is configured to repeat previous steps until the second difference reaches a predetermined value; and
said cross-component prediction model with the adjusted parameters is configured to use parameters based on the second difference reaching the predetermined value.
5 . The apparatus according to claim 2 , wherein the apparatus is further caused to:
add a delta value to the sample values of at least one set of samples used in deriving the parameters; and
use said cross-component prediction model with the adjusted parameters added with the delta value providing a sufficiently small second difference.
6 . The apparatus according to claim 2 , wherein the apparatus is further caused to:
add a delta value to the parameters of the cross-component prediction model; and
use said cross-component prediction model with the adjusted parameters added with the delta value providing a sufficiently small second difference.
7 . The apparatus according to claim 1 , wherein the reference channel is a chrominance channel.
8 . The apparatus according to claim 7 , wherein the apparatus is further caused to:
calculate inverted parameters of the cross-component prediction model, wherein an inverted cross-component prediction model uses samples from at least one chrominance channel for predicting samples of a luminance channel; and
predict a plurality of luminance channel samples in said image block unit using said inverted cross-component prediction model.
9 . The apparatus according to claim 1 , wherein the apparatus is further caused to:
multiply the set of samples used in deriving the parameters by an integer number or a fractional number.
10 . The apparatus according to claim 1 , wherein the apparatus is further caused to:
use one or more cross-component models for predicting the samples of the image block unit.
11 . The apparatus according to claim 10 , wherein the cross-component prediction model comprises a linear function.
12 . The apparatus according to claim 10 , wherein the cross-component prediction model comprises a polynomial function.
13 . The apparatus according to claim 12 , wherein the cross-component prediction model comprises one or more additional data-dependent terms.
14 . The apparatus according to claim 10 , wherein the parameters of the cross-component prediction model are configured to be derived according to at least one of the following:
co-located luminance blocks or co-located chrominance blocks, in one or more reference frames when coding a chrominance block in inter frame.
15 . A method comprising:
obtaining an image block unit comprising samples in color channels of one or two chrominance channels and one luminance channel;
reconstructing samples of said one luminance channel of the image block unit;
predicting the samples of at least one color channel of image block unit using a cross-component prediction model based on reconstructed samples on a reference channel, wherein parameters of the cross-component prediction model are determined at least partly based on a plurality of reconstructed chrominance samples and the corresponding reconstructed luminance samples in neighboring image block units;
predicting a plurality of color channel samples in said neighboring image block units co-locating at least part of the reconstructed chrominance and luminance samples using said cross-component prediction model;
determining a first difference between values of the predicted plurality of color channel samples in said neighboring image block units and corresponding reconstructed color channel samples;
adjusting the parameters of the cross-component prediction model based on said difference;
selecting a different set of reconstructed chrominance and luminance samples in said neighboring image block units;
predicting a plurality of chrominance channel samples in said neighboring image block units co-locating at least partly to said reconstructed chrominance and luminance samples using said cross-component prediction model with the adjusted parameters; and
determining a second difference between values of the predicted different set of chrominance channel samples in said neighboring image block units and corresponding reconstructed chrominance channel samples.
16 . The method according to claim 15 , wherein the reference channel is a luminance channel.
17 . The method according to claim 16 further comprising:
in response to the second difference being larger than the first difference, selecting a further different set of reconstructed chrominance and luminance samples in said neighboring image block units and repeat previous steps; and
in response to the second difference being smaller than the first difference, using said cross-component prediction model with the adjusted parameters for predicting color samples of a current image block unit.
18 . The method according to claim 17 further comprising:
configuring the selection of a further different set of reconstructed chrominance and luminance samples in said neighboring image block units to repeat previous steps until the second difference reaches a predetermined value; and
configuring said cross-component prediction model with the adjusted parameters to use parameters based on the second difference reaching the predetermined value.
19 . The method according to claim 15 , wherein the reference channel is a chrominance channel.
20 . A non-transitory computer readable medium computer program comprising program instructions which when executed by an apparatus, cause the apparatus at least to:
obtain an image block unit comprising samples in color channels of one or two chrominance channels and one luminance channel;
reconstruct samples of said one luminance channel of the image block unit;
predict the samples of at least one color channel of image block unit using a cross-component prediction model based on reconstructed samples on a reference channel, wherein parameters of the cross-component prediction model are determined at least partly based on a plurality of reconstructed chrominance samples and the corresponding reconstructed luminance samples in neighboring image block units;
predict a plurality of color channel samples in said neighboring image block units co-locating at least part of the reconstructed chrominance and luminance samples using said cross-component prediction model;
determine a first difference between values of the predicted plurality of color channel samples in said neighboring image block units and corresponding reconstructed color channel samples; and
adjust one or more of the parameters of the cross-component prediction model based on said first difference;
select a different set of reconstructed chrominance and luminance samples in said neighboring image block units;
predict a plurality of chrominance channel samples in said neighboring image block units co-locating at least partly to said reconstructed chrominance and luminance samples using said cross-component prediction model with the adjusted parameters; and
determine a second difference between values of the predicted different set of chrominance channel samples in said neighboring image block units and corresponding reconstructed chrominance channel samples.