[AV1] Superblock and Block

返回目录

Superblock

Superblock,暂且就叫它“超级块”吧。

从上一节我们知道,在AV1中,一帧先是分为一个或多个tile,然后由tile再进行细分为Superblock,超级块的大小,以灰度成分为基准,可以有128x128和64x64两种尺寸的选择。AV1中的Superblock与HEVC中的CTU(Coding Tree Unit)是同样的概念。如果是4:2:0的分量采样后得到的Y,U,V分量大小如下:

Superblock 大小 Y成分大小 U/V成分大小
64x64 64x64 32x32
128x128 128x128 64x64

若一个tile的大小为128x128,那么它分为四个Superblock的情况可以如下图

tile分为Superblock
在参考软件av1的源码中,一个tile分割成若干个superblock,然后以光栅顺序(raster scan order)进行解码。(代码有简化

void decode_tile(AV1Decoder *pbi, ThreadData *const td, int tile_row, int tile_col) 
{
    
    
	for (int mi_row = tile_info.mi_row_start; mi_row < tile_info.mi_row_end; mi_row += cm->seq_params.mib_size) // 行
	{
    
    
    	for (int mi_col = tile_info.mi_col_start; mi_col < tile_info.mi_col_end; mi_col += cm->seq_params.mib_size)  // 列
    	{
    
    
      		// Bit-stream parsing and decoding of the superblock
      		decode_partition(pbi, td, mi_row, mi_col, td->bit_reader, cm->seq_params.sb_size, 0x3);
      	}
    }
}

扫描顺序如下图所示
superblock

Block

AV1的快划分方式一共有十种,包括

  • 不划分 (2NX2N)
  • 矩形划分 Rectangular (NX2N, 2NXN)
  • 递归划分 Recursive (NXN)
  • AB 划分(partition) (HORZ_A, HORZ_B, VERT_A, VERT_B)
  • 1to4 划分(partition) (HORZ_4, VERT_4)

具体的划分情况如下图:
block partition
AV1中的Superblock有128x128和64x64两种尺寸,但是当Superblock是128x128大小的时候,10 种划分方式中仅有8种划分适用于128的块。这就意味着不存在128X32 或者 32X128 的块。然后128x128的所有划分方式中,2Nx2N的Recursive划分方式得到四个等尺寸的64x64的块,这四个64x64的话可以继续各有10种的划分方式,除此之外,其他的划分方式不能继续向下划分。
recursive partition
一直到16x16,通过recursive partition获得8x8的块,然后8x8的块进进行一次recursive 划分到4x4即最小的块了,与8x8同一级的还有8x4和4x8的划分。

在AV1的代码中,对各种的划分有相应的MACRO定义。

Partition Name of partition
0 PARTITION_NONE
1 PARTITION_HORZ
2 PARTITION_VERT
3 PARTITION_SPLIT
4 PARTITION_HORZ_A
5 PARTITION_HORZ_B
6 PARTITION_VERT_A
7 PARTITION_VERT_B
8 PARTITION_HORZ_4
9 PARTITION_VERT_4

猜你喜欢

转载自blog.csdn.net/starperfection/article/details/109147142