1. Field of the Invention
The present invention relates to video coding. In particular, the present invention relates to coding techniques associated with simplified chroma intra prediction based on reconstructed luma and chroma pixels.
2. Description of the Related Art
Motion compensated inter-frame coding has been widely adopted in various coding standards, such as MPEG-124 and H.261H.263H.264AVC. While motion-compensated inter-frame coding can effectively reduce bitrate for compressed video, intra coding is required to compress the regions with high motion or scene changes. Besides, intra coding is also used to process an initial picture or to periodically insert I-pictures or I-blocks for random access or for alleviation of error propagation. Intra prediction exploits the spatial correlation within a picture or within a picture region. In practice, a picture or a picture region is divided into blocks and the intra prediction is performed on a block basis. Intra prediction for a current block can rely on pixels in neighboring blocks that have been processed. For example, if blocks in a picture or picture region are processed row by row first from left to right and then from top to bottom, neighboring blocks on the top and neighboring blocks on the left of the current block can be used to form intra prediction for pixels in the current block. While any pixels in the processed neighboring blocks can be used for intra predictor of pixels in the current block, very often only pixels of the neighboring blocks that are adjacent to the current block boundaries on the top and on the left are used.
The intra predictor is usually designed to exploit spatial features in the picture such as smooth area (DC mode), vertical line or edge, horizontal line or edge and diagonal line or edge. Furthermore, correlation often exists between the luminance (luma) and chrominance (chroma) components. Therefore, reconstructed luma pixels can be used to derive the intra chroma prediction. In recent development of High Efficiency Video Coding (HEVC), a chroma intra prediction method based on co-located reconstructed luma blocks has been disclosed. The type of chroma intra prediction is termed as LM prediction or LM mode. The main concept is to use the reconstructed luma pixels to generate the predictors of corresponding chroma pixels.
In the Test Model Version 5.0 (HM-5.0), the LM mode is applied to predict chroma samples based on a linear model using reconstructed luma samples of the co-located prediction unit (PU). The parameters of the linear model consist of slope (a>>k) and y-intercept (b), where “>>” corresponds to the right shift operation. The parameters are derived based on the neighboring luma and chroma samples according to a least mean square criterion. The prediction sample, predSamples[x,y] for the chroma sample to be coded in the LM mode is derived as follows, where x,y=0 . . . nS−1 and nS corresponds to the block size.
First, variable k3 and the sample array pY′ are derived as:
k3=Max(0, BitDepthC+Log2(nS)−14), (1)
where BitDepthC denotes the internal chroma bit depth (i.e., the bit depth with which the chroma signal is processed during video coding process), and
p
Y′[x,−1]=(PLM[2x−1,−1]+2*PLM[2x,−1]+PLM[2x+1,−1]+2)>>2, (2)
p
Y′[−1,y]=(PLM[−1,2y]+PLM[−1,2y+1])>>1, (3)
p
Y
′[x,y]=(recSamplesL[2x,2y]+recSamplesL[2x, 2y+1])>>1, (4)
where x=0 . . . nS−1, PLM[x,y] denotes the neighboring reconstructed luma samples, and recSamplesL[x,y] denotes the current reconstructed luma samples of the co-located luma block. The sample array pY′ are derived from reconstructed luma samples. Accordingly, pY′ is also 3 5 called derived co-located luma sample in this disclosure. In equations (2) through (4), pY′[x,y] is only evaluated at positions co-located with the chroma samples.
In HM-5.0, the characteristics of the neighboring reconstructed luma samples and neighboring reconstructed chroma samples of the current block are used to determine the linear-model parameters a, k, and b for LM-mode chroma intra prediction. The derived co-located luma pixels of the current luma block can be derived from the current reconstructed luma pixels of the current luma block at pixel locations co-located with the chroma pixels of the current chroma block.
To exemplify the linear model relating the chroma intra prediction with the derived co-located luma pixels, a set of variable, including L, C, LL, LC and k2, are defined. Variables L, C, LL, LC and k2 are derived as follows.
As shown in equations (5) through (8), L corresponds to the sum of reconstructed luma samples in the neighboring area of the current block, C corresponds to the sum of reconstructed chroma samples in the neighboring area of the current block, LL corresponds to the sum of squared reconstructed luma samples in the neighboring area of the current block, LC corresponds to the sum of cross-product of reconstructed luma samples and reconstructed chroma samples in the neighboring area of the current block. Furthermore, L, C, LL, and LC are right shifted by k3 bits to take into account of the internal bit depth with which the chroma signal is processed during video coding process (i.e., bitDepthC) and the block size (i.e., nS).
The linear-model parameters a, b and k are derived as follows.
a1=(LC<<k2)−L*C, (10)
a2=(LL<<k2)−L*L, (11)
k1=Max(0, Log2(abs(a2))−5)−Max(0, Log2(abs(a1))−14)+2, (12)
a1s=a1>>Max(0, Log2(abs(a1))−14), (13)
a2s=abs(a2>>Max(0, Log2(abs(a2))−5)), (14)
a3=a2s<1?0:Clip3(−215,215−1,(a1s*lmDiv+(1<<(k1−1)))>>k1), (15)
a=a3>>Max(0, Log2(abs(a3))−6), (16)
k=13−Max(0, Log2(abs(a3))−6), (17)
and
b=(L−((a*C)>>k1)+(1<<(k2−1)))>>k2, (18)
where lmDiv is specified in Table 1 for all a2s values.
Parameter al as defined in equation (10) corresponds to a covariance-like value associated with the neighboring reconstructed luma pixels of the current luma block and the neighboring reconstructed chroma pixels of the current chroma block. The covariance a(X,Y) associated with random variables X and Y are defined as σ(X,Y)=E[XY]−E[X]E[Y], where E[.] is the expected value of the underlying random variable. For a random variable with a uniform distribution, the expected value is equivalent to the average value. Variables L, C, LL, and LC as shown in equations (5) through 8 are right shifted by k3 bits, where k3 is related to the block size (i.e., nS). In other words, if the neighboring reconstructed luma pixels of the current luma block are considered as a first uniformly distributed random variable (i.e., X) and the neighboring reconstructed chroma pixels of the current chroma block are considered as a second uniformly distributed random variable (i.e., Y), al has a form similar to a covariance value for uniformly distributed random variables X and Y. In equation (10), LC is left shifted by k2 bits in order to match the scaling of L*C. Accordingly, a1 as defined in equation (10) has a covariance-like form associated with the neighboring reconstructed luma pixels of the current luma block and the neighboring reconstructed chroma pixels of the current chroma block. The covariance-like value may be scaled to a desired range and the scaling may be performed by left or right shifting the covariance-like value. For example, the scaling of the covariance-like value used in HM-5.0 is shown in equation (13).
Similarly, parameter a2 as defined in equation (11) corresponds to a variance-like value associated with the neighboring reconstructed luma pixels of the current luma block. The variance-like value may be scaled to a desired range and the scaling may be performed by left or right shifting the variance-like value. For example, the scaling of the variance-like value used in HM-5.0 is shown in equation (14). A division factor, lmDiv is then determined by dividing with rounding a first data range by a2s. In HM-5.0, the division with rounding by a2s is implemented using a look-up table as shown in Table 1. In HM-5.0, the first data range corresponds to 2̂15 (i.e., 215). Accordingly, lmDiv=(2̂15+a2s/2)/a2s. An intermediate parameter, a3 is then determined according to a1s*lmDiv, where the product a1s*lmDiv is divided with rounding by 2k1 and the result is clipped between −215 and 215−1 if a2s≧1. If a2s is less than 1, a3 is set to 0. In HM-5.0, derivation of a3 is shown in equation (15), where the division with rounding by 2k1 is implemented by right shifting. The right shifting in equation (15) is performed to reverse the shifting operations that are applied to a1 and a2 in equation (13) and equation (14).
Parameters a and k for the linear model are then determined based on a3 as shown in equations (16) and (17) respectively. The y-intercept, b is determined according to equation (18). Finally, the value of the prediction samples predSamples[x,y] is derived as:
predSamples[x,y]=Clip1C(((pY′[x,y]*a)>>k)+b), (19)
where x, y=0..nS−1 and
Clip1C(w)=Clip3(0, (1<<BitDepthC)−1, w)
clip3(t, u, v)=((v<t)?t:((v>u)?u:v))
As shown above, the derivation of the prediction sample, predSamples[x,y] is very computationally intensive. Not only it involves a large number of computations, it also requires buffer to store the table. Furthermore, some operations may require higher precision. For example, in equation (15), a1s is a signed 15-bit integer, therefore, a1s*lmDiv requires a 15-bit multiplier. This large multiplier introduces higher computational complexity. Therefore, it is desirable to simplify the derivation of the prediction sample.
A method and apparatus for chroma intra prediction based on reconstructed luma pixels and chroma pixels are disclosed. The chroma intra prediction for chroma pixels of the current chroma block is based on a linear model of derived co-located current luma pixels of the current luma block scaled by a scaling factor. The scaling factor comprises a product term of a division factor and a scaled covariance-like value associated with the neighboring reconstructed luma pixels of the current luma block and the neighboring reconstructed chroma pixels of the current chroma block. The division factor is related to a first data range divided with rounding by a scaled variance-like value associated with the neighboring reconstructed luma pixels of the current luma block. In a system incorporating an embodiment of the present invention, the scaled covariance-like value, the first data range, or both of the scaled covariance-like value and the first data range are dependent on the internal bit depth with which the chroma signal is processed during video coding process.
In one embodiment, the scaled covariance-like value, als is derived according to a1s=a1>>Max(0, Log2(abs(a1))−(BitDepthC−2)), where a1 represents the covariance-like value, and BitDepthC represents the internal bit depth with which the chroma signal is process in video codec. In another embodiment of the present invention, the first data range corresponds to 2̂(BitDepthC+n), where n is an integer from −2 to +4. The division factor can be derived using a look-up table with the scaled variance-like value as the table input. Some table entries can be omitted depending on the selected first data range. Besides, the division factor can also be calculated by dividing with rounding by the scaled variance-like value during coding process.
As mentioned before, the existing LM mode derivation is quite complicated. Some operations require higher arithmetic accuracy, such as the a1s*lmDiv operation. Therefore, in one embodiment of the present invention, the complexity of the a1s*lmDiv operation is reduced by incorporating the internal bit depth, with which the chroma signal is processed during video coding process, in the a1s derivation. As an example, the shift operation for al s incorporating an embodiment of the present invention becomes:
a1s=a1>>Max(0, Log2(abs(a1))−(BitDepthC−2)). (20)
In equation (20), the constant value (i.e. 14) of equation (13) is replaced by (BitDepthC−2). Accordingly, the number of bits of a1s is limited to the bit depth of the chroma signal (i.e., BitDepthC) minus one and plus one sign bit. Furthermore, lmDiv is changed from (2̂15+a2s/2)/a2s to (2̂(BitDepthC−1)+a2s/2)/a2s. Therefore, lmDiv will be less than (2̂BitDepthC) when a2s is equal to 1. As mentioned before, the derivation of lmDiv from a2s, i.e., lmDiv=(2̂(BitDepthC−1)+a2s/2)/a2s, can be implemented as a look-up table. Table 2 illustrates the values of lmDiv for BitDepthC=8. Table 3 illustrates the values of lmDiv for BitDepthC=10.
Along with the new a1s as shown in equation (20) and lmDiv (i.e., (2̂(BitDepthC−1)+a2s/2)/a2s) mentioned above, other variables that require modification are as follows:
k1=Max(0,Log2(abs(a2))−5)−Max(0,Log2(abs(a1))−(BitDepthC−2)), (21)
k=BitDepthC−1−Max(0, Log2(abs(a3))−6). (22)
In another embodiment, lmDiv is set to (2̂(BitDepthC−2)+a2s/2)/a2s. Therefore, lmDiv is less than (2̂(BitDepthC−1)) when a2s is equal to 1. Table 4 illustrates the values of lmDiv for BitDepthC=8. Table 5 illustrates the values of lmDiv for BitDepthC=10.
For the lmDiv (i.e., (2̂(BitDepthC−2)+a2s/2)/a2s) mentioned above, variable k is defined as follows:
k=BitDepthC−2−Max(0, Log2(abs(a3))−6). (23)
In yet another embodiment, lmDiv is set to (2̂(BitDepthC+2)+a2s/2)/a2s. In this case, lmDiv will be less than 2̂BitDepthC for a2s>=7. Accordingly, Table 6 illustrates the values of lmDiv for BitDepthC=8. Table 7 illustrates the values of lmDiv for BitDepthC=10. In Tables 6 and 7, there are no entries for a2s <7 since a2s is impossible to be any value from 1 to 6.
For the lmDiv (i.e., (2̂(BitDepthC+2)+a2s/2)/a2s) mentioned above, variable a3 and k are defined as follows:
a3=a2s<7?0:Clip3(−215, 215−1,a1s*lmDiv+(1<<(k1−1))>>k1), (24)
k=BitDepth
C+2−Max(0, Log2(abs(a3))−6). (25)
In yet another embodiment, lmDiv is changed to (2̂(BitDepthC+1)+a2s/2)/a2s and this will ensure lmDiv<2̂(BitDepthC−1) for a2s>=7. Table 8 illustrates the values of lmDiv for BitDepthC=8. Table 9 illustrates the values of lmDiv for BitDepthC =10. In Tables 8 and 9, there are no entries for a2s <7 since a2s is impossible to be any value from 1 to 6.
For the lmDiv (i.e., (2̂(BitDepthC+1)+a2s/2)/a2s) mentioned above, variable a3 and k is defined as follows:
a3=a2s<7?0:Clip3(−215, 215−1,a1s*lmDiv+(1<<(k1−1))>>k1), (26)
k=BitDepth
C+1−Max(0, Log2(abs(a3))−6). (27)
In another embodiment, lmDiv is set to (2̂(BitDepthC+4)+a2s/2)/a2s and a3 in equation (15) is set to zero for a2s<32. In this case, lmDiv<2̂(BitDepthC) for a2s>=32. Table 10 illustrates the values of lmDiv for BitDepthC=8. Table 11 illustrates the values of lmDiv for BitDepthC=10. There is no need for table entries corresponding to a2s<32 since lmDiv is set to 0 in this case.
For the lmDiv (i.e., (2̂(BitDepthC+4)+a2s/2)/a2s) and a3 mentioned above, other variables that require modification are as follows:
a3=a2s<32?0:Clip3(−215, 215−1,a1s*lmDiv+(1<<(k1−1))>>k1), (28)
k=BitDepthC+4−Max(0, Log2(abs(a3))−6). (29)
In another embodiment, lmDiv is set to (2̂(BitDepthC+3)+a2s/2)/a2s and a3 in equation (15) is set to zero for a2s<32. In this case, lmDiv will be less than 2̂(BitDepthC−1) for a2s>=32. Table 12 illustrates the values of lmDiv for BitDepthC=8. Table 13 illustrates the values of 1mDiv for BitDepthC=10. There is no need for table entries corresponding to a2s<32 since lmDiv is set to 0 in this case.
For the lmDiv (i.e., (2̂(BitDepthC+3)+a2s/2)/a2s) and a3 mentioned above, other variables that require modification are as follows:
a3=a2s<32?0:Clip3(−215, 215−1,a1s*lmDiv+(1<<(k1−1))>>k1), (30)
k=BitDepthC+3−Max(0, Log2(abs(a3))−6). (31)
The LM-mode chroma intra prediction method described above can be used in a video encoder as well as a video decoder.
The flowcharts shown above are intended to illustrate examples of a luma-based chroma intra prediction method for a video encoder and a decoder incorporating embodiments of the present invention. A person skilled in the art may modify each step, re-arranges the steps, split a step, or combine the steps to practice the present invention without departing from the spirit of the present invention.
The above description is presented to enable a person of ordinary skill in the art to practice the present invention as provided in the context of a particular application and its requirement. Various modifications to the described embodiments will be apparent to those with skill in the art, and the general principles defined herein may be applied to other embodiments. Therefore, the present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed. In the above detailed description, various specific details are illustrated in order to provide a thorough understanding of the present invention. Nevertheless, it will be understood by those skilled in the art that the present invention may be practiced.
Embodiment of the present invention as described above may be implemented in various hardware, software codes, or a combination of both. For example, an embodiment of the present invention can be a circuit integrated into a video compression chip or program code integrated into video compression software to perform the processing described herein. An embodiment of the present invention may also be program code to be executed on a Digital Signal Processor (DSP) to perform the processing described herein. The invention may also involve a number of functions to be performed by a computer processor, a digital signal processor, a microprocessor, or field programmable gate array (FPGA). These processors can be configured to perform particular tasks according to the invention, by executing machine-readable software code or firmware code that defines the particular methods embodied by the invention. The software code or firmware code may be developed in different programming languages and different formats or styles. The software code may also be compiled for different target platforms. However, different code formats, styles and languages of software codes and other means of configuring code to perform the tasks in accordance with the invention will not depart from the spirit and scope of the invention.
The invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described examples are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope.
Number | Date | Country | Kind |
---|---|---|---|
PCT/CN2012/074118 | Apr 2012 | CN | national |
The present invention claims priority to PCT Patent Application, Ser. No. PCTCN2012074118, filed Apr. 16, 2012, entitled “Improvements of Luma-based Chroma Intra Prediction”. The PCT Patent Application is hereby incorporated by reference in its entirety.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2013/070912 | 1/24/2013 | WO | 00 |