HEVC学习(1)——Intra Prediction
在网上看到一篇学习HEVC帧内预测的文章http://blog.csdn.net/hevc_cjl/article/details/8175721
于是对应去看了一下文章中提到的相关文件的相关章节。
以前没有学习过视频编码的东西,也没有接触过H.264,就直接来HEVC了,看得云里雾里不知道从何下手。
__________________________________________________________________________________________________________________________
官方当前标准(JCTVC-J1003)draft 8.4.4.2.2(Reference sample substitution process for intra sample prediction)
8.4.4.2.2 Reference sample substitution process for intra sample prediction
Inputs to this process are:
– reference samples p[ x ][ y ] with x = −1, y = −1..nT*2−1 and x = 0..nT*2−1, y = −1 for intra sample prediction,
– a transform block size nT.
Outputs of this process are:
– the modified reference samples p[ x ][ y ] with x = −1, y = −1..nT*2−1 and x = 0..nT*2−1, y = −1 for intra sample prediction.
The values of the samples p[ x ][ y ] with x = −1, y = −1..nT*2−1 and x = 0..nT*2−1, y = −1 are modified as follows:
– If all samples p[ x ][ y ] with x = −1, y = −1..nT*2−1 and x = 0..nT*2−1, y = −1 are marked as "not available for intra prediction," the value ( 1 << ( BitDepthY − 1 ) ) is substituted for the values of all samples p[ x ][ y ].
– Otherwise (at least one but not all samples p[ x ][ y ] are marked as "not available for intra prediction"), the following ordered steps are performed:
- If p[ −1 ][ nT*2−1 ] is marked as "not available for intra prediction", searching sequentially starting from x = −1, y = nT*2−1 to x = −1, y = −1, then from x = 0, y = −1 to x = nT*2−1, y = −1. As soon as a sample p[ x ][ y ] marked as "available for intra prediction" is found, the search is terminated and the value of p[ x ][ y ] is assigned to p[ −1 ][ nT*2−1 ].
- For x = −1, y = nT*2−2...−1, if p[ x ][ y ] is marked as "not available for intra prediction", the value of p[ x ][ y+1 ] is substituted for the value of p[ x ][ y].
- For x = 0..nT*2−1, y = −1, if p[ x ][ y ] is marked as "not available for intra prediction", the value of p[ x−1 ][ y ] is substituted for the value of p[ x ][ y ].
All samples p[ x ][ y ] with x = −1, y = −1..nT*2−1 and x = 0..nT*2−1, y = −1 are marked as "available for intra prediction".
__________________________________________________________________________________________________________________________
1 << ( BitDepthY − 1 ) ,其中 BitDepthY指的是Y分量的bitdepth,通常都是8bit,所以 BitDepthY − 1 为7;<< 代表位运算左移,每左移一次相当于乘以2,所以最后的值为128.
1、如果黄色区域的sample全部都unavailable的话,就都填充为128.
2、如果黄色区域的sample不是全部都unavailable的话:
a. 如果左下角的unavailable,那么按照从下往上,从左往右的顺序搜索,找到第一个available的,复制给左下角;
b. 左下角的填充完了之后,按照从下往上,从左往右的顺序依次填充,如果某个sample是unavailable的,那么用它的前一个去填充它。