summaryrefslogtreecommitdiffstats
path: root/third_party/aom/av1/common/common_data.h
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-18 06:04:57 -0500
committertrav90 <travawine@palemoon.org>2018-10-18 06:04:57 -0500
commit7369c7d7a5eed32963d8af37658286617919f91c (patch)
tree5397ce7ee9bca1641118fdc3187bd9e2b24fdc9c /third_party/aom/av1/common/common_data.h
parent77887af9c4ad1420bbdb33984af4f74b55ca59db (diff)
downloadUXP-7369c7d7a5eed32963d8af37658286617919f91c.tar
UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.gz
UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.lz
UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.xz
UXP-7369c7d7a5eed32963d8af37658286617919f91c.zip
Update aom to commit id f5bdeac22930ff4c6b219be49c843db35970b918
Diffstat (limited to 'third_party/aom/av1/common/common_data.h')
-rw-r--r--third_party/aom/av1/common/common_data.h611
1 files changed, 465 insertions, 146 deletions
diff --git a/third_party/aom/av1/common/common_data.h b/third_party/aom/av1/common/common_data.h
index 7eae71a4f..f49c7335a 100644
--- a/third_party/aom/av1/common/common_data.h
+++ b/third_party/aom/av1/common/common_data.h
@@ -28,13 +28,13 @@ extern "C" {
// Log 2 conversion lookup tables for block width and height
static const uint8_t b_width_log2_lookup[BLOCK_SIZES_ALL] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0, 0, 0,
#endif
0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, IF_EXT_PARTITION(4, 5, 5) 0, 2, 1, 3
};
static const uint8_t b_height_log2_lookup[BLOCK_SIZES_ALL] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0, 0, 0,
#endif
0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, IF_EXT_PARTITION(5, 4, 5) 2, 0, 3, 1
@@ -42,17 +42,21 @@ static const uint8_t b_height_log2_lookup[BLOCK_SIZES_ALL] = {
// Log 2 conversion lookup tables for modeinfo width and height
static const uint8_t mi_width_log2_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4
- 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, IF_EXT_PARTITION(4, 5, 5) 0,
- 2, 1, 3
-#else
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
+ 0, 0, 0,
+#endif
+ 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, IF_EXT_PARTITION(4, 5, 5) 0, 2, 1, 3
+#else // CONFIG_CB4X4
0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, IF_EXT_PARTITION(3, 4, 4) 0, 1, 0, 2
#endif
};
static const uint8_t mi_height_log2_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4
- 0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, IF_EXT_PARTITION(5, 4, 5) 2,
- 0, 3, 1
-#else
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
+ 0, 0, 0,
+#endif
+ 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, IF_EXT_PARTITION(5, 4, 5) 2, 0, 3, 1
+#else // CONFIG_CB4X4
0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, IF_EXT_PARTITION(4, 3, 4) 1, 0, 2, 0
#endif
};
@@ -60,17 +64,23 @@ static const uint8_t mi_height_log2_lookup[BLOCK_SIZES_ALL] = {
/* clang-format off */
static const uint8_t mi_size_wide[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4
- 1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16,
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
+ 1, 1, 1,
+#endif
+ 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16,
IF_EXT_PARTITION(16, 32, 32) 1, 4, 2, 8
-#else
+#else // CONFIG_CB4X4
1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, IF_EXT_PARTITION(8, 16, 16) 1, 2, 1, 4
#endif
};
static const uint8_t mi_size_high[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4
- 1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16,
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
+ 1, 1, 1,
+#endif
+ 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16,
IF_EXT_PARTITION(32, 16, 32) 4, 1, 8, 2
-#else
+#else // CONFIG_CB4X4
1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, IF_EXT_PARTITION(16, 8, 16) 2, 1, 4, 1
#endif
};
@@ -78,7 +88,7 @@ static const uint8_t mi_size_high[BLOCK_SIZES_ALL] = {
// Width/height lookup tables in units of various block sizes
static const uint8_t block_size_wide[BLOCK_SIZES_ALL] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2, 2, 4,
#endif
4, 4, 8, 8, 8, 16, 16,
@@ -87,7 +97,7 @@ static const uint8_t block_size_wide[BLOCK_SIZES_ALL] = {
};
static const uint8_t block_size_high[BLOCK_SIZES_ALL] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2, 4, 2,
#endif
4, 8, 4, 8, 16, 8, 16,
@@ -96,54 +106,54 @@ static const uint8_t block_size_high[BLOCK_SIZES_ALL] = {
};
static const uint8_t num_4x4_blocks_wide_lookup[BLOCK_SIZES_ALL] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1,
#endif
1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, IF_EXT_PARTITION(16, 32, 32) 1,
4, 2, 8
};
static const uint8_t num_4x4_blocks_high_lookup[BLOCK_SIZES_ALL] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1,
#endif
1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16, IF_EXT_PARTITION(32, 16, 32) 4,
1, 8, 2
};
static const uint8_t num_8x8_blocks_wide_lookup[BLOCK_SIZES_ALL] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1,
#endif
1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, IF_EXT_PARTITION(8, 16, 16) 1, 2, 1, 4
};
static const uint8_t num_8x8_blocks_high_lookup[BLOCK_SIZES_ALL] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1,
#endif
1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, IF_EXT_PARTITION(16, 8, 16) 2, 1, 4, 1
};
static const uint8_t num_16x16_blocks_wide_lookup[BLOCK_SIZES_ALL] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1,
#endif
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 4, IF_EXT_PARTITION(4, 8, 8) 1, 1, 1, 2
};
static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES_ALL] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1,
#endif
1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 4, 2, 4, IF_EXT_PARTITION(8, 4, 8) 1, 1, 2, 1
};
// AOMMIN(3, AOMMIN(b_width_log2(bsize), b_height_log2(bsize)))
-static const uint8_t size_group_lookup[BLOCK_SIZES] = {
-#if CONFIG_CB4X4
+static const uint8_t size_group_lookup[BLOCK_SIZES_ALL] = {
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0, 0, 0,
#endif
- 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, IF_EXT_PARTITION(3, 3, 3)
+ 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, IF_EXT_PARTITION(3, 3, 3) 0, 0, 1, 1
};
static const uint8_t num_pels_log2_lookup[BLOCK_SIZES_ALL] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2, 3, 3,
#endif
4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, IF_EXT_PARTITION(13, 13, 14) 6,
@@ -152,9 +162,9 @@ static const uint8_t num_pels_log2_lookup[BLOCK_SIZES_ALL] = {
/* clang-format off */
static const PARTITION_TYPE
- partition_lookup[MAX_SB_SIZE_LOG2 - 1][BLOCK_SIZES] = {
+ partition_lookup[MAX_SB_SIZE_LOG2 - 1][BLOCK_SIZES_ALL] = {
{ // 4X4 ->
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
@@ -171,8 +181,12 @@ static const PARTITION_TYPE
#if CONFIG_EXT_PARTITION
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION
+ // 4x16, 16x4, 8x32
+ PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
+ // 32x8
+ PARTITION_INVALID
}, { // 8X8 ->
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
@@ -190,8 +204,12 @@ static const PARTITION_TYPE
// 64x128, 128x64, 128x128
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION
+ // 4x16, 16x4, 8x32
+ PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
+ // 32x8
+ PARTITION_INVALID
}, { // 16X16 ->
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
@@ -209,8 +227,19 @@ static const PARTITION_TYPE
// 64x128, 128x64, 128x128
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION
+#if CONFIG_EXT_PARTITION_TYPES
+ // 4x16, 16x4, 8x32
+ PARTITION_VERT_4, PARTITION_HORZ_4, PARTITION_INVALID,
+ // 32x8
+ PARTITION_INVALID
+#else
+ // 4x16, 16x4, 8x32
+ PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
+ // 32x8
+ PARTITION_INVALID
+#endif
}, { // 32X32 ->
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
@@ -228,8 +257,19 @@ static const PARTITION_TYPE
// 64x128, 128x64, 128x128
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION
+#if CONFIG_EXT_PARTITION_TYPES
+ // 4x16, 16x4, 8x32
+ PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_VERT_4,
+ // 32x8
+ PARTITION_HORZ_4
+#else
+ // 4x16, 16x4, 8x32
+ PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
+ // 32x8
+ PARTITION_INVALID
+#endif
}, { // 64X64 ->
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
@@ -246,8 +286,21 @@ static const PARTITION_TYPE
#if CONFIG_EXT_PARTITION
// 64x128, 128x64, 128x128
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
+#endif // CONFIG_EXT_PARTITION
+#if CONFIG_EXT_PARTITION_TYPES
+ // 4x16, 16x4, 8x32
+ PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT,
+ // 32x8
+ PARTITION_SPLIT
+#else
+ // 4x16, 16x4, 8x32
+ PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
+ // 32x8
+ PARTITION_INVALID
+#endif // CONFIG_EXT_PARTITION_TYPES
+#if CONFIG_EXT_PARTITION
}, { // 128x128 ->
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
@@ -263,18 +316,29 @@ static const PARTITION_TYPE
PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT,
// 64x128, 128x64, 128x128
PARTITION_VERT, PARTITION_HORZ, PARTITION_NONE,
+#if CONFIG_EXT_PARTITION_TYPES
+ // 4x16, 16x4, 8x32
+ PARTITION_SPLIT, PARTITION_SPLIT, PARTITION_SPLIT,
+ // 32x8
+ PARTITION_SPLIT
+#else
+ // 4x16, 16x4, 8x32
+ PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
+ // 32x8
+ PARTITION_INVALID
+#endif // CONFIG_EXT_PARTITION_TYPES
#endif // CONFIG_EXT_PARTITION
}
};
#if CONFIG_EXT_PARTITION_TYPES
-static const BLOCK_SIZE subsize_lookup[EXT_PARTITION_TYPES][BLOCK_SIZES] =
+static const BLOCK_SIZE subsize_lookup[EXT_PARTITION_TYPES][BLOCK_SIZES_ALL] =
#else
-static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
+static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES_ALL] =
#endif // CONFIG_EXT_PARTITION_TYPES
{
{ // PARTITION_NONE
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
BLOCK_2X2, BLOCK_2X4, BLOCK_4X2,
#endif
@@ -292,8 +356,12 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
// 64x128, 128x64, 128x128
BLOCK_64X128, BLOCK_128X64, BLOCK_128X128,
#endif // CONFIG_EXT_PARTITION
+ // 4X16, 16X4, 8X32
+ BLOCK_4X16, BLOCK_16X4, BLOCK_8X32,
+ // 32X8,
+ BLOCK_32X8,
}, { // PARTITION_HORZ
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
// 4X4
@@ -314,8 +382,12 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
// 64x128, 128x64, 128x128
BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64,
#endif // CONFIG_EXT_PARTITION
+ // 4X16, 16X4, 8X32
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 32X8,
+ BLOCK_INVALID,
}, { // PARTITION_VERT
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
// 4X4
@@ -336,8 +408,12 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
// 64x128, 128x64, 128x128
BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X128,
#endif // CONFIG_EXT_PARTITION
+ // 4X16, 16X4, 8X32
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 32X8,
+ BLOCK_INVALID,
}, { // PARTITION_SPLIT
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
@@ -355,9 +431,13 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
// 64x128, 128x64, 128x128
BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X64,
#endif // CONFIG_EXT_PARTITION
+ // 4X16, 16X4, 8X32
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 32X8,
+ BLOCK_INVALID,
#if CONFIG_EXT_PARTITION_TYPES
}, { // PARTITION_HORZ_A
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
@@ -375,8 +455,12 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
// 64x128, 128x64, 128x128
BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64,
#endif // CONFIG_EXT_PARTITION
+ // 4X16, 16X4, 8X32
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 32X8,
+ BLOCK_INVALID,
}, { // PARTITION_HORZ_B
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
@@ -394,8 +478,12 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
// 64x128, 128x64, 128x128
BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64,
#endif // CONFIG_EXT_PARTITION
+ // 4X16, 16X4, 8X32
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 32X8,
+ BLOCK_INVALID,
}, { // PARTITION_VERT_A
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
@@ -413,8 +501,12 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
// 64x128, 128x64, 128x128
BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X128,
#endif // CONFIG_EXT_PARTITION
+ // 4X16, 16X4, 8X32
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 32X8,
+ BLOCK_INVALID,
}, { // PARTITION_VERT_B
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
@@ -432,15 +524,71 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
// 64x128, 128x64, 128x128
BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X128,
#endif // CONFIG_EXT_PARTITION
+ // 4X16, 16X4, 8X32
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 32X8,
+ BLOCK_INVALID,
+ }, { // PARTITION_HORZ_4
+#if CONFIG_CB4X4
+ // 2X2, 2X4, 4X2,
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 4X4
+ BLOCK_INVALID,
+#else
+ // 4X4
+ BLOCK_INVALID,
+#endif
+ // 4X8, 8X4, 8X8
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 8X16, 16X8, 16X16
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X4,
+ // 16X32, 32X16, 32X32
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_32X8,
+ // 32X64, 64X32, 64X64
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+#if CONFIG_EXT_PARTITION
+ // 64x128, 128x64, 128x128
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+#endif // CONFIG_EXT_PARTITION
+ // 4X16, 16X4, 8X32
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 32X8,
+ BLOCK_INVALID,
+ }, { // PARTITION_VERT_4
+#if CONFIG_CB4X4
+ // 2X2, 2X4, 4X2,
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 4X4
+ BLOCK_INVALID,
+#else
+ // 4X4
+ BLOCK_INVALID,
+#endif
+ // 4X8, 8X4, 8X8
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 8X16, 16X8, 16X16
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_4X16,
+ // 16X32, 32X16, 32X32
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X32,
+ // 32X64, 64X32, 64X64
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+#if CONFIG_EXT_PARTITION
+ // 64x128, 128x64, 128x128
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+#endif // CONFIG_EXT_PARTITION
+ // 4X16, 16X4, 8X32
+ BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
+ // 32X8,
+ BLOCK_INVALID,
#endif // CONFIG_EXT_PARTITION_TYPES
}
};
-static const TX_SIZE max_txsize_lookup[BLOCK_SIZES] = {
+static const TX_SIZE max_txsize_lookup[BLOCK_SIZES_ALL] = {
// 2X2, 2X4, 4X2,
#if CONFIG_CHROMA_2X2
TX_2X2, TX_2X2, TX_2X2,
-#elif CONFIG_CB4X4
+#elif CONFIG_CHROMA_SUB8X8
TX_4X4, TX_4X4, TX_4X4,
#endif
// 4X4
@@ -468,16 +616,20 @@ static const TX_SIZE max_txsize_lookup[BLOCK_SIZES] = {
TX_32X32, TX_32X32, TX_32X32,
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_TX64X64
+ // 4x16, 16x4, 8x32
+ TX_4X4, TX_4X4, TX_8X8,
+ // 32x8
+ TX_8X8
};
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
-static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES] = {
+static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES_ALL] = {
// 2X2, 2X4, 4X2,
#if CONFIG_CHROMA_2X2
TX_2X2, TX_2X2, TX_2X2,
-#elif CONFIG_CB4X4
+#elif CONFIG_CHROMA_SUB8X8
TX_4X4, TX_4X4, TX_4X4,
-#endif
+#endif // CONFIG_CHROMA_SUB8X8
// 4X4
TX_4X4,
// 4X8, 8X4, 8X8
@@ -503,11 +655,22 @@ static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES] = {
TX_32X32, TX_32X32, TX_32X32,
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_TX64X64
+#if CONFIG_RECT_TX_EXT
+ // 4x16, 16x4, 8x32
+ TX_4X16, TX_16X4, TX_8X32,
+ // 32x8
+ TX_32X8
+#else
+ // 4x16, 16x4, 8x32
+ TX_4X8, TX_8X4, TX_8X16,
+ // 32x8
+ TX_16X8
+#endif
};
-#if CONFIG_EXT_TX && CONFIG_RECT_TX_EXT
-static const TX_SIZE quarter_txsize_lookup[BLOCK_SIZES] = {
-#if CONFIG_CB4X4
+#if CONFIG_RECT_TX_EXT
+static const TX_SIZE quarter_txsize_lookup[BLOCK_SIZES_ALL] = {
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
TX_INVALID, TX_INVALID, TX_INVALID,
#endif
@@ -525,8 +688,12 @@ static const TX_SIZE quarter_txsize_lookup[BLOCK_SIZES] = {
// 64x128, 128x64, 128x128
TX_INVALID, TX_INVALID, TX_INVALID,
#endif
+ // 4x16, 16x4, 8x32
+ TX_4X16, TX_16X4, TX_8X32,
+ // 32x8
+ TX_32X8
};
-#endif // CONFIG_EXT_TX && CONFIG_RECT_TX_EXT
+#endif
#else
#define max_txsize_rect_lookup max_txsize_lookup
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
@@ -551,15 +718,17 @@ static const TX_TYPE_1D htx_tab[TX_TYPES] = {
// Same as "max_txsize_lookup[bsize] - TX_8X8", except for rectangular
// block which may use a rectangular transform, in which case it is
// "(max_txsize_lookup[bsize] + 1) - TX_8X8", invalid for bsize < 8X8
-static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES] = {
+static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
INT32_MIN, INT32_MIN, INT32_MIN,
+#endif
// 4X4,
INT32_MIN,
// 4X8, 8X4, 8X8,
TX_8X8 - TX_8X8, TX_8X8 - TX_8X8, TX_8X8 - TX_8X8,
-#else
+#else // CONFIG_CB4X4
// 4X4
INT32_MIN,
// 4X8, 8X4, 8X8
@@ -586,11 +755,17 @@ static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES] = {
TX_32X32 - TX_8X8, TX_32X32 - TX_8X8, TX_32X32 - TX_8X8,
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_TX64X64
+ // TODO(david.barker): Change these if we support rectangular transforms
+ // for 4:1 shaped partitions
+ // 4x16, 16x4, 8x32
+ INT32_MIN, INT32_MIN, TX_8X8 - TX_8X8,
+ // 32x8
+ TX_8X8 - TX_8X8
};
#else
// Same as "max_txsize_lookup[bsize] - TX_8X8", invalid for bsize < 8X8
-static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES] = {
-#if CONFIG_CB4X4
+static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES_ALL] = {
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2,
INT32_MIN, INT32_MIN, INT32_MIN,
#endif
@@ -619,6 +794,10 @@ static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES] = {
TX_32X32 - TX_8X8, TX_32X32 - TX_8X8, TX_32X32 - TX_8X8,
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_TX64X64
+ // 4x16, 16x4, 8x32
+ INT32_MIN, INT32_MIN, TX_8X8 - TX_8X8,
+ // 32x8
+ TX_8X8 - TX_8X8
};
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
@@ -887,16 +1066,20 @@ static const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES] = {
};
/* clang-format on */
-static const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2] = {
+static const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES_ALL][2][2] = {
// ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1
// ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ { BLOCK_2X2, BLOCK_INVALID }, { BLOCK_INVALID, BLOCK_INVALID } },
{ { BLOCK_2X4, BLOCK_INVALID }, { BLOCK_INVALID, BLOCK_INVALID } },
{ { BLOCK_4X2, BLOCK_INVALID }, { BLOCK_INVALID, BLOCK_INVALID } },
{ { BLOCK_4X4, BLOCK_4X2 }, { BLOCK_2X4, BLOCK_2X2 } },
{ { BLOCK_4X8, BLOCK_4X4 }, { BLOCK_INVALID, BLOCK_2X4 } },
{ { BLOCK_8X4, BLOCK_INVALID }, { BLOCK_4X4, BLOCK_4X2 } },
+#elif CONFIG_CB4X4
+ { { BLOCK_4X4, BLOCK_4X4 }, { BLOCK_4X4, BLOCK_4X4 } },
+ { { BLOCK_4X8, BLOCK_4X4 }, { BLOCK_INVALID, BLOCK_4X4 } },
+ { { BLOCK_8X4, BLOCK_INVALID }, { BLOCK_4X4, BLOCK_4X4 } },
#else
{ { BLOCK_4X4, BLOCK_INVALID }, { BLOCK_INVALID, BLOCK_INVALID } },
{ { BLOCK_4X8, BLOCK_4X4 }, { BLOCK_INVALID, BLOCK_INVALID } },
@@ -917,12 +1100,15 @@ static const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2] = {
{ { BLOCK_128X64, BLOCK_INVALID }, { BLOCK_64X64, BLOCK_64X32 } },
{ { BLOCK_128X128, BLOCK_128X64 }, { BLOCK_64X128, BLOCK_64X64 } },
#endif // CONFIG_EXT_PARTITION
+ { { BLOCK_4X16, BLOCK_4X8 }, { BLOCK_INVALID, BLOCK_INVALID } },
+ { { BLOCK_16X4, BLOCK_INVALID }, { BLOCK_8X4, BLOCK_INVALID } },
+ { { BLOCK_8X32, BLOCK_8X16 }, { BLOCK_INVALID, BLOCK_4X16 } },
+ { { BLOCK_32X8, BLOCK_INVALID }, { BLOCK_16X8, BLOCK_16X4 } },
};
-static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
+static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES_ALL][TX_SIZES_ALL][2][2] = {
// ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1
// ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1
-#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{
// BLOCK_2X2
@@ -940,10 +1126,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
},
{
// BLOCK_2X4
@@ -961,10 +1147,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
},
{
// BLOCK_2X4
@@ -982,12 +1168,12 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
},
-#else // CONFIG_CHROMA_2X2
+#elif CONFIG_CHROMA_SUB8X8
{
// BLOCK_2X2
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
@@ -1003,10 +1189,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
},
{
// BLOCK_2X4
@@ -1023,10 +1209,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
},
{
// BLOCK_2X4
@@ -1043,12 +1229,11 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
},
-#endif // CONFIG_CHROMA_2X2
#endif
{
// BLOCK_4X4
@@ -1070,10 +1255,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
},
{
// BLOCK_4X8
@@ -1099,10 +1284,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_4X8, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X8, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X8, TX_4X4 }, { TX_4X4, TX_4X4 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X8, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X8, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X8, TX_4X4 }, { TX_4X4, TX_4X4 } },
},
{
// BLOCK_8X4
@@ -1128,10 +1313,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_8X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
},
{
// BLOCK_8X8
@@ -1151,10 +1336,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_8X8, TX_8X4 }, { TX_4X8, TX_4X4 } },
{ { TX_8X8, TX_8X4 }, { TX_4X8, TX_4X4 } },
{ { TX_8X8, TX_8X4 }, { TX_4X8, TX_4X4 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X8, TX_4X4 }, { TX_4X8, TX_4X4 } },
+ { { TX_8X4, TX_8X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X8, TX_8X4 }, { TX_4X8, TX_4X4 } },
+ { { TX_8X8, TX_8X4 }, { TX_4X8, TX_4X4 } },
},
{
// BLOCK_8X16
@@ -1175,9 +1360,9 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_8X16, TX_8X8 }, { TX_4X8, TX_4X8 } },
{ { TX_8X16, TX_8X8 }, { TX_4X8, TX_4X8 } },
{ { TX_4X16, TX_4X8 }, { TX_4X16, TX_4X8 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_8X4, TX_8X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X16, TX_8X8 }, { TX_4X16, TX_4X8 } },
+ { { TX_8X8, TX_8X8 }, { TX_4X8, TX_4X8 } },
},
{
// BLOCK_16X8
@@ -1197,10 +1382,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_16X8, TX_8X4 }, { TX_8X8, TX_8X4 } }, // used
{ { TX_16X8, TX_8X4 }, { TX_8X8, TX_8X4 } },
{ { TX_16X8, TX_8X4 }, { TX_8X8, TX_8X4 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X8, TX_4X4 }, { TX_4X8, TX_4X4 } },
{ { TX_16X4, TX_16X4 }, { TX_8X4, TX_8X4 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_8X8, TX_8X4 }, { TX_8X8, TX_8X4 } },
+ { { TX_16X8, TX_16X4 }, { TX_8X8, TX_8X4 } },
},
{
// BLOCK_16X16
@@ -1220,10 +1405,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_16X8, TX_16X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X16, TX_16X8 }, { TX_8X16, TX_8X8 } },
{ { TX_16X16, TX_16X8 }, { TX_8X16, TX_8X8 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X16, TX_4X8 }, { TX_4X16, TX_4X8 } },
+ { { TX_16X4, TX_16X4 }, { TX_8X4, TX_8X4 } },
+ { { TX_8X16, TX_8X8 }, { TX_8X16, TX_8X8 } },
+ { { TX_16X8, TX_16X8 }, { TX_8X8, TX_8X8 } },
},
{
// BLOCK_16X32
@@ -1243,10 +1428,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_16X8, TX_16X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X32, TX_16X16 }, { TX_8X16, TX_8X16 } }, // used
{ { TX_16X32, TX_16X16 }, { TX_8X16, TX_8X16 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_8X32, TX_8X16 }, { TX_4X16, TX_4X16 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X16, TX_4X16 }, { TX_4X16, TX_4X16 } },
+ { { TX_16X4, TX_16X4 }, { TX_8X4, TX_8X4 } },
+ { { TX_8X32, TX_8X16 }, { TX_8X32, TX_8X16 } },
+ { { TX_16X8, TX_16X8 }, { TX_8X8, TX_8X8 } },
},
{
// BLOCK_32X16
@@ -1266,10 +1451,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } },
{ { TX_32X16, TX_16X8 }, { TX_16X16, TX_16X8 } },
{ { TX_32X16, TX_16X8 }, { TX_16X16, TX_16X8 } }, // used
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_32X8, TX_32X8 }, { TX_16X8, TX_16X4 } },
+ { { TX_4X16, TX_4X8 }, { TX_4X16, TX_4X8 } },
+ { { TX_16X4, TX_16X4 }, { TX_16X4, TX_16X4 } },
+ { { TX_8X16, TX_8X8 }, { TX_8X16, TX_8X8 } },
+ { { TX_32X8, TX_32X8 }, { TX_16X8, TX_16X8 } },
},
{
// BLOCK_32X32
@@ -1289,10 +1474,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } },
{ { TX_16X32, TX_16X16 }, { TX_16X32, TX_16X16 } },
{ { TX_32X16, TX_32X16 }, { TX_16X16, TX_16X16 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X16, TX_4X8 }, { TX_4X16, TX_4X8 } },
+ { { TX_16X4, TX_16X4 }, { TX_16X4, TX_16X4 } },
+ { { TX_8X16, TX_8X8 }, { TX_8X16, TX_8X8 } },
+ { { TX_32X8, TX_32X8 }, { TX_16X8, TX_16X8 } },
},
{
// BLOCK_32X64
@@ -1312,10 +1497,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } },
{ { TX_16X32, TX_16X32 }, { TX_16X16, TX_16X16 } },
{ { TX_32X16, TX_32X16 }, { TX_16X16, TX_16X16 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X16, TX_4X8 }, { TX_4X16, TX_4X8 } },
+ { { TX_16X4, TX_16X4 }, { TX_16X4, TX_16X4 } },
+ { { TX_8X16, TX_8X8 }, { TX_8X16, TX_8X8 } },
+ { { TX_32X8, TX_32X8 }, { TX_16X8, TX_16X8 } },
},
{
// BLOCK_64X32
@@ -1335,10 +1520,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } },
{ { TX_16X32, TX_16X16 }, { TX_16X32, TX_16X16 } },
{ { TX_32X16, TX_16X16 }, { TX_32X16, TX_16X16 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X16, TX_4X8 }, { TX_4X16, TX_4X8 } },
+ { { TX_16X4, TX_16X4 }, { TX_16X4, TX_16X4 } },
+ { { TX_8X16, TX_8X8 }, { TX_8X16, TX_8X8 } },
+ { { TX_32X8, TX_32X8 }, { TX_16X8, TX_16X8 } },
},
{
// BLOCK_64X64
@@ -1358,10 +1543,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } },
{ { TX_16X32, TX_16X32 }, { TX_16X32, TX_16X32 } },
{ { TX_32X16, TX_32X16 }, { TX_32X16, TX_16X16 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X16, TX_4X8 }, { TX_4X16, TX_4X8 } },
+ { { TX_16X4, TX_16X4 }, { TX_16X4, TX_16X4 } },
+ { { TX_8X16, TX_8X8 }, { TX_8X16, TX_8X8 } },
+ { { TX_32X8, TX_32X8 }, { TX_16X8, TX_16X8 } },
},
#if CONFIG_EXT_PARTITION
{
@@ -1405,10 +1590,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } },
{ { TX_16X32, TX_16X32 }, { TX_16X32, TX_16X32 } },
{ { TX_32X16, TX_32X16 }, { TX_32X16, TX_32X16 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X16, TX_4X8 }, { TX_4X16, TX_4X8 } },
+ { { TX_16X4, TX_16X4 }, { TX_16X4, TX_16X4 } },
+ { { TX_8X16, TX_8X8 }, { TX_8X16, TX_8X8 } },
+ { { TX_32X8, TX_32X8 }, { TX_16X8, TX_16X8 } },
},
{
// BLOCK_128X128
@@ -1428,12 +1613,108 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
{ { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } },
{ { TX_16X32, TX_16X32 }, { TX_16X32, TX_16X32 } },
{ { TX_32X16, TX_32X16 }, { TX_32X16, TX_32X16 } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
- { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } },
+ { { TX_4X16, TX_4X8 }, { TX_4X16, TX_4X8 } },
+ { { TX_16X4, TX_16X4 }, { TX_16X4, TX_16X4 } },
+ { { TX_8X16, TX_8X8 }, { TX_8X16, TX_8X8 } },
+ { { TX_32X8, TX_32X8 }, { TX_16X8, TX_16X8 } },
},
#endif // CONFIG_EXT_PARTITION
+ {
+// BLOCK_4X16
+#if CONFIG_CHROMA_2X2
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
+ { { TX_4X4, TX_4X4 }, { TX_2X2, TX_2X2 } },
+#else
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+#endif
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+#if CONFIG_TX64X64
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+#endif // CONFIG_TX64X64
+ { { TX_4X8, TX_4X8 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X8, TX_4X8 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X8, TX_4X8 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X8, TX_4X8 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X8, TX_4X8 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X16, TX_4X8 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X16, TX_4X8 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X8, TX_4X8 }, { TX_4X4, TX_4X4 } },
+ },
+ {
+// BLOCK_16X4
+#if CONFIG_CHROMA_2X2
+ { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
+ { { TX_4X4, TX_2X2 }, { TX_4X4, TX_2X2 } },
+#else
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+#endif
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+#if CONFIG_TX64X64
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+#endif // CONFIG_TX64X64
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X4, TX_4X4 }, { TX_8X4, TX_4X4 } },
+ { { TX_8X4, TX_4X4 }, { TX_8X4, TX_4X4 } },
+ { { TX_8X4, TX_4X4 }, { TX_8X4, TX_4X4 } },
+ { { TX_8X4, TX_4X4 }, { TX_8X4, TX_4X4 } },
+ { { TX_8X4, TX_4X4 }, { TX_8X4, TX_4X4 } },
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_16X4, TX_4X4 }, { TX_8X4, TX_4X4 } },
+ { { TX_8X4, TX_4X4 }, { TX_8X4, TX_4X4 } },
+ { { TX_16X4, TX_4X4 }, { TX_8X4, TX_4X4 } },
+ },
+ {
+// BLOCK_8X32
+#if CONFIG_CHROMA_2X2
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+#endif // CONFIG_CHROMA_2X2
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X8, TX_8X8 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X8, TX_8X8 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X8, TX_8X8 }, { TX_4X4, TX_4X4 } },
+#if CONFIG_TX64X64
+ { { TX_8X8, TX_8X8 }, { TX_4X4, TX_4X4 } },
+#endif // CONFIG_TX64X64
+ { { TX_4X8, TX_4X8 }, { TX_4X8, TX_4X8 } },
+ { { TX_8X4, TX_8X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X16, TX_8X16 }, { TX_4X8, TX_4X8 } },
+ { { TX_8X8, TX_8X8 }, { TX_4X8, TX_4X8 } },
+ { { TX_8X16, TX_8X16 }, { TX_4X8, TX_4X8 } },
+ { { TX_8X16, TX_8X16 }, { TX_4X8, TX_4X8 } },
+ { { TX_4X16, TX_4X16 }, { TX_4X16, TX_4X16 } },
+ { { TX_8X4, TX_8X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X32, TX_8X16 }, { TX_4X16, TX_4X16 } },
+ { { TX_8X8, TX_8X8 }, { TX_4X8, TX_4X8 } },
+ },
+ {
+// BLOCK_32X8
+#if CONFIG_CHROMA_2X2
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+#endif // CONFIG_CHROMA_2X2
+ { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
+ { { TX_8X8, TX_4X4 }, { TX_8X8, TX_4X4 } },
+ { { TX_8X8, TX_4X4 }, { TX_8X8, TX_4X4 } },
+ { { TX_8X8, TX_4X4 }, { TX_8X8, TX_4X4 } },
+#if CONFIG_TX64X64
+ { { TX_8X8, TX_4X4 }, { TX_8X8, TX_4X4 } },
+#endif // CONFIG_TX64X64
+ { { TX_4X8, TX_4X4 }, { TX_4X8, TX_4X4 } },
+ { { TX_8X4, TX_8X4 }, { TX_8X4, TX_8X4 } },
+ { { TX_8X8, TX_8X4 }, { TX_8X8, TX_8X4 } },
+ { { TX_16X8, TX_8X4 }, { TX_16X8, TX_8X4 } },
+ { { TX_16X8, TX_8X4 }, { TX_16X8, TX_8X4 } },
+ { { TX_16X8, TX_8X4 }, { TX_16X8, TX_8X4 } },
+ { { TX_4X8, TX_4X4 }, { TX_4X8, TX_4X4 } },
+ { { TX_16X4, TX_16X4 }, { TX_16X4, TX_16X4 } },
+ { { TX_8X8, TX_8X4 }, { TX_8X8, TX_8X4 } },
+ { { TX_32X8, TX_16X4 }, { TX_16X8, TX_16X4 } },
+ }
};
// Generates 4 bit field in which each bit set to 1 represents
@@ -1443,9 +1724,9 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
static const struct {
PARTITION_CONTEXT above;
PARTITION_CONTEXT left;
-} partition_context_lookup[BLOCK_SIZES] = {
+} partition_context_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_EXT_PARTITION
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 31, 31 }, // 2X2 - {0b11111, 0b11111}
{ 31, 31 }, // 2X4 - {0b11111, 0b11111}
{ 31, 31 }, // 4X2 - {0b11111, 0b11111}
@@ -1466,8 +1747,13 @@ static const struct {
{ 16, 0 }, // 64X128- {0b10000, 0b00000}
{ 0, 16 }, // 128X64- {0b00000, 0b10000}
{ 0, 0 }, // 128X128-{0b00000, 0b00000}
+
+ { 31, 28 }, // 4X16 - {0b11111, 0b11100}
+ { 28, 31 }, // 16X4 - {0b11100, 0b11111}
+ { 30, 24 }, // 8X32 - {0b11110, 0b11000}
+ { 24, 30 }, // 32X8 - {0b11000, 0b11110}
#else
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 15, 15 }, // 2X2 - {0b1111, 0b1111}
{ 15, 15 }, // 2X4 - {0b1111, 0b1111}
{ 15, 15 }, // 4X2 - {0b1111, 0b1111}
@@ -1485,6 +1771,11 @@ static const struct {
{ 8, 0 }, // 32X64 - {0b1000, 0b0000}
{ 0, 8 }, // 64X32 - {0b0000, 0b1000}
{ 0, 0 }, // 64X64 - {0b0000, 0b0000}
+
+ { 15, 12 }, // 4X16 - {0b1111, 0b1100}
+ { 12, 15 }, // 16X4 - {0b1100, 0b1111}
+ { 8, 14 }, // 8X32 - {0b1110, 0b1000}
+ { 14, 8 }, // 32X8 - {0b1000, 0b1110}
#endif // CONFIG_EXT_PARTITION
};
/* clang-format on */
@@ -1507,7 +1798,7 @@ static const TX_SIZE uvsupertx_size_lookup[TX_SIZES][2][2] = {
#if CONFIG_EXT_PARTITION_TYPES
static const int partition_supertx_context_lookup[EXT_PARTITION_TYPES] = {
- -1, 0, 0, 1, 0, 0, 0, 0
+ -1, 0, 0, 1, 0, 0, 0, 0, 0, 0
};
#else
@@ -1516,6 +1807,34 @@ static const int partition_supertx_context_lookup[PARTITION_TYPES] = { -1, 0, 0,
#endif // CONFIG_EXT_PARTITION_TYPES
#endif // CONFIG_SUPERTX
+#if CONFIG_NCOBMC_ADAPT_WEIGHT
+// NCOBMC_ADAPT_INTRPL only supports block size >= BLOCK_8X8 and <= BLOCK_64X64
+static const ADAPT_OVERLAP_BLOCK adapt_overlap_block_lookup[BLOCK_SIZES_ALL] = {
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
+ ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_2X2
+ ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_2X4
+ ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_4X2
+#endif
+ ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_4X4
+ ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_4X8
+ ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_8X4
+
+ // the rest of the block sizes round to the largest squared block less than
+ // the given block size
+ ADAPT_OVERLAP_BLOCK_8X8, ADAPT_OVERLAP_BLOCK_8X8, ADAPT_OVERLAP_BLOCK_8X8,
+ ADAPT_OVERLAP_BLOCK_16X16, ADAPT_OVERLAP_BLOCK_16X16,
+ ADAPT_OVERLAP_BLOCK_16X16, ADAPT_OVERLAP_BLOCK_32X32,
+ ADAPT_OVERLAP_BLOCK_32X32, ADAPT_OVERLAP_BLOCK_32X32,
+ ADAPT_OVERLAP_BLOCK_64X64,
+#if CONFIG_EXT_PARTITION
+ ADAPT_OVERLAP_BLOCK_INVALID, ADAPT_OVERLAP_BLOCK_INVALID,
+ ADAPT_OVERLAP_BLOCK_INVALID,
+#endif // CONFIG_EXT_PARTITION
+ ADAPT_OVERLAP_BLOCK_INVALID, ADAPT_OVERLAP_BLOCK_INVALID,
+ ADAPT_OVERLAP_BLOCK_INVALID, ADAPT_OVERLAP_BLOCK_INVALID
+};
+#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
+
#if CONFIG_ADAPT_SCAN
#define EOB_THRESHOLD_NUM 2
#endif