The present application concerns the field of block-based prediction. Embodiments are related to an advantageous way for determining a prediction vector.
Today there exist different block-based intra and inter prediction modes. Samples neighboring a block to be predicted or samples obtained from other pictures can form a sample vector which can undergo a matrix multiplication to determine a prediction signal for the block to be predicted.
The matrix multiplication may be carried out in integer arithmetic and a matrix derived by some machine-learning based training algorithm should be used for the matrix multiplication.
However, such a training algorithm usually only results in a matrix that is given in floating point precision. Thus, one is faced with the problem to specify integer operations such that the matrix multiplication is well approximated using these integer operations and/or to achieve a computational efficiency improvement and/or render the prediction more effective in terms of implementation.
This is achieved by the subject matter of the independent claims of the present application.
According to an embodiment, an apparatus for predicting a predetermined block of a picture using a plurality of reference samples may be configured to: form a sample value vector out of the plurality of reference samples, derive from the sample value vector a further vector onto which the sample value vector is mapped by a predetermined invertible linear transform, compute a matrix-vector product between the further vector and a predetermined prediction matrix so as to acquire a prediction vector, and predict samples of the predetermined block on the basis of the prediction vector.
According to another embodiment, a method for predicting a predetermined block of a picture using a plurality of reference samples may have the steps of: forming a sample value vector out of the plurality of reference samples, deriving from the sample value vector a further vector onto which the sample value vector is mapped by a predetermined invertible linear transform, computing a matrix-vector product between the further vector and a predetermined prediction matrix so as to acquire a prediction vector, and predicting samples of the predetermined block on the basis of the prediction vector.
Another embodiment may have a non-transitory digital storage medium having a computer program stored thereon to perform the method for predicting a predetermined block of a picture using a plurality of reference samples, the method having the steps of: forming a sample value vector out of the plurality of reference samples, deriving from the sample value vector a further vector onto which the sample value vector is mapped by a predetermined invertible linear transform, computing a matrix-vector product between the further vector and a predetermined prediction matrix so as to acquire a prediction vector, and predicting samples of the predetermined block on the basis of the prediction vector, when said computer program is run by a computer.
In accordance with a first aspect of the present invention, the inventors of the present application realized that one problem encountered when trying to determine a prediction vector by an encoder or decoder, is the possible lack of using integer arithmetic for calculating a prediction vector for a predetermined block. According to the first aspect of the present application, this difficulty is overcome by deriving from the sample value vector a further vector onto which the sample value vector is mapped by a predetermined invertible linear transform so that the sample value vector is not directly applied in a matrix-vector product calculating the prediction vector. Instead the matrix-vector product is computed between the further vector and a predetermined prediction matrix to calculate the prediction vector. The further vector is, for example, derived such that samples of the predetermined block can be predicted by the apparatus using integer arithmetic operations and/or fixed point arithmetic operations. This is based on the idea, that components of the sample value vector are correlated, whereby an advantageous predetermined invertible linear transform can be used, for example, to obtain the further vector with mainly small entries which enables the usage of an integer matrix and/or a matrix with fixed point values and/or a matrix with small expected quantization errors as the predetermined prediction matrix.
Accordingly, in accordance with a first aspect of the present application, an apparatus for predicting a predetermined block of a picture using a plurality of reference samples, is configured to form a sample value vector out of the plurality of reference samples. The reference samples are, for example, samples neighboring the predetermined block at intra prediction or samples in another picture at inter prediction. According to an embodiment, the reference samples can be reduced, for example, by averaging to obtain a sample value vector with a reduced number of values. Furthermore, the apparatus is configured to derive from the sample value vector a further vector onto which the sample value vector is mapped by a predetermined invertible linear transform, compute a matrix-vector product between the further vector and a predetermined prediction matrix so as to obtain a prediction vector, and predict samples of the predetermined block on the basis of the prediction vector. Based on the further vector, the prediction of samples of the predetermined block can represent an integer approximation of a direct matrix-vector-product between the sample value vector and a matrix to obtain predicted samples of the predetermined block.
The direct matrix-vector-product between the sample value vector and the matrix can equal a second matrix-vector-product between the further vector and a second matrix. The second matrix and/or the matrix are, for example, machine learning prediction matrices. According to an embodiment, the second matrix can be based on the predetermined prediction matrix and an integer matrix. The second matrix equals, for example, a sum of the predetermined prediction matrix and an integer matrix. In other words, the second matrix-vector-product between the further vector and the second matrix can be represented by the matrix-vector product between the further vector and the predetermined prediction matrix and a further matrix-vector product between the integer matrix and the further vector. The integer matrix is, for example, a matrix with a predetermined column i0 consisting of ones and with columns i≠i0 being zero. Thus a good integer approximation and/or a good fixed-point value approximation of the first- and/or the second-matrix-vector-product can be achieved by the apparatus. This is based on the idea, that the predetermined prediction matrix can be quantized or is already a quantized matrix, since the further vector comprises mainly small values resulting in a marginal impact of possible quantization errors in the approximation of the first- and/or second-matrix-vector-product.
According to an embodiment, the invertible linear transform times a sum of the predetermined prediction vector and an integer matrix can correspond to a quantized version of a machine learning prediction matrix. The integer matrix is, for example, a matrix with a predetermined column i0 consisting of ones and with columns i≠i0 being zero.
According to an embodiment the invertible linear transform is defined such that a predetermined component of the further vector becomes a, and each of other components of the further vector, except the predetermined component, equal a corresponding component of the sample value vector minus a, wherein a is a predetermined value. Thus a further vector with small values can be realized enabling a quantization of the predetermined prediction matrix and resulting in a marginal impact of the quantization error in the predicted samples of the predetermined block. With this further vector it is possible to predict the samples of the predetermined block by integer arithmetic operations and/or fixed point arithmetic operations.
According to an embodiment, the predetermined value is one of an average, such as an arithmetic mean or weighted average, of components of the sample value vector, a default value, a value signalled in a data stream into which the picture is coded, and a component of the sample value vector corresponding to the predetermined component. The sample value vector is, for example, comprised by the plurality of reference samples or by averages of groups of reference samples out of the plurality of reference samples. A group of reference samples comprises, for example, at least two reference samples, advantageously adjacent reference samples.
The predetermined value is, for example, the arithmetic mean or weighted average, of some components (e.g., of at least two components) of the sample value vector or of all components of the sample value vector. This is based on the idea, that the components of the sample value vector are correlated, i.e. values of components may be similar and/or at least some of the components may have equal values, whereby components of the further vector not equal to the predetermined component of the further vector, i.e. components i for i≠i0, wherein i0 represents the predetermined component, probably have an absolute value smaller than the corresponding component of the sample value vector. Thus a further vector with small values can be realized.
The predetermined value can be a default value, wherein the default value is, for example, chosen from a list of default values or is the same for all block sizes, prediction modes and so on. The components of the list of default values can be associated with different block sizes, prediction modes, sample value vector sizes, averages of values of samples value vectors and so on. Thus, for example, depending on the predetermined block, i.e. depending on decoding or encoding settings associated with the predetermined block, an optimized default value is chosen from the list of default values by the apparatus.
Alternatively, the predetermined value can be a value signalled in a data stream into which the picture is coded. In this case, for example, an apparatus for encoding determines the predetermined value. The determination of the predetermined value can be based on the same considerations as described above in the context of the default value.
Components of the further vector not equal to the predetermined component of the further vector, i.e. components i for i≠i0, wherein i0 represents the predetermined component, have, for example, an absolute value smaller than the corresponding component of the sample value vector with the usage of the default value or the value signalled in the data stream as the predetermined value.
According to an embodiment, the predetermined value can be a component of the sample value vector corresponding to the predetermined component. In other words, the value of a component of the sample value vector corresponding to the predetermined component does not change by applying the invertible linear transform. Thus the value of a component of the sample value vector corresponding to the predetermined component equals, for example, the value of the predetermined component of the further vector.
The predetermined component is, for example, chosen by default, as e.g. described above with regard to the predetermined value as default value. It is clear, that the predetermined component can be chosen by an alternatively procedure. The predetermined component is, for example, chosen similar to the predetermined value. According to an embodiment, the predetermined component is chosen such that a value of a corresponding component of the sample value vector is equal to or has only a marginal deviation from an average of values of the sample value vector.
According to an embodiment, matrix components of the predetermined prediction matrix within a column of the predetermined prediction matrix which corresponds to the predetermined component of the further vector are all zero. The apparatus is configured to compute the matrix-vector product, i.e. the matrix-vector product between the further vector and the predetermined prediction matrix, by performing multiplications by computing a matrix vector product between a reduced prediction matrix resulting from the predetermined prediction matrix by leaving away the column, i.e. the column consisting of zeros, and an even further vector resulting from the further vector by leaving away the predetermined component. This is based on the idea, that the predetermined component of the further vector is set to the predetermined value and that this predetermined value is exactly or close to sample values in a prediction signal for the predetermined block, if the values of the sample value vector are correlated. Thus the prediction of the samples of the predetermined block is optionally based on the predetermined prediction matrix times the further vector or rather the reduced prediction matrix times the even further vector and an integer matrix, whose column i0, which column corresponds to the predetermined component, consists of ones and all of whose other columns i≠i0 are zero, times the further vector. In other words, a transformed machine learning prediction matrix, e.g., by an inverse transform of the predetermined invertible linear transform, can be split into the predetermined prediction matrix or rather the reduced prediction matrix and the integer matrix based on the further vector. Thus only the prediction matrix should be quantized to obtain an integer approximation of the machine learning prediction matrix and/or of the transformed machine learning prediction matrix, which is advantageous since the even further vector does not comprise the predetermined component and all other components have a much smaller absolute values than the corresponding component of the sample value vector enabling a marginal impact of the quantization error in the resulting quantization of the machine learning prediction matrix and/or of the transformed machine learning prediction matrix. Furthermore, with the reduced prediction matrix and the even further vector less multiplications have to be performed to obtain the prediction vector, reducing the complexity and resulting in a higher computing efficiency. Optionally, a vector with all components being the predetermined value a can be added to the prediction vector at the prediction of the samples of the predetermined block. This vector can be obtained, as described above, by the matrix-vector product between the integer matrix and the further matrix.
According to an embodiment, a matrix, which results from summing each matrix component of the predetermined prediction matrix within a column of the predetermined prediction matrix, which corresponds to the predetermined component of the further vector, with one, times the predetermined invertible linear transform corresponds to a quantized version of a machine learning prediction matrix. The summing of each matrix component of the predetermined prediction matrix within a column of the predetermined prediction matrix, which corresponds to the predetermined component of the further vector, with one, represents, for example, the transformed machine learning prediction matrix. The transformed machine learning prediction matrix represents, for example, a machine learning prediction matrix transformed by an inverse transform of the predetermined invertible linear transform. The summation can correspond to a summation of the predetermined prediction matrix with an integer matrix, whose column i0, which column corresponds to the predetermined component, consists of ones and all of whose other columns i≠i0 are zero.
According to an embodiment, the apparatus is configured to represent the predetermined prediction matrix using prediction parameters and to compute the matrix-vector product by performing multiplications and summations on the components of the further vector and the prediction parameters and intermediate results resulting therefrom. Absolute values of the prediction parameters are representable by an n-bit fixed point number representation with n being equal to or lower than 14, or, alternatively, 10, or, alternatively, 8. In other words, prediction parameters are multiplied and/or summed to elements of the matrix-vector product, like the further vector, the predetermined prediction matrix and/or the prediction vector. By the multiplication and summation operations a fixed point format, e.g. of the predetermined prediction matrix, of the prediction vector and/or of the predicted samples of the predetermined block can be obtained.
An embodiment according to the invention is related to an apparatus for encoding a picture comprising, an apparatus for predicting a predetermined block of the picture using a plurality of reference samples according to any of the herein described embodiments, to obtain a prediction signal. Furthermore, the apparatus comprises an entropy encoder configured to encode a prediction residual for the predetermined block for correcting the prediction signal. For the prediction of the predetermined block to obtain the prediction signal the apparatus is, for example, configured to form a sample value vector out of the plurality of reference samples, derive from the sample value vector a further vector onto which the sample value vector is mapped by a predetermined invertible linear transform, compute a matrix-vector product between the further vector and a predetermined prediction matrix so as to obtain a prediction vector, and predict samples of the predetermined block on the basis of the prediction vector.
An embodiment according to the invention is related to an apparatus for decoding a picture comprising, an apparatus for predicting a predetermined block of the picture using a plurality of reference samples according to any of the herein described embodiments, to obtain a prediction signal. Furthermore, the apparatus comprises an entropy decoder configured to decode a prediction residual for the predetermined block, and a prediction corrector configured to correct the prediction signal using the prediction residual. For the prediction of the predetermined block to obtain the prediction signal the apparatus is, for example, configured to form a sample value vector out of the plurality of reference samples, derive from the sample value vector a further vector onto which the sample value vector is mapped by a predetermined invertible linear transform, compute a matrix-vector product between the further vector and a predetermined prediction matrix so as to obtain a prediction vector, and predict samples of the predetermined block on the basis of the prediction vector.
An embodiment according to the invention is related to a method for predicting a predetermined block of a picture using a plurality of reference samples, comprising forming a sample value vector out of the plurality of reference samples, deriving from the sample value vector a further vector onto which the sample value vector is mapped by a predetermined invertible linear transform, computing a matrix-vector product between the further vector and a predetermined prediction matrix so as to obtain a prediction vector, and predicting samples of the predetermined block on the basis of the prediction vector.
An embodiment according to the invention is related to a method for encoding a picture comprising, predicting a predetermined block of the picture using a plurality of reference samples according to the above described method, to obtain a prediction signal, and entropy encoding a prediction residual for the predetermined block for correcting the prediction signal.
An embodiment according to the invention is related to a method for decoding a picture comprising, predicting a predetermined block of the picture using a plurality of reference samples according to one of the methods described above, to obtain a prediction signal, entropy decoding a prediction residual for the predetermined block, and correcting the prediction signal using the prediction residual.
An embodiment according to the invention is related to a data stream having a picture encoded thereinto using a herein described method for encoding a picture.
An embodiment according to the invention is related to a computer program having a program code for performing, when running on a computer, a method of any of the herein described embodiments.
Embodiments of the present invention will be detailed subsequently referring to the appended drawings, in which:
Equal or equivalent elements or elements with equal or equivalent functionality are denoted in the following description by equal or equivalent reference numerals even if occurring in different figures.
In the following description, a plurality of details is set forth to provide a more throughout explanation of embodiments of the present invention. However, it will be apparent to those skilled in the art that embodiments of the present invention may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form rather than in detail in order to avoid obscuring embodiments of the present invention. In addition, features of the different embodiments described herein after may be combined with each other, unless specifically noted otherwise.
In the following, different inventive examples, embodiments and aspects will be described. At least some of these examples, embodiments and aspects refer, inter alia, to methods and/or apparatus for video coding and/or for performing block-based Predictions e.g. using linear or affine transforms with neighboring sample reduction and/or for optimizing video delivery (e.g., broadcast, streaming, file playback, etc.), e.g., for video applications and/or for virtual reality applications.
Further, examples, embodiments and aspects may refer to High Efficiency Video Coding (HEVC) or successors. Also, further embodiments, examples and aspects will be defined by the enclosed claims.
It should be noted that any embodiments, examples and aspects as defined by the claims can be supplemented by any of the details (features and functionalities) described in the following chapters.
Also, the embodiments, examples and aspects described in the following chapters can be used individually, and can also be supplemented by any of the features in another chapter, or by any feature included in the claims.
Also, it should be noted that individual, examples, embodiments and aspects described herein can be used individually or in combination. Thus, details can be added to each of said individual aspects without adding details to another one of said examples, embodiments and aspects.
It should also be noted that the present disclosure describes, explicitly or implicitly, features of decoding and/or encoding system and/or method.
Moreover, features and functionalities disclosed herein relating to a method can also be used in an apparatus. Furthermore, any features and functionalities disclosed herein with respect to an apparatus can also be used in a corresponding method. In other words, the methods disclosed herein can be supplemented by any of the features and functionalities described with respect to the apparatuses.
Also, any of the features and functionalities described herein can be implemented in hardware or in software, or using a combination of hardware and software, as will be described in the section “implementation alternatives”.
Moreover, any of the features described in parentheses (“( . . . )” or “[ . . . ]”) may be considered as optional in some examples, embodiments, or aspects.
In the following, various examples are described which may assist in achieving a more effective compression when using block-based prediction. Some examples achieve high compression efficiency by spending a set of intra-prediction modes. The latter ones may be added to other intra-prediction modes heuristically designed, for instance, or may be provided exclusively. And even other examples make use of both of the just-discussed specialties. As a vibration of these embodiments it may be, however, that intra prediction is turned into an inter prediction by using reference samples in another picture instead.
In order to ease the understanding of the following examples of the present application, the description starts with a presentation of possible encoders and decoders fitting thereto into which the subsequently outlined examples of the present application could be built.
As mentioned, encoder 14 performs the encoding in a block-wise manner or block-base. To this, encoder 14 subdivides picture 10 into blocks, units of which encoder 14 encodes picture 10 into datastream 12. Examples of possible subdivisions of picture 10 into blocks 18 are set out in more detail below. Generally, the subdivision may end-up into blocks 18 of constant size such as an array of blocks arranged in rows and columns or into blocks 18 of different block sizes such as by use of a hierarchical multi-tree subdivisioning with starting the multi-tree subdivisioning from the whole picture area of picture 10 or from a pre-partitioning of picture 10 into an array of tree blocks wherein these examples shall not be treated as excluding other possible ways of subdivisioning picture 10 into blocks 18.
Further, encoder 14 is a predictive encoder configured to predictively encode picture 10 into datastream 12. For a certain block 18 this means that encoder 14 determines a prediction signal for block 18 and encodes the prediction residual, i.e. the prediction error at which the prediction signal deviates from the actual picture content within block 18, into datastream 12.
Encoder 14 may support different prediction modes so as to derive the prediction signal for a certain block 18. The prediction modes, which are of importance in the following examples, are intra-prediction modes according to which the inner of block 18 is predicted spatially from neighboring, already encoded samples of picture 10. The encoding of picture 10 into datastream 12 and, accordingly, the corresponding decoding procedure, may be based on a certain coding order 20 defined among blocks 18. For instance, the coding order 20 may traverse blocks 18 in a raster scan order such as row-wise from top to bottom with traversing each row from left to right, for instance. In case of hierarchical multi-tree based subdivisioning, raster scan ordering may be applied within each hierarchy level, wherein a depth-first traversal order may be applied, i.e. leaf nodes within a block of a certain hierarchy level may precede blocks of the same hierarchy level having the same parent block according to coding order 20. Depending on the coding order 20, neighboring, already encoded samples of a block 18 may be located usually at one or more sides of block 18. In case of the examples presented herein, for instance, neighboring, already encoded samples of a block 18 are located to the top of, and to the left of block 18.
Intra-prediction modes may not be the only ones supported by encoder 14. In case of encoder 14 being a video encoder, for instance, encoder 14 may also support inter-prediction modes according to which a block 18 is temporarily predicted from a previously encoded picture of video 16. Such an inter-prediction mode may be a motion-compensated prediction mode according to which a motion vector is signaled for such a block 18 indicating a relative spatial offset of the portion from which the prediction signal of block 18 is to be derived as a copy. Additionally, or alternatively, other non-intra-prediction modes may be available as well such as inter-prediction modes in case of encoder 14 being a multi-view encoder, or non-predictive modes according to which the inner of block 18 is coded as is, i.e. without any prediction.
Before starting with focusing the description of the present application onto intra-prediction modes, a more specific example for a possible block-based encoder, i.e. for a possible implementation of encoder 14, as described with respect to
As already mentioned above, encoder 14 operates block-based. For the subsequent description, the block bases of interest is the one subdividing picture 10 into blocks for which the intra-prediction mode is selected out of a set or plurality of intra-prediction modes supported by predictor 44 or encoder 14, respectively, and the selected intra-prediction mode performed individually. Other sorts of blocks into which picture 10 is subdivided may, however, exist as well. For instance, the above-mentioned decision whether picture 10 is inter-coded or intra-coded may be done at a granularity or in units of blocks deviating from blocks 18. For instance, the inter/intra mode decision may be performed at a level of coding blocks into which picture 10 is subdivided, and each coding block is subdivided into prediction blocks. Prediction blocks with encoding blocks for which it has been decided that intra-prediction is used, are each subdivided to an intra-prediction mode decision. To this, for each of these prediction blocks, it is decided as to which supported intra-prediction mode should be used for the respective prediction block. These prediction blocks will form blocks 18 which are of interest here. Prediction blocks within coding blocks associated with inter-prediction would be treated differently by predictor 44. They would be inter-predicted from reference pictures by determining a motion vector and copying the prediction signal for this block from a location in the reference picture pointed to by the motion vector. Another block subdivisioning pertains the subdivisioning into transform blocks at units of which the transformations by transformer 32 and inverse transformer 40 are performed. Transformed blocks may, for instance, be the result of further subdivisioning coding blocks. Naturally, the examples set out herein should not be treated as being limiting and other examples exist as well. For the sake of completeness only, it is noted that the subdivisioning into coding blocks may, for instance, use multi-tree subdivisioning, and prediction blocks and/or transform blocks may be obtained by further subdividing coding blocks using multi-tree subdivisioning, as well.
A decoder 54 or apparatus for block-wise decoding fitting to the encoder 14 of
Again, with respect to
Some non-limiting examples regarding ALWIP are herewith discussed, even if ALWIP may not be used to embody the techniques discussed here.
The present application is concerned, inter alia, with an improved block-based prediction mode concept for block-wise picture coding such as usable in a video codec such as HEVC or any successor of HEVC. The prediction mode may be an intra prediction mode, but theoretically the concepts described herein may be transferred onto inter prediction modes as well where the reference samples are part of another picture.
A block-based prediction concept allowing for an efficient implementation such as a hardware friendly implementation is sought.
This object is achieved by the subject-matter of the independent claims of the present application.
Intra-prediction modes are widely used in picture and video coding. In video coding, intra-prediction modes compete with other prediction modes such as inter-prediction modes such as motion-compensated prediction modes. In intra-prediction modes, a current block is predicted on the basis of neighboring samples, i.e. samples already encoded as far as the encoder side is concerned, and already decoded as far as the decoder side is concerned. Neighboring sample values are extrapolated into the current block so as to form a prediction signal for the current block with the prediction residual being transmitted in the datastream for the current block. The better the prediction signal is, the lower the prediction residual is and, accordingly, a lower number of bits may be used to code the prediction residual.
In order to be effective, several aspects should be taken into account in order to form an effective frame work for intra-prediction in a block-wise picture coding environment. For instance, the larger the number of intra-prediction modes supported by the codec, the larger the side information rate consumption is in order to signal the selection to the decoder. On the other hand, the set of supported intra-prediction modes should be able to provide a good prediction signal, i.e. a prediction signal resulting in a low prediction residual.
In the following, there is disclosed—as a comparison embodiment or basis example—an apparatus (encoder or decoder) for block-wise decoding a picture from a data stream, the apparatus supporting at least one intra-prediction mode according to which the intra-prediction signal for a block of a predetermined size of the picture is determined by applying a first template of samples which neighbours the current block onto an affine linear predictor which, in the sequel, shall be called Affine Linear Weighted Intra Predictor (ALWIP).
The apparatus may have at least one of the following properties (the same may apply to a method or to another technique, e.g. implemented in a non-transitory storage unit storing instructions which, when executed by a processor, cause the processor to implement the method and/or to operate as the apparatus):
The intra-prediction modes which might form the subject of the implementational improvements described further below may be complementary to other intra prediction modes of the codec. Thus, they may be complementary to the DC-, Planar-, or Angular-Prediction modes defined in the HEVC codec resp. the JEM reference software. The latter three types of intra-prediction modes shall be called conventional intra prediction modes from now on. Thus, for a given block in intra mode, a flag needs to be parsed by the decoder which indicates whether one of the intra-prediction modes supported by the apparatus is to be used or not.
3.2 More than One Proposed Prediction Modes
The apparatus may contain more than one ALWIP mode. Thus, in case that the decoder knows that one of the ALWIP modes supported by the apparatus is to be used, the decoder needs to parse additional information that indicates which of the ALWIP modes supported by the apparatus is to be used.
The signalization of the mode supported may have the property that the coding of some ALWIP modes may use less bins than other ALWIP modes. Which of these modes may use less bins and which modes may use more bins may either depend on information that can be extracted from the already decoded bitstream or may be fixed in advance.
As shown in
As shown in
In the art there are known several conventional modes, such as DC mode, planar mode and 65 directional prediction modes. There may be known, for example, 67 modes.
However, it has been noted that it is also possible to make use of different modes, which are here called linear or affine linear transformations. The linear or affine linear transformation comprises P·Q weighting factors, among which at least ¼ P·Q weighting factors are non-zero weighting values, which comprise, for each of the Q predicted values, a series of P weighting factors relating to the respective predicted value. The series, when being arranged one below the other according to a raster scan order among the samples of the predetermined block, form an envelope which is omnidirectionally non-linear.
It is possible to map the P positions of the neighboring values 17′a-17′c (template), the Q positions of the neighboring samples 17′a-17′c, and at the values of the P*Q weighting factors of the matrix 17M. A plane is an example of the envelope of the series for a DC transformation (which is a plane for the DC transformation). The envelope is evidently planar and therefore is excluded by the definition of the linear or affine linear transformation (ALWIP). Another example is a matrix resulting in an emulation of an angular mode: an envelope would be excluded from the ALWIP definition and would, frankly speaking, look like a hill leading obliquely from top to bottom along a direction in the P/Q plane. The planar mode and the 65 directional prediction modes would have different envelopes, which would however be linear in at least one direction, namely all directions for the exemplified DC, for example, and the hill direction for an angular mode, for example.
To the contrary, the envelope of the linear or affine transformation will not be omnidirectionally linear. It has been understood that such kind of transformation may be optimal, in some situations, for performing the prediction for the block 18. It has been noted that it is advantageous that at least ¼ of the weighting factors are different from zero (i.e., at least the 25% of the P*Q weighting factors are different from 0).
The weighting factors may be unrelated with each other according to any regular mapping rule. Hence, a matrix 17M may be such that the values of its entries have no apparent recognizable relationship. For example, the weighting factors cannot be described by any analytical or differential function.
In examples, an ALWIP transformation is such that a mean of maxima of cross correlations between a first series of weighting factors relating to the respective predicted value, and a second series of weighting factors relating to predicted values other than the respective predicted value, or a reversed version of the latter series, whatever leads to a higher maximum, may be lower than a predetermined threshold (e.g., 0.2 or 0.3 or 0.35 or 0.1, e.g., a threshold in a range between 0.05 and 0.035). For example, for each couple (i1,i2) of rows of the ALWIP matrix 17M, a cross correlation may be calculated by multiplying the P values of the i1th row with by the P values of the i2th row. For each obtained cross correlation, the maximum value may be obtained. Hence, a mean (average) may be obtained for the whole matrix 17M (i.e. the maxima of the cross correlations in all combinations are averaged). After that, the threshold may be e.g., 0.2 or 0.3 or 0.35 or 0.1, e.g., a threshold in a range between 0.05 and 0.035.
The P neighboring samples of blocks 17a-17c may be located along a one-dimensional path extending along a border (e.g., 18c, 18a) of the predetermined block 18. For each of the Q predicted values of the predetermined block 18, the series of P weighting factors relating to the respective predicted value may be ordered in a manner traversing the one-dimensional path in a predetermined direction (e.g., from left to right, from top to down, etc.).
In examples, the ALWIP matrix 17M may be non-diagonal or non-block diagonal.
An example of ALWIP matrix 17M for predicting a 4×4 block 18 from 4 already predicted neighboring samples may be:
(Here, {37, 59, 77, 28} is the first row; {32, 92, 85, 25} is the second row; and {61, 32, 54, 100} is the 16th row of the matrix 17M.) Matrix 17M has dimension 16×4 and includes 64 weighting factors (as a consequence of 16*4=64). This is because matrix 17M has dimension Q×P, where Q=M*N, which is the number of samples of the block 18 to be predicted (block 18 is a 4×4 block), and P is the number of samples of the already predicted samples. Here, M=4, N=4, 0=16 (as a consequence of M*N=4*4=16), P=4. The matrix is non-diagonal and non-block diagonal, and is not described by a particular rule.
As can be seen, less than ¼ of the weighting factors are 0 (in the case of the matrix shown above, one weighting factor out of sixty-four is zero). The envelope formed by these values, when arranged one below the other one according to a raster scan order, form an envelope which is omnidirectionally non-linear.
Even if the explanation above is mainly discussed with reference to a decoder (e.g., the decoder 54), the same may be performed at the encoder (e.g., encoder 14).
In some examples, for each block size (in the set of block sizes), the ALWIP transformations of intra-prediction modes within the second set of intra-prediction modes for the respective block size are mutually different. In addition, or alternatively, a cardinality of the second set of intra-prediction modes for the block sizes in the set of block sizes may coincide, but the associated linear or affine linear transformations of intra-prediction modes within the second set of intra-prediction modes for different block sizes may be non-transferable onto each other by scaling.
In some examples the ALWIP transformations may be defined in such a way that they have “nothing to share” with conventional transformations (e.g., the ALWIP transformations may have “nothing” to share with the corresponding conventional transformations, even though they have been mapped via one of the mappings above).
In examples, ALWIP modes are used for both luma components and chroma components, but in other examples ALWIP modes are used for luma components but are not used for chroma components.
Affine linear weighted intra prediction (ALWIP) modes tested in CE3-1.2.1 may be the same as proposed in JVET-L0199 under test CE3-2.2.2, except for the following changes:
Moreover, test CE3-1.2.1 includes the following encoder optimizations for ALWIP:
In Test CE3-1.2.1, excluding computations invoking the Discrete Cosine Transform, at most 12 multiplications per sample were needed to generate the prediction signals. Moreover, a total number of 136492 parameters, each in 16 bits, were involved. This corresponds to 0.273 Megabyte of memory.
Evaluation of the test was performed according to the common test conditions JVET-J1010 [2], for the intra-only (AI) and random-access (RA) configurations with the VTM software version 3.0.1. The corresponding simulations were conducted on an Intel Xeon cluster (E5-2697A v4, AVX2 on, turbo boost off) with Linux OS and GCC 7.2.1 compiler.
5.4 Affine Linear Weighted Intra Prediction with Complexity Reduction (e.g. Test CE3-1.2.2)
The technique tested in CE2 is related to “Affine Linear Intra Predictions” described in JVET-L0199 [1], but simplifies it in terms of memory requirements and computational complexity:
It is here discussed how to perform some predictions (e.g., as shown in
In principle, with reference to
These multiplications have extremely unwanted effects. The dimension P of the boundary vector 17P is in general dependent on the number M+N of boundary samples (bins or pixels) 17a, 17c neighboring (e.g. adjacent to) the M×N block 18 to be predicted. This means that, if the size of block 18 to be predicted is large, the number M+N of boundary pixels (17a, 17c) is accordingly large, hence increasing the dimension P=M+N of the P×1 boundary vector 17P, and the length of each row of the Q×P ALWIP prediction matrix 17M, and accordingly, also the numbers of multiplications that may be used (in general terms, Q=M*N=W*H, where W (Width) is another symbol for N and H (Height) is another symbol for M; P, in the case that the boundary vector is only formed by one row and/or one column of samples, is P=M+N=H+W).
This problem is, in general, exacerbated by the fact that in microprocessor-based systems (or other digital processing systems), multiplications are, in general, power-consuming operations. It may be imagined that a large number of multiplications carried for an extremely high number of samples for a large number of blocks causes a waste of computational power, which is in general unwanted.
Accordingly, it would be advantageous to reduce the number Q*P of multiplications that may be used for predicting the M×N block 18.
It has been understood that it is possible to somehow reduce the computational power that may be used for each intra-prediction of each block 18 to be predicted by intelligently choosing operations alternative to multiplications and which are easier to be processed.
In particular, with reference to
In some cases, the decoder or encoder may also derive, e.g. by interpolation, prediction values for further samples of the predetermined block on the basis of the predicted values for the predetermined samples and the plurality of neighboring samples. Accordingly, an upsampling strategy may be obtained.
In examples, it is possible to perform (e.g. at step 811) some averages on the samples of the boundary 17, so as to arrive at a reduced set 102 (
In some examples (e.g.
These techniques may be advantageous since, while the matrix multiplication involves a reduced number (Qred*Pred or Q*Pred) of multiplications, both the initial reducing (e.g., averaging or downsampling) and the final transformation (e.g. interpolation) may be performed by reducing (or even avoiding) multiplications. For example, downsampling, averaging and/or interpolating may be performed (e.g. at steps 811 and/or 813) by adopting non-computationally-power-demanding binary operations such as additions and shifting.
Also, the addition is an extremely easy operation which can be easily performed without much computational effort.
This shifting operation may be used, for example, for averaging two boundary samples and/or for interpolating two samples (support values) of the reduced predicted block (or taken from the boundary), to obtain the final predicted block. (For interpolation two sample values may be used. Within the block we have two predetermined values, but for interpolating the samples along the left and above border of the block we only have one predetermined value, as in
A two-step procedure may be used, such as:
Alternatively, it is possible to:
Even easier operations may be performed when downsampling (e.g., at step 811), as only one sample amount a group of samples (e.g., samples adjacent to each other) may be selected.
Hence, it is now possible to define technique(s) for reducing the number of multiplications to be performed. Some of these techniques may be based, inter alia, on at least one of the following principles:
According to an example illustrated in
Notwithstanding, it has been understood that, by using the present technique, it is possible to reduce, at step 811, the number of samples 17a and 17c neighboring the block 18 to be predicted from P to Pred<P. In particular, it has been understood that it is possible to average (e.g. at 100 in
It has been understood that it is possible to perform operations (such as the averaging or downsampling 100) without carrying out too many multiplications at the processor-level: the averaging or downsampling 100 performed at step 811 may be simply obtained by the straightforward and computationally-non-power-consuming operations such as additions and shifts.
It has been understood that, at this point, it is possible to subject the reduced set of sample values 102 to a linear or affine linear (ALWIP) transformation 19 (e.g., using a prediction matrix such as the matrix 17M of
In this case, the ALWIP matrix 17M has dimension Q×Pred=16×4: this follows the fact that all the Q=16 samples of the block 18 to be predicted are directly obtained by ALWIP multiplication (no interpolation needed).
Hence, at step 812a, a suitable ALWIP matrix 17M with dimension Q×Pred is selected. The selection may at least partially be based, for example, on signalling from the datastream 12. The selected ALWIP matrix 17M may also be indicated with Ak, where k may be understood as an index, which may be signalled in the datastream 12 (in some cases the matrix is also indicated as as Aidxm, see below). The selection may be performed according to the following scheme: for each dimension (e.g., pair of height/width of the block 18 to be predicted), an ALWIP matrix 17M is chosen among, for example, one of the three sets of matrixes S0, S1, S2 (each of the three sets S0, S1, S2 may group a plurality of ALWIP matrixes 17M of the same dimensions, and the ALWIP matrix to be chosen for the prediction will be one of them).
At step 812b, a multiplication between the selected Q×Pred ALWIP matrix 17M (also indicated as Ak) and the Pred×1 boundary vector 17P is performed.
At step 812c, an offset value (e.g., bk) may be added, e.g. to all the obtained values 104 of the vector 18Q obtained by ALWIP. The value of the offset (bk or in some cases also indicated with b1,2,3i, see below) may be associated to the particular selected ALWIP matrix (Ak), and may be based on an index (e.g., which may be signalled in the datastream 12).
Hence, a comparison between using the present technique and non-using the present technique is here resumed:
As can be understood, by relying on straightforward and computationally-non-power-demanding operations such as averaging (and, in case, additions and/or shifts and/or downsampling) it is possible to obtain an appropriate value at step 812.
With reference to
However, as can be seen in
In respect to method 810 of
By performing interpolations, at step 813 it is also possible to arrive at the final version of the M×N=8×8 block 18 based on multiple sample values indicated in 104.
Hence, a comparison between using the present technique and non-using it is:
Accordingly, the herewith presented technique is 8 times less power-demanding than the previous one.
However, it is possible, for example, to average or downsample at least the 8 samples of the horizontal row 17c, to obtain a reduced horizontal row with only 4 samples (e.g., averaged samples). In some examples, the vertical column 17a would remain as it is (e.g. without averaging). In total, the reduced boundary would have dimension Pred=8, with Pred<P. Accordingly, the boundary vector 17P will have dimension Pred×1=8×1. The ALWIP prediction matrix 17M will be a matrix with dimensions M*Nred*Pred=4*4*8=64. The 4×4 reduced block (formed by the grey columns in the schema 107), directly obtained at the subjecting step 812, will have size Qred=M*Nred=4*4=16 samples (instead of the Q=4*8=32 of the original 4×8 block 18 to be predicted). Once the reduced 4×4 block is obtained by ALWIP, it is possible to add an offset value bk (step 812c) and to perform interpolations at step 813. As can be seen at step 813 in
Hence, a comparison between using the present technique and non-using it is:
Hence, with the present technique, the computational effort is reduced to one third.
However, by applying the method 820, it is possible, at step 811, to reduce (e.g. by averaging or downsampling) the number of boundary samples, e.g., from 32 to 8: for example, for every group 120 of four consecutive samples of the row 17a, one single sample (e.g., selected among the four samples, or the average of the samples) remains. Also for every group of four consecutive samples of the column 17c, one single sample (e.g., selected among the four samples, or the average of the samples) remains.
Here, the ALWIP matrix 17M is a Qred×Pred=64×8 matrix: this comes from the fact that it has been chosen Pred=8 (by using 8 averaged or selected samples from the 32 ones of the boundary) and by the fact that the reduced block to be predicted at step 812 is an 8×8 block (in the scheme 109, the grey squares are 64).
Hence, once the 64 samples of the reduced 8×8 block are obtained at step 812, it is possible to derive, at step 813, the remaining Q−Qred=256-64=192 values 104 of the block 18 to be predicted.
In this case, in order to perform the interpolations, it has been chosen to use all the samples of the boundary column 17a and only alternate samples in the boundary row 17c. other choices may be made.
While with the present method the ratio between the number of multiplications and the number of finally obtained values is Qred*Pred/Q=8*64/256=2, which is much less than the 32 multiplications for each value without the present technique!
A comparison between using the present technique and non-using it is:
Accordingly, the computational power that may be used by the present technique is 16 times less than the traditional technique!
Therefore, it is possible to predict a predetermined block (18) of the picture using a plurality of neighboring samples (17) by
In particular, it is possible to perform the reducing (100, 813) by downsampling the plurality of neighboring samples to obtain the reduced set (102) of samples values lower, in number of samples, than compared to the plurality of neighboring samples (17).
Alternatively, it is possible to perform the reducing (100, 813) by averaging the plurality of neighboring samples to obtain the reduced set (102) of samples values lower, in number of samples, than compared to the plurality of neighboring samples (17).
Further, it is possible to derive (813), by interpolation, prediction values for further samples (108, 108′) of the predetermined block (18) on the basis of the predicted values for the predetermined samples (104, 118′, 118″) and the plurality of neighboring samples (17).
The plurality of neighboring samples (17a, 17c) may extend one-dimensionally along two sides (e.g. towards right and toward below in
Based on the plurality of neighboring samples (17), it is possible to determine for each of the at least one of the rows and the columns, a support value (118) for one (118) of the plurality of neighboring positions, which is aligned to the respective one of the at least one of the rows and the columns. It is also possible to derive, by interpolation, the prediction values 118 for the further samples (108, 108′) of the predetermined block (18) on the basis of the predicted values for the predetermined samples (104, 118′, 118″) and the support values for the neighboring samples (118) aligned to the at least one of rows and columns.
The predetermined samples (104) may be positioned at every nth position from the sample (112) which adjoins the two sides of the predetermined block 18 along the rows and the predetermined samples are positioned at every mth position from the sample (112) of the predetermined sample which (112) adjoins the two sides of the predetermined block (18) along the columns, wherein n, m>1. In some cases, n=m (e.g., in
Along at least one of the rows (17c) and columns (17a), it may be possible to perform the determining the support values e.g. by downsampling or averaging (122), for each support value, a group (120) of neighboring samples within the plurality of neighboring samples which includes the neighboring sample (118) for which the respective support value is determined. Hence, in
The plurality of neighboring samples may extend one-dimensionally along two sides of the predetermined block (18). It may be possible to perform the reduction (811) by grouping the plurality of neighboring samples (17) into groups (110) of one or more consecutive neighboring samples and performing a downsampling or an averaging on each of the group (110) of one or more neighboring samples which has two or more than two neighboring samples.
In examples, the linear or affine linear transformation may comprise Pred*Qred or Pred*Q weighting factors with Pred being the number of sample values (102) within the reduced set of sample values and Qred or Q is the number predetermined samples within the predetermined block (18). At least ¼Pred*Qred or ¼Pred*Q weighting factors are non-zero weighting values. The Pred*Qred or Pred*Q weighting factors may comprise, for each of the Q or Qred predetermined samples, a series of Pred weighting factors relating to the respective predetermined sample, wherein the series, when being arranged one below the other according to a raster scan order among the predetermined samples of the predetermined block (18), form an envelope which is omnidirectionally non-linear. The Pred*Q or Pred*Qred weighting factors may be unrelated to each other via any regular mapping rule. A mean of maxima of cross correlations between a first series of weighting factors relating to the respective predetermined sample, and a second series of weighting factors relating to predetermined samples other than the respective predetermined sample, or a reversed version of the latter series, whatever leads to a higher maximum, is lower than a predetermined threshold. The predetermined threshold may 0.3 [or in some cases 0.2 or 0.1]. The Pred neighboring samples (17) may be located along a one-dimensional path extending along two sides of the predetermined block (18) and, for each of the Q or Qred predetermined samples, the series of Pred weighting factors relating to the respective predetermined sample are ordered in a manner traversing the one-dimensional path in a predetermined direction.
For predicting the samples of a rectangular block of width W (also indicated with N) and height H (also indicated with M), Affine-linear weighted intra prediction (ALWIP) may take one line of H reconstructed neighboring boundary samples left of the block and one line of W reconstructed neighboring boundary samples above the block as input. If the reconstructed samples are unavailable, they may be generated as it is done in the conventional intra prediction.
A generation of the prediction signal (e.g., the values for the complete block 18) may be based on at least some of the following three steps:
Thanks to steps 1. (811) and/or 3. (813), the total number of multiplications needed in the computation of the matrix-vector product may be such that it is smaller or equal than 4*W*H. Moreover, the averaging operations on the boundary and the linear interpolation of the reduced prediction signal are carried out by solely using additions and bit-shifts. In other words, in examples at most four multiplications per sample are needed for the ALWIP modes.
In some examples, the matrices (e.g., 17M) and offset vectors (e.g., bk) needed to generate the prediction signal may be taken from sets (e.g., three sets), e.g., S0, S1, S2, of matrices which may be stored, for example, in storage unit(s) of the decoder and of the encoder.
In some examples, the set S0 may comprise (e.g., consist of) n0 (e.g., n0=16 or n0=18 or another number) matrices A0i, i∈{0, . . . , n0−1} each of which may have 16 rows and 4 columns and 18 offset vectors b0i, i∈{0, . . . , n0−1} each of size 16 to perform the technique according to
In some examples, the set S1 may comprise (e.g., consist of) n1 (e.g., n1=8 or n1=18 or another number) matrices A1i, i∈{0, . . . , n1−1}, each of which may have 16 rows and 8 columns and 18 offset vectors b1i, i∈{0, . . . , n1−1} each of size 16 to perform the technique according to
Additionally or alternatively, the set S2 may comprise (e.g., consists of) n2 (e.g., n2=6 or n2=18 or another number) matrices A2i, i∈{0, . . . , n2−1}, each of which may have 64 rows and 8 columns and of 18 offset vectors b2i, i∈{0, . . . , n2−1} of size 64. The 64×8 matrix refers to the reduced version of the block 18, which is an 8×8 block, e.g. as obtained in
Matrices and offset vectors of that set or parts of these matrices and offset vectors may be used for all other block-shapes.
Here, features are provided regarding step 811.
As explained above, the boundary samples (17a, 17c) may be averaged and/or downsampled (e.g., from P samples to Pred<P samples).
In a first step, the input boundaries bdrytop (e.g., 17c) and bdryleft (e.g., 17a) may be reduced to smaller boundaries bdryredtop and bdryredleft to arrive at the reduced set 102. Here, bdryredtop and bdryredleft both consists of 2 samples in the case of a 4×4-block and both consist of 4 samples in other cases.
In the case of a 4×4-block, it is possible to define
bdryredtop[0]=(bdrytop[0]+bdrytop[1]+1)>>1,
bdryredtop[1]=(bdrytop[2]+bdrytop[3]+1)>>1,
and define bdryredleft analogously. Accordingly, bdryredtop[0], bdryredtop[1], bdryredleft[0] bdryredleft[1] are average values obtained e.g. using bit-shifting operations
In all other cases (e.g., for blocks of wither width or height different from 4), if the block-width W is given as W=4*2k, for 0≤i<4 one defines
bdryredtop[i]=((Σj=0−1bdrytop[i*2k+j])+1<<(k−1))>>k.
and defines bdryredleft analogously.
In still other cases, it is possible to downsample the boundary (e.g., by selecting one particular boundary sample from a group of boundary samples) to arrive at a reduce number of samples. For example, bdryredtop[0] may be chosen among bdrytop[0] and bdrytop[1], and bdryredtop[1] may be chosen among bdrytop[2] and bdrytop[3]. It is also possible to define bdryredleft analogously.
The two reduced boundaries bdryredtop and bdryredleft may be concatenated to a reduced boundary vector bdryred (associated to the reduced set 102), also indicated with 17P. The reduced boundary vector bdryred may be thus of size four (Pred=4) for blocks of shape 4×4 (example of
Here, if mode<18 (or the number of matrixes in the set of matrixes), it is possible to define
bdryred=[bdryredtop,bdryredleft].
If mode≥18, which corresponds to the transposed mode of mode−17, it is possible to define
bdryred=[bdryredleft,bdryredtop].
Hence, according to a particular state (one state: mode<18; one other state: mode≥18) it is possible to distribute the predicted values of the output vector along a different scan order (e.g., one scan order: [bdryredtop, bdryredleft]; one other scan order: [bdryredleft, bdryredtop]).
Other strategies may be carried out. In other examples, the mode index ‘mode’ is not necessarily in the range 0 to 35 (other ranges may be defined). Further, it is not necessary that each of the three sets S0, S1, S2 has 18 matrices (hence, instead of expressions like mode≥18, it is possible to mode≥n0, n1, n2, which are the number of matrixes for each set of matrixes S0, S1, S2, respectively). Further, the sets may have different numbers of matrixes each (for example, it may be that S0 has 16 matrixes S1 has eight matrixes, and S2 has six matrixes).
The mode and transposed information are not necessarily stored and/or transmitted as one combined mode index ‘mode’: in some examples there is the possibility of signalling explicitly as a transposed flag and the matrix index (0-15 for S0, 0-7 for S1 and 0-5 for S2).
In some cases, the combination of the transposed flag and matrix index may be interpreted as a set index. For example, there may be one bit operating as transposed flag, and some bits indicating the matrix index, collectively indicated as “set index”.
Here, features are provided regarding step 812.
Out of the reduced input vector bdryred (boundary vector 17P) one may generate a reduced prediction signal predred. The latter signal may be a signal on the downsampled block of width Wred and height Hred. Here, Wred and Hred may be defined as:
W
red=4, Hred=4; if max(W,H)≤8,
W
red=min(W,8), Hred=min(H,8); else.
The reduced prediction signal predred may be computed by calculating a matrix vector-product and adding an offset:
predred=A·bdryred+b.
Here, A is a matrix (e.g., prediction matrix 17M) that may have Wred*Hred rows and 4 columns if W=H=4 and 8 columns in all other cases and b is a vector that may be of size Wred*Hred.
If W=H=4, then A may have 4 columns and 16 rows and thus 4 multiplications per sample may be needed in that case to compute predred. In all other cases, A may have 8 columns and one may verify that in these cases one has 8*Wred*Hred≤4*W*H, i.e. also in these cases, at most 4 multiplications per sample are needed to compute predred.
The matrix A and the vector b may be taken from one of the sets S0, S1, S2 as follows. One defines an index idx=idx(W, H) by setting idx(W, H)=0, if W=H=4, idx(W, H)=1, if max(W, H)=8 and idx(W, H)=2 in all other cases. Moreover, one may put m=mode, if mode<18 and m=mode−17, else. Then, if idx≤1 or idx=2 and min(W, H)>4, one may put A=Aidxm and b=bidxm. In the case that idx=2 and min(W, H)=4, one lets A be the matrix that arises by leaving out every row of Aidxm that, in the case W=4, corresponds to an odd x-coordinate in the downsampled block, or, in the case H=4, corresponds to an odd y-coordinate in the downsampled block. If mode≥18, one replaces the reduced prediction signal by its transposed signal. In alternative examples, different strategies may be carried out. For example, instead of reducing the size of a larger matrix (“leave out”), a smaller matrix of S1 (idx=1) with Wred=4 and Hred=4 is used. I.e., such blocks are now assigned to S1 instead of S2.
Other strategies may be carried out. In other examples, the mode index ‘mode’ is not necessarily in the range 0 to 35 (other ranges may be defined). Further, it is not necessary that each of the three sets S0, S1, S2 has 18 matrices (hence, instead of expressions like mode<18, it is possible to mode<n0, n1, n2, which are the number of matrixes for each set of matrixes S0, S1, S2, respectively). Further, the sets may have different numbers of matrixes each (for example, it may be that S0 has 16 matrixes S1 has eight matrixes, and S2 has six matrixes).
Here, features are provided regarding step 812.
Interpolation of the subsampled prediction signal, on large blocks a second version of the averaged boundary may be needed. Namely, if min(W, H)>8 and W≥H, one writes W=8*2l, and for 0≤i<8 defines
bdryredIItop[i]=(Σj=02
If min(W, H)>8 and H>W, one defines bdryredIIleft analogously.
In addition or alternative, it is possible to have a “hard downsampling”, in which the bdryredIItop[i] is equal to
bdryredIItop[i]=bdrytop[i+1)*2l−1].
Also, bdryredIIleft can be defined analogously.
At the sample positions that were left out in the generation of predred, the final prediction signal may arise by linear interpolation from predred (e.g., step 813 in examples of
The linear interpolation may be given as follows (other examples are notwithstanding possible). It is assumed that W≥H. Then, if H>Hred, a vertical upsampling of predred may be performed. In that case, predred may be extended by one line to the top as follows. If W=8, predred may have width Wred=4 and may be extended to the top by the averaged boundary signal bdryredtop, e.g. as defined above. If W>8, predred is of width Wred=8 and it is extended to the top by the averaged boundary signal bdryredIItop, e.g. as defined above. One may write predred[x][−1] for the first line of predred. Then the signal predredups,ver on a block of width Wred and height 2*Hred may be given as
predredups,ver[x][2*y+1]=predred[x][y],
predredups,ver[x][2*y]=(predred[x][y−1]+predred[x][y]+1)>>1,
where 0≤x<Wred and 0≤y<Hred. The latter process may be carried out k times until 2k*Hred=H. Thus, if H=8 or H=16, it may be carried out at most once. If H=32, it may be carried out twice. If H=64, it may be carried out three times. Next, a horizontal upsampling operation may be applied to the result of the vertical upsampling. The latter upsampling operation may use the full boundary left of the prediction signal. Finally, if H>W, one may proceed analogously by first upsampling in the horizontal direction (if usefull) and then in the vertical direction.
This is an example of an interpolation using reduced boundary samples for the first interpolation (horizontally or vertically) and original boundary samples for the second interpolation (vertically or horizontally). Depending on the block size, only the second or no interpolation may be used. If both horizontal and vertical interpolation may be used, the order depends on the width and height of the block.
However, different techniques may be implemented: for example, original boundary samples may be used for both the first and the second interpolation and the order may be fixed, e.g. first horizontal then vertical (in other cases, first vertical then horizontal).
Hence, the interpolation order (horizontal/vertical) and the use of reduced/original boundary samples may be varied.
The entire process of averaging, matrix-vector-multiplication and linear interpolation is illustrated for different shapes in
The parameters needed for all possible proposed intra prediction modes may be comprised by the matrices and offset vectors belonging to the sets S0, S1, S2. All matrix-coefficients and offset vectors may be stored as 10-bit values. Thus, according to the above description, a total number of 14400 parameters, each in 10-bit precision, may be needed for the proposed method. This corresponds to 0.018 Megabyte of memory. It is pointed out that currently, a CTU of size 128×128 in the standard 4:2:0 chroma-subsampling consists of 24576 values, each in 10 bit. Thus, the memory requirement of the proposed intra-prediction tool does not exceed the memory requirement of the current picture referencing tool that was adopted at the last meeting. Also, it is pointed out that the conventional intra prediction modes may use four multiplications per sample due to the PDPC tool or the 4-tap interpolation filters for the angular prediction modes with fractional angle positions. Thus, in terms of operational complexity the proposed method does not exceed the conventional intra prediction modes.
For luma blocks, 35 ALWIP modes are proposed, for example, (other numbers of modes may be used). For each Coding Unit (CU) in intra mode, a flag indicating if an ALWIP mode is to be applied on the corresponding Prediction Unit (PU) or not is sent in the bitstream. The signalization of the latter index may be harmonized with MRL in the same way as for the first CE test. If an ALWIP mode is to be applied, the index predmode of the ALWIP mode may be signaled using an MPM-list with 3 MPMS.
Here, the derivation of the MPMs may be performed using the intra-modes of the above and the left PU as follows. There may be tables, e.g. three fixed tables map_angular_to_alwipidx, idx ∈ {0,1,2} that may assign to each conventional intra prediction mode predmodeAngular an ALWIP mode
predmodeALWIP=map_angular_to_alwipidx[predmodeAngular].
For each PU of width W and height H one defines and index
idx(PU)=idx(W,H)∈{0,1,2}
that indicates from which of the three sets the ALWIP-parameters are to be taken as in section 4 above. If the above Prediction Unit PUabove is available, belongs to the same CTU as the current PU and is in intra mode, if idx(PU)=idx(PUabove) and if ALWIP is applied on PUabove with ALWIP-mode predmodeALWIPabove, one puts
modeALWIPabove=predmodeALWIPabove.
If the above PU is available, belongs to the same CTU as the current PU and is in intra mode and if a conventional intra prediction mode predmodeAngular is applied on the above PU, one puts
modeALWIPabove=map_angular_to_alwipidx(PU
In all other cases, one puts
modeALWIPabove=−1
which means that this mode is unavailable. In the same way but without the restriction that the left PU needs to belong to the same CTU as the current PU, one derives a mode
modeALWIPleft.
Finally, three fixed default lists listidx, idx E {0,1,2} are provided, each of which contains three distinct ALWIP modes. Out of the default list listidx(PU) and the modes modeALWIPabove and modeALWIPleft, one constructs three distinct MPMs by substituting −1 by default values as well as eliminating repetitions.
The herein described embodiments are not limited by the above described Signalization of the proposed intra prediction modes. According to an alternative embodiment, no MPMs and/or mapping tables are used for MIP (ALWIP).
The proposed ALWIP-modes may be harmonized with the MPM-based coding of the conventional intra-prediction modes as follows. The luma and chroma MPM-list derivation processes for the conventional intra-prediction modes may use fixed tables map_lwip_to_angularidx, idx ∈ {0,1,2}, mapping an ALWIP-mode predmodeLWIP on a given PU to one of the conventional intra-prediction modes
predmodeAngular=map_lwip_to_angularidx(PU)[predmodeLWIP].
For the luma MPM-list derivation, whenever a neighboring luma block is encountered which uses an ALWIP-mode predmodeLWIP, this block may be treated as if it was using the conventional intra-prediction mode predmodeAngular. For the chroma MPM-list derivation, whenever the current luma block uses an LWIP-mode, the same mapping may be used to translate the ALWIP-mode to a conventional intra prediction mode.
It is clear, that the ALWIP-modes can be harmonized with the conventional intra-prediction modes also without the usage of MPMs and/or mapping tables. It is, for example, possible that for the chroma block, whenever the current luma block uses an ALWIP-mode, the ALWIP-mode is mapped to a planar-intra prediction mode.
Let's briefly summarize the above examples as they might form a basis for further extending the embodiments described herein below.
For predicting a predetermined block 18 of the picture 10, using a plurality of neighboring samples 17a,c is used.
A reduction 100, by averaging, of the plurality of neighboring samples has been done to obtain a reduced set 102 of samples values lower, in number of samples, than compared to the plurality of neighboring samples. This reduction is optional in the embodiments herein and yields the so called sample value vector mentioned in the following. The reduced set of sample values is the subject to a linear or affine linear transformation 19 to obtain predicted values for predetermined samples 104 of the predetermined block. It is this transformation, later on indicated using matrix A and offset vector b which has been obtained by machine learning (ML) and should be implementation efficiently preformed.
By interpolation, prediction values for further samples 108 of the predetermined block are derived on the basis of the predicted values for the predetermined samples and the plurality of neighboring samples. It should be said that, theoretically, the outcome of the affine/linear transformation could be associated with non-full-pel sample positions of block 18 so that all samples of block 18 might be obtained by interpolation in accordance with an alternative embodiment. No interpolation might be necessary at all, too.
The plurality of neighboring samples might extend one-dimensionally along two sides of the predetermined block, the predetermined samples are arranged in rows and columns and, along at least one of the rows and columns, wherein the predetermined samples may be positioned at every nth position from a sample (112) of the predetermined sample adjoining the two sides of the predetermined block. Based on the plurality of neighboring samples, for each of the at least one of the rows and the columns, a support value for one (118) of the plurality of neighboring positions might be determined, which is aligned to the respective one of the at least one of the rows and the columns, and by interpolation, the prediction values for the further samples 108 of the predetermined block might be derived on the basis of the predicted values for the predetermined samples and the support values for the neighboring samples aligned to the at least one of rows and columns. The predetermined samples may be positioned at every nth position from the sample 112 of the predetermined sample which adjoins the two sides of the predetermined block along the rows and the predetermined samples may be positioned at every mth position from the sample 112 of the predetermined sample which adjoins the two sides of the predetermined block along the columns, wherein n,m>1. It might be that n=m. Along at least one of the rows and column, the determination of the support values may be done by averaging (122), for each support value, a group 120 of neighboring samples within the plurality of neighboring samples which includes the neighboring sample 118 for which the respective support value is determined. The plurality of neighboring samples may extend one-dimensionally along two sides of the predetermined block and the reduction may be done by grouping the plurality of neighboring samples into groups 110 of one or more consecutive neighboring samples and performing an averaging on each of the group of one or more neighboring samples which has more than two neighboring samples.
For the predetermined block, a prediction residual might be transmitted in the data stream. It might be derived therefrom at the decoder and the predetermined block be reconstructed using the prediction residual and the predicted values for the predetermined samples. At the encoder, the prediction residual is encoded into the data stream at the encoder.
The picture might be subdivided into a plurality of blocks of different block sizes, which plurality comprises the predetermined block. Then, it might be that the linear or affine linear transformation for block 18 is selected depending on a width W and height H of the predetermined block such that the linear or affine linear transformation selected for the predetermined block is selected out of a first set of linear or affine linear transformations as long as the width W and height H of the predetermined block are within a first set of width/height pairs and a second set of linear or affine linear transformations as long as the width W and height H of the predetermined block are within a second set of width/height pairs which is disjoint to the first set of width/height pairs. Again, later on it gets clear that the affine/linear transformations are represented by way of other parameters, namely weights of C and, optionally, offset and scale parameters.
Decoder and encoder may be configured to subdivide the picture into a plurality of blocks of different block sizes, which comprises the predetermined block, and to select the linear or affine linear transformation depending on a width W and height H of the predetermined block such that the linear or affine linear transformation selected for the predetermined block is selected out of
The third set of one or more width/height pairs merely comprises one width/height pair, W′, H′, and each linear or affine linear transformation within first set of linear or affine linear transformations is for transforming N′ sample values to W′*H′ predicted values for an W′×H′ array of sample positions.
Each of the first and second sets of width/height pairs may comprise a first width/height pairs Wp,Hp with Wp being unequal to Hp and a second width/height pair Wq,Hq with Hq=Wp and Wq=Hp.
Each of the first and second sets of width/height pairs may additionally comprise a third width/height pairs Wp,Hp with Wp being equal to Hp and Hp>Hq.
For the predetermined block, a set index might be transmitted in the data stream, which indicates which linear or affine linear transformation to be selected for block 18 out of a predetermined set of linear or affine linear transformations.
The plurality of neighboring samples may extend one-dimensionally along two sides of the predetermined block and the reduction may be done by, for a first subset of the plurality of neighboring samples, which adjoin a first side of the predetermined block, grouping the first subset into first groups 110 of one or more consecutive neighboring samples and, for a second subset of the plurality of neighboring samples, which adjoin a second side of the predetermined block, grouping the second subset into second groups 110 of one or more consecutive neighboring samples and performing an averaging on each of the first and second groups of one or more neighboring samples which has more than two neighboring samples, so as to obtain first sample values from the first groups and second sample values for the second groups. Then, the linear or affine linear transformation may be selected depending on the set index out of a predetermined set of linear or affine linear transformations such that two different states of the set index result into a selection of one of the linear or affine linear transformations of the predetermined set of linear or affine linear transformations, the reduced set of sample values may be subject to the predetermined linear or affine linear transformation in case of the set index assuming a first of the two different states in form of a first vector to yield an output vector of predicted values, and distribute the predicted values of the output vector along a first scan order onto the predetermined samples of the predetermined block and in case of the set index assuming a second of the two different states in form of a second vector, the first and second vectors differing so that components populated by one of the first sample values in the first vector are populated by one of the second sample values in the second vector, and components populated by one of the second sample values in the first vector are populated by one of the first sample values in the second vector, so as to yield an output vector of predicted values, and distribute the predicted values of the output vector along a second scan order onto the predetermined samples of the predetermined block which is transposed relative to the first scan order.
Each linear or affine linear transformation within first set of linear or affine linear transformations may be for transforming N1 sample values to w1*h1 predicted values for an w1×h1 array of sample positions and each linear or affine linear transformation within first set of linear or affine linear transformations is for transforming N2 sample values to w2*h2 predicted values for an w2×h2 array of sample positions, wherein for a first predetermined one of the first set of width/height pairs, w1 may exceed the width of the first predetermined width/height pair or h1 may exceed the height of the first predetermined width/height pair, and for a second predetermined one of the first set of width/height pairs neither w1 may exceed the width of the second predetermined width/height pair nor h1 exceeds the height of the second predetermined width/height pair. The reducing (100), by averaging, the plurality of neighboring samples to obtain the reduced set (102) of samples values might then be done so that the reduced set 102 of samples values has N1 sample values if the predetermined block is of the first predetermined width/height pair and if the predetermined block is of the second predetermined width/height pair, and the subjecting the reduced set of sample values to the selected linear or affine linear transformation might be performed by using only a first sub-portion of the selected linear or affine linear transformation which is related to a subsampling of the w1×h1 array of sample positions along width dimension if w1 exceeds the width of the one width/height pair, or along height dimension if h1 exceeds the height of the one width/height pair if the predetermined block is of the first predetermined width/height pair, and the selected linear or affine linear transformation completely if the predetermined block is of the second predetermined width/height pair.
Each linear or affine linear transformation within first set of linear or affine linear transformations may be for transforming N1 sample values to w1*h1 predicted values for an w1×h1 array of sample positions with w1=h1 and each linear or affine linear transformation within second set of linear or affine linear transformations is for transforming N2 sample values to w2*h2 predicted values for an w2×h2 array of sample positions with w2=h2.
All of the above described embodiments are merely illustrative in that they may form the basis for the embodiment described herein below. That is, above concepts and details shall serve to understand the following embodiments and shall serve as a reservoir of possible extensions and amendments of the embodiments described herein below. In particular, many of the above described details are optional such as the averaging of neighboring samples, the fact the neighboring samples are used as reference samples and so forth.
More generally, the embodiments described herein assume that a prediction signal on a rectangular block is generated out of already reconstructed samples such as an intra prediction signal on a rectangular block is generated out of neighboring, already reconstructed samples left and above the block. The generation of the prediction signal is based on the following steps.
The computation of the matrix vector product in Step 2 may be carried out in integer arithmetic. Thus, if x=(x1, . . . , xn) denotes the input for the matrix vector product, i.e. x denotes the concatenation of the (averaged) boundary samples left and above the block, then out of x, the (reduced) prediction signal computed in Step 2 should be computed using only bit shifts, the addition of offset vectors, and multiplications with integers. Ideally, the prediction signal in Step 2 would be given as Ax+b where b is an offset vector that might be zero and where A is derived by some machine-learning based training algorithm. However, such a training algorithm usually only results in a matrix A=Afloat that is given in floating point precision. Thus, one is faced with the problem to specify integer operations in the aforementioned sense such that the expression Afloatx is well approximated using these integer operations. Here, it is important to mention that these integer operations are not necessarily chosen such that they approximate the expression Afloatx assuming a uniform distribution of the vector x but typically take into account that the input vectors x for which the expression Afloatx is to be approximated are (averaged) boundary samples from natural video signals where one can expect some correlations between the components xi of x.
If the prediction mode is, for example, an inter prediction, reference samples 172 out of another picture 10′ can be used.
The apparatus 1000 is configured to form 100 a sample value vector 400 out of the plurality of reference samples 17. The sample value vector can be obtained by different technics. The sample value vector can, for example, comprise all reference samples 17. Optionally the reference samples can be weighted. According to another example the sample value vector 400 can be formed as described with regard to one of
The apparatus 1000 is configured to derive 401 from the sample value vector 400 a further vector 402 onto which the sample value vector 400 is mapped by a predetermined invertible linear transform 403. The further vector 402 comprises, for example, only integer and/or fixed-point values. The invertible linear transform 403 is, for example, chosen such that a prediction of samples of the predetermined block 18 is performed by integer arithmetic or fixed-point arithmetic.
Furthermore, the apparatus 1000 is configured to compute a matrix-vector product 404 between the further vector 402 and a predetermined prediction matrix 405 so as to obtain a prediction vector 406, and predict samples of the predetermined block 18 on the basis of the prediction vector 406. Based on the advantageous further vector 402, the predetermined prediction matrix can be quantized to enable integer and/or fixed-point operations with only marginal impact of a quantization error on the predicted samples of the predetermined block 18.
According to an embodiment, the apparatus 1000 is configured to compute the matrix-vector product 404 using fixed point arithmetic operations. Alternatively, integer operations can be used. According to an embodiment, the apparatus 1000 is configured to compute the matrix-vector product 404 without floating point arithmetic operations.
According to an embodiment, the apparatus 1000 is configured to store a fixed point number representation of the predetermined prediction matrix 405. Additionally or alternatively, an integer representation of the predetermined prediction matrix 405 can be stored.
According to an embodiment, the apparatus 1000 is configured to, in predicting the samples of the predetermined block 18 on the basis of the prediction vector 406, use interpolation to compute at least one sample position of the predetermined block 18 based on the prediction vector 406 each component of which is associated with a corresponding position within the predetermined block 18. The interpolation can be performed as described with regard to one of the embodiments shown in
Because of the features of the further vector 402 the second matrix-vector product can be integer approximated by a matrix-vector product 404 between a predetermined prediction matrix C 405 and the further vector 402 plus a further offset 408. The further vector 402 and the further offset 408 can consist of integer or fixed-point values. All components of the further offset are, for example, the same. The predetermined prediction matrix 405 can be a quantized matrix or a matrix to be quantized. The result of the matrix-vector product 404 between the predetermined prediction matrix 405 and the further vector 402 can be understood as a prediction vector 406.
In the following more details regarding this integer approximation are provided.
One possible incorporation of an integer approximation of an expression Afloatx useable in a scenario above is to replace the i0-th component xi
Since Afloat=(AfloatT−1)T, if one does such a transformation on the input x, one has to find an integral approximation of the matrix vector product By, where B=(AfloatT−1) and y=Tx. Since the matrix-vector product Afloatx represents a prediction on a rectangular block, i.e. a predetermined block, and since x is comprised by (e.g., averaged) boundary samples of that block, one should expect that in the case where all sample values of x are equal, i.e. where xi=mean(x) for all i, each sample value in the prediction signal Afloatx should be close to mean(x) or be exactly equal to mean(x). This means that one should expect that the i0-th column, i.e. the column corresponding to the predetermined component, of B, i.e. of a further matrix 1200, is very close or equal to a column that consist only of ones. Thus, if M(i0), i.e. an integer matrix 1300, is the matrix whose i0th column consists of ones and all of whose other columns are zero, writing By=Cy+M(i0)y with C=B−M(i0), one should expect that the i0-th column of C, i.e. the predetermined prediction matrix 405, has rather small entries or is zero, as shown in
The predetermined value 1400 is not necessarily the mean value mean (x). The herein described integer approximation of the expression Afloatx can also be achieved with the following alternative definitions of the predetermined value 1400:
In another possible incorporation of an integer approximation of an expression Afloatx, the i0-th component xi
Alternatively, the predetermined value 1400 is a default value or a value signaled in a data stream into which a picture is coded.
The predetermined value 1400 equals, for example, 2bitdepth−1. In this case, the further vector 402 can be defined by y0=2bitdepth−1 and yi=xi−x0 for i>0.
Alternatively, the predetermined component 1500 becomes a constant minus the predetermined value 1400. The constant equals, for example, 2bitdepth−1. According to an embodiment, the predetermined component yi
It is, for example, advantageous if the predetermined value 1400 has a small deviation from prediction values of samples of the predetermined block.
According to an embodiment, the apparatus 1000 is configured to comprise a plurality of invertible linear transforms 403, each of which is associated with one component of the further vector 402. Furthermore, the apparatus is, for example, configured to select the predetermined component 1500 out of the components of the sample value vector 400 and use the invertible linear transform 403 out of the plurality of invertible linear transforms which is associated with the predetermined component 1500 as the predetermined invertible linear transform. This is, for example, due to different positions of the i0th row, i.e. a row of the invertible linear transform 403 corresponding to the predetermined component, dependent on a position of the predetermined component in the further vector 402. If, for example, the first component, i.e. y1, of the further vector 402 is the predetermined component, the ioth row would replace the first row of the invertible linear transform.
As shown in
As shown in
A result of a summation of the predetermined prediction matrix 405 and the integer matrix 1300 equals or approximates, for example, the further matrix 1200, shown in
In other words, a matrix, i.e. the further matrix B 1200, which results from summing each matrix component of the predetermined prediction matrix C 405 within a column 412, i.e. the i0th column, of the predetermined prediction matrix 405, which corresponds to the predetermined component 1500 of the further vector 402, with one, (i.e. matric B) times the invertible linear transform 403 corresponds, for example, to a quantized version of a machine learning prediction matrix A 1100, as shown in
For a low complexity implementation (in terms of complexity of adding and multiplying scalar values, as well as in terms of storage that may be used for the entries of the partaking matrix), it is desirable to perform the matrix multiplications 404 using integer arithmetic only.
To calculate an approximation of z=Cy, i.e.
using operations on integers only, the real values Ci,j may be mapped to integer values Ĉi,j, according to an embodiment. This can be done for example by uniform scalar quantization, or by taking into account specific correlations between values yi. The integer values represent, for example fixed-point numbers that can each be stored with a fixed number of bits n_bits, for example n_bits=8.
The matrix-vector product 404 with a matrix, i.e. the predetermined prediction matrix 405, of size m×n can then be carried out like shown in this pseudo code, where <<, >> are arithmetic binary left- and right-shift operations and +, − and * operate on integer values only.
Here, the array C, i.e. the predetermined prediction matrix 405, stores the fixed point numbers, for example, as integers. The final addition of final_offset and the right-shift operation with right_shift_result reduce precision by rounding to obtain a fixed point format that may be used at the output.
To allow for an increased range of real values representable by the integers in C, two additional matrices offseti,j and scalei,j can be used, as shown in the embodiments of
is given by
b
i,j=(Ĉi,j−offseti,j)*scalei,j.
The values offseti,j and scalei,j are themselves integer values. For example these integers can represent fixed-point numbers that can each be stored with a fixed number of bits, for example 8 bits, or for example the same number of bits n_bits that is used to store the values Ci,j.
In other words, the apparatus 1000 is configured to represent the predetermined prediction matrix 405 using prediction parameters, e.g. integer values Ĉi,j and the values offseti,j and scalei,j, and to compute the matrix-vector product 404 by performing multiplications and summations on the components of the further vector 402 and the prediction parameters and intermediate results resulting therefrom, wherein absolute values of the prediction parameters are representable by an n-bit fixed point number representation with n being equal to or lower than 14, or, alternatively, 10, or, alternatively, 8. For instance, the components of the further vector 402 are multiplied with the prediction parameters to yield products as intermediate results which, in turn, are subject to, or form addends of, a summation.
According to an embodiment, the prediction parameters comprise weights each of which is associated with a corresponding matrix component of the prediction matrix. In other words, the predetermined prediction matrix is, for example, replaced or represented by the prediction parameters. The weights are, for example, integer and/or fixed point values.
According to an embodiment, the prediction parameters further comprise one or more scaling factors, e.g. the values scalei,j, each of which is associated with one or more corresponding matrix components of the predetermined prediction matrix 405 for scaling the weight, e.g. an integer value Ĉi,j associated with the one or more corresponding matrix component of the predetermined prediction matrix 405. Additionally or alternatively, the prediction parameters comprise one or more offsets, e.g. the values offseti,j, each of which is associated with one or more corresponding matrix components of the predetermined prediction matrix 405 for offsetting the weight, e.g. an integer value Ĉi,j, associated with the one or more corresponding matrix component of the predetermined prediction matrix 405.
In order to reduce the amount of storage necessary for offseti,j and scalei,j, their values can be chosen to be constant for particular sets of indices i,j. For example, their entries can be constant for each column or they can be constant for each row, or they can be constant for all i,j, as shown in
For example, in one advantageous embodiment, offseti,j and scalei,j are constant for all values of a matrix of one prediction mode, as shown in
According to an embodiment, offseti,j and/or scalei,j are constant, i.e. identical, for all matrix-based intra prediction modes. Additionally or Alternatively, it is possible, that offseti,j and/or scalei,j are constant, i.e. identical, for all block sizes.
With offset representing ok and scale representing sk, the calculation in (1) can be modified to be:
The above solution implies the following embodiments:
That is, in accordance with embodiments of the present application, encoder and decoder act as follows in order to predict a predetermined block 18 of a picture 10, see
In order to perform the prediction, a sample value vector 400 is formed out of the reference samples such as reference samples 17a and 17c. A possible formation has been described above. The formation may involve an averaging, thereby reducing the number of samples 102 or the number of components of vector 400 compared to the reference samples 17 contributing to the formation. The formation may also, as described above, somehow depend on the dimension or size of block 18 such as its width and height.
It is this vector 400 which is ought to be subject to an affine or linear transform in order to obtain the prediction of block 18. Different nomenclatures have been used above. Using the most recent one, it is the aim to perform the prediction by applying vector 400 to matrix A by way of a matrix vector product within performing a summation with an offset vector b. The offset vector b is optional. The affine or linear transformation determined by A or A and b, might be determined by encoder and decoder or, to be more precise, for sake of prediction on the basis of the size and dimension of block 18 as already described above.
However, in order to achieve the above-outlined computational efficiency improvement or render the prediction more effective in terms of implementation, the affine or linear transform has been quantized, and encoder and decoder, or the predictor thereof, used the above-mentioned C and T in order to represent and perform the linear or affine transformation, with C and T, applied in the manner described above, representing a quantized version of the affine transformation. In particular, instead of applying vector 400 directly to a matrix A, the predictor in encoder and decoder, applies vector 402 resulting from the sample value vector 400 by way of subjecting same to a mapping via a predetermined invertible linear transform T. It might be that transform T as used here is the same as long as vector 400 has the same size, i.e. does not depend on the block's dimensions, i.e. width and height, or is at least the same for different affine/linear transformations. In the above, vector 402 has been denoted y. The exact matrix in order to perform the affine/linear transform as determined by machine learning would have been B. However, instead of exactly performing B, the prediction in encoder and decoder is done by way of an approximation or quantized version thereof. In particular, the representation is done via appropriately representing C in the manner outlined above with C+M representing the quantized version of B.
Accordingly, the prediction in encoder and decoder is further prosecuted by computing the matric-vector product 404 between vector 402 and the predetermined prediction matrix C appropriately represented and stored at encoder and decoder in the manner described above. The vector 406 which results from this matrix-vector product, is then used for predicting the samples 104 of block 18. As described above, for sake of prediction, each component of vector 406 might be subject to a summation with parameter a as indicated at 408 in order to compensate for the corresponding definition of C. The optional summation of vector 406 with offset vector b may also be involved in the derivation of the prediction of block 18 on the basis of vector 406. It might be that, as described above, each component of vector 406, and accordingly, each component of the summation of vector 406, the vector of all a's indicated at 408 and the optional vector b, might directly correspond to samples 104 of block 18 and, thus, indicate the predicted values of the samples. It may also be that only a sub-set of the block's samples 104 is predicted in that manner and that the remaining samples of block 18, such as 108, are derived by interpolation.
As described above, there are different embodiments for setting a. For instance, it might be the arithmetic mean of the components of vector 400. For that case, see
The weights of C or the weights of C′, i.e. the components of this matrix, may be represented and stored in fixed-point number representation. These weights 414 may, however, also, as described above, be stored in a manner related to different scales and/or offsets. Scale and offset might be defined for the whole matrix C, i.e. be equal for all weights 414 of matrix C or matrix C′, or may be defined in a manner so as to be constant or equal for all weights 414 of the same row or all weights 414 of the same column of matrix C and matrix C′, respectively.
According to an embodiment, the herein described apparatus for predicting a predetermined block of a picture can be configured to use a matrix-based intra sample prediction comprising the following features:
The apparatus is configured to form a sample value vector pTemp[x] 400 out of the plurality of reference samples 17. Assuming pTemp[x] to be 2*boundarySize, pTemp[x] might be populated by—e.g. by direct copying or by sub-sampling or pooling—the neighboring samples located at the top of the predetermined block, redT[x] with x=0 . . . boundarySize−1, followed by the neighboring samples located to the left of the predetermined block, redL[x] with x=0 . . . boundarySize−1, (e.g. in case of isTransposed=0) or vice versa in case of the transposed processing (e.g. in case of isTransposed=1).
The input values p[x] with x=0 . . . inSize−1 are derived, i.e. the apparatus is configured to derive from the sample value vector pTemp[x] a further vector p[x] onto which the sample value vector pTemp[x] is mapped by a predetermined invertible linear transform, or to be more specific predetermined invertible affine linear transform, as follows:
p[x]=pTemp[x+1]−pTemp[0]
p[0]=(1<<(BitDepth−1))−pTemp[0]
p[x]=pTemp[x]−pTemp[0] for x=1 . . . inSize−1
Here, the variable mipSizeId is indicative of the size of predetermined block. That is, according to the present embodiment, the invertible transform using which the further vector is derived from the sample value vector, depends on the size of the predetermined block. The dependency might be given according to
Where predSize is indicative of the number of predicted samples within the predetermined block, and 2*bondarySize is indicative of the size of the sample value vector and is related to inSize, i.e. the further vector'S size, according to inSize=(2*boundarySize)−(mipSizeId==2)?1:0.
To be more precise, inSize indicates the number of those components of the further vector which actually participate in the computation. inSize is as large as the size of sample value vector for smaller block sizes, and one component smaller for larger block sizes. In the former case, one component may be disregarded, namely the one which would correspond to the predetermined component of the further vector, as in the matrix vector product to be computed later on, the contribution of the corresponding vector component would yield zero anyway and, thus, needs not to be actually computed. The dependency on the block size might be left off in case of alternative embodiments, where merely one of the two alternatives is used inevitably, i.e. irrespective of the block size (the option corresponding to mipSizeId is less than 2, or the option corresponding to mipSizeId equal to 2).
In other words, the predetermined invertible linear transform is, for example, defined such that a predetermined component of the further vector p becomes a, while all others correspond to a component of the sample value vector minus a, wherein e.g. a=pTemp[0]. In case of the first option corresponding to mipSizeId equal to 2, this is readily visible and only the differentially formed components of the further vector are further taken into account. That is, in the case of the first option, the further vector is actually {p[0 . . . inSize]; pTemp[0]} wherein pTemp[0] is a and the actually computed part of the matrix vector multiplication to yield the matrix vector product, i.e. the result of the multiplication, is restricted to only inSize components of the further vector and the corresponding columns of the matrix, as the matrix has a zero column which needs no computation. In other case, corresponding to mipSizeId smaller than 2, a=pTemp[0] is chosen, as all components of the further vector except p[0], i.e. each of other components p[x] (for x=1 . . . inSize−1) of the further vector p, except the predetermined component p[0], equal a corresponding component of the sample value vector pTemp[x] minus a, but p[0] is chosen to be a constant minus a. The matrix vector product is then computed. The constant is the mean of representable values, i.e. 2x−1 (i.e. 1<<(BitDepth−1)) with x denoting the bit depth of the computational representation used. It should be noted that, if p[0] was selected to be pTemp[0] instead, then the product computed would simply deviate from the one computed using p[0] as indicated above (p[0]=(1<<(BitDepth−1))−pTemp[0]), by a constant vector which could be taken into account when predicting the block inner based on the product, i.e. the prediction vector. The value a is, thus, a predetermined value, e.g., pTemp[0]. The predetermined value pTemp[0] is in this case, for example, a component of the sample value vector pTemp corresponding to the predetermined component p[0]. It might be the neighboring sample to the top of the predetermined, or the left of the predetermined block, nearest to the upper left corner of the predetermined block.
For the intra sample prediction process according to predModeIntra, e.g., specifying the intra prediction mode, the apparatus is, for example, configured to apply the following steps, e.g. perform at least the first step:
oW=32−32*(Σi=0insize−1p[i])
predMip[x][y]=(((Σi=0insize−1mWeight[i][y*predSize+x]*p[i])+oW)>>6)+pTemp[0]
predMip[x][y]=Clip1(predMip[x][y])
predTemp[y][x]=predMip[x][y]
predMip=predTemp
Generally, examples may be implemented as a computer program product with program instructions, the program instructions being operative for performing one of the methods when the computer program product runs on a computer. The program instructions may for example be stored on a machine readable medium.
Other examples comprise the computer program for performing one of the methods described herein, stored on a machine-readable carrier.
In other words, an example of method is, therefore, a computer program having program instructions for performing one of the methods described herein, when the computer program runs on a computer.
A further example of the methods is, therefore, a data carrier medium (or a digital storage medium, or a computer-readable medium) comprising, recorded thereon, the computer program for performing one of the methods described herein. The data carrier medium, the digital storage medium or the recorded medium are tangible and/or non-transitionary, rather than signals which are intangible and transitory.
A further example of the method is, therefore, a data stream or a sequence of signals representing the computer program for performing one of the methods described herein. The data stream or the sequence of signals may for example be transferred via a data communication connection, for example via the Internet.
A further example comprises a processing means, for example a computer, or a programmable logic device performing one of the methods described herein.
A further example comprises a computer having installed thereon the computer program for performing one of the methods described herein.
A further example comprises an apparatus or a system transferring (for example, electronically or optically) a computer program for performing one of the methods described herein to a receiver. The receiver may, for example, be a computer, a mobile device, a memory device or the like. The apparatus or system may, for example, comprise a file server for transferring the computer program to the receiver.
In some examples, a programmable logic device (for example, a field programmable gate array) may be used to perform some or all of the functionalities of the methods described herein. In some examples, a field programmable gate array may cooperate with a microprocessor in order to perform one of the methods described herein. Generally, the methods may be performed by any appropriate hardware apparatus.
While this invention has been described in terms of several embodiments, there are alterations, permutations, and equivalents which fall within the scope of this invention. It should also be noted that there are many alternative ways of implementing the methods and compositions of the present invention. It is therefore intended that the following appended claims be interpreted as including all such alterations, permutations and equivalents as fall within the true spirit and scope of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
19173830.1 | May 2019 | EP | regional |
This application is a continuation of copending International Application No. PCT/EP2020/063018, filed May 11, 2020, which is incorporated herein by reference in its entirety, and additionally claims priority from European Application No. EP 19173830.1, filed May 10, 2019, which is incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/EP2020/063018 | May 2020 | US |
Child | 17520012 | US |