Commit f1702dde authored by Jingning Han's avatar Jingning Han
Browse files

Add 2x2 block unit syntax

Add 2x2 block size syntax to the codec system. It prepares for the
4x4 coding block unit for 420 format. This change retains the same
coding statistics.

Change-Id: If8e9a31bd6b4b75bc994539dc4dd8021d455ba57
parent 5943d41e
......@@ -28,53 +28,95 @@ extern "C" {
// Log 2 conversion lookup tables for block width and height
static const uint8_t b_width_log2_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
0, 0, 0,
#endif
0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, IF_EXT_PARTITION(4, 5, 5)
};
static const uint8_t b_height_log2_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
0, 0, 0,
#endif
0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, IF_EXT_PARTITION(5, 4, 5)
};
// Log 2 conversion lookup tables for modeinfo width and height
static const uint8_t mi_width_log2_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
0, 0, 0,
#endif
0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, IF_EXT_PARTITION(3, 4, 4)
};
static const uint8_t mi_height_log2_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
0, 0, 0,
#endif
0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, IF_EXT_PARTITION(4, 3, 4)
};
// Width/height lookup tables in units of various block sizes
static const uint8_t block_size_wide[BLOCK_SIZES] = {
#if CONFIG_CB4X4
2, 2, 4,
#endif
4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, IF_EXT_PARTITION(64, 128, 128)
};
static const uint8_t block_size_high[BLOCK_SIZES] = {
#if CONFIG_CB4X4
2, 4, 2,
#endif
4, 8, 4, 8, 16, 8, 16, 32, 16, 32, 64, 32, 64, IF_EXT_PARTITION(128, 64, 128)
};
static const uint8_t num_4x4_blocks_wide_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
1, 1, 1,
#endif
1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, IF_EXT_PARTITION(16, 32, 32)
};
static const uint8_t num_4x4_blocks_high_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
1, 1, 1,
#endif
1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16, IF_EXT_PARTITION(32, 16, 32)
};
static const uint8_t num_8x8_blocks_wide_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
1, 1, 1,
#endif
1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, IF_EXT_PARTITION(8, 16, 16)
};
static const uint8_t num_8x8_blocks_high_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
1, 1, 1,
#endif
1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, IF_EXT_PARTITION(16, 8, 16)
};
static const uint8_t num_16x16_blocks_wide_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
1, 1, 1,
#endif
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 4, IF_EXT_PARTITION(4, 8, 8)
};
static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
1, 1, 1,
#endif
1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 4, 2, 4, IF_EXT_PARTITION(8, 4, 8)
};
// AOMMIN(3, AOMMIN(b_width_log2(bsize), b_height_log2(bsize)))
static const uint8_t size_group_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
0, 0, 0,
#endif
0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, IF_EXT_PARTITION(3, 3, 3)
};
static const uint8_t num_pels_log2_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
2, 3, 3,
#endif
4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, IF_EXT_PARTITION(13, 13, 14)
};
......@@ -82,6 +124,10 @@ static const uint8_t num_pels_log2_lookup[BLOCK_SIZES] = {
static const PARTITION_TYPE
partition_lookup[MAX_SB_SIZE_LOG2 - 1][BLOCK_SIZES] = {
{ // 4X4 ->
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
// 4X4
PARTITION_NONE,
// 4X8, 8X4, 8X8
......@@ -96,6 +142,10 @@ static const PARTITION_TYPE
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION
}, { // 8X8 ->
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
// 4X4
PARTITION_SPLIT,
// 4X8, 8X4, 8X8
......@@ -111,6 +161,10 @@ static const PARTITION_TYPE
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION
}, { // 16X16 ->
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
// 4X4
PARTITION_SPLIT,
// 4X8, 8X4, 8X8
......@@ -126,6 +180,10 @@ static const PARTITION_TYPE
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION
}, { // 32X32 ->
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
// 4X4
PARTITION_SPLIT,
// 4X8, 8X4, 8X8
......@@ -141,6 +199,10 @@ static const PARTITION_TYPE
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION
}, { // 64X64 ->
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
// 4X4
PARTITION_SPLIT,
// 4X8, 8X4, 8X8
......@@ -155,6 +217,10 @@ static const PARTITION_TYPE
// 64x128, 128x64, 128x128
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
}, { // 128x128 ->
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif
// 4X4
PARTITION_SPLIT,
// 4X8, 8X4, 8X8
......@@ -178,6 +244,10 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
#endif // CONFIG_EXT_PARTITION_TYPES
{
{ // PARTITION_NONE
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
BLOCK_2X2, BLOCK_2X4, BLOCK_4X2,
#endif
// 4X4
BLOCK_4X4,
// 4X8, 8X4, 8X8
......@@ -193,6 +263,10 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
BLOCK_64X128, BLOCK_128X64, BLOCK_128X128,
#endif // CONFIG_EXT_PARTITION
}, { // PARTITION_HORZ
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
// 4X4
BLOCK_INVALID,
// 4X8, 8X4, 8X8
......@@ -208,6 +282,10 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64,
#endif // CONFIG_EXT_PARTITION
}, { // PARTITION_VERT
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
// 4X4
BLOCK_INVALID,
// 4X8, 8X4, 8X8
......@@ -223,6 +301,10 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X128,
#endif // CONFIG_EXT_PARTITION
}, { // PARTITION_SPLIT
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
// 4X4
BLOCK_INVALID,
// 4X8, 8X4, 8X8
......@@ -239,6 +321,10 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
#endif // CONFIG_EXT_PARTITION
#if CONFIG_EXT_PARTITION_TYPES
}, { // PARTITION_HORZ_A
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
// 4X4
BLOCK_INVALID,
// 4X8, 8X4, 8X8
......@@ -254,6 +340,10 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64,
#endif // CONFIG_EXT_PARTITION
}, { // PARTITION_HORZ_B
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
// 4X4
BLOCK_INVALID,
// 4X8, 8X4, 8X8
......@@ -269,6 +359,10 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64,
#endif // CONFIG_EXT_PARTITION
}, { // PARTITION_VERT_A
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
// 4X4
BLOCK_INVALID,
// 4X8, 8X4, 8X8
......@@ -284,6 +378,10 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X128,
#endif // CONFIG_EXT_PARTITION
}, { // PARTITION_VERT_B
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
// 4X4
BLOCK_INVALID,
// 4X8, 8X4, 8X8
......@@ -303,6 +401,10 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
};
static const TX_SIZE max_txsize_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
TX_2X2, TX_2X2, TX_2X2,
#endif
// 4X4
TX_4X4,
// 4X8, 8X4, 8X8
......@@ -331,6 +433,10 @@ static const TX_SIZE max_txsize_lookup[BLOCK_SIZES] = {
};
static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
TX_2X2, TX_2X2, TX_2X2,
#endif
// 4X4
TX_4X4,
// 4X8, 8X4, 8X8
......@@ -360,6 +466,10 @@ static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES] = {
// 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
// 2X2, 2X4, 4X2,
INT32_MIN, INT32_MIN, INT32_MIN,
#endif
// 4X4
INT32_MIN,
// 4X8, 8X4, 8X8
......@@ -392,6 +502,10 @@ static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES] = {
// 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 inter_tx_size_cat_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
INT32_MIN, INT32_MIN, INT32_MIN,
#endif
// 4X4
INT32_MIN,
// 4X8, 8X4, 8X8
......@@ -635,8 +749,13 @@ static const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES] = {
};
static const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][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
// 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
{ { BLOCK_2X2, BLOCK_INVALID }, { BLOCK_INVALID, BLOCK_INVALID } },
{ { BLOCK_2X4, BLOCK_INVALID }, { BLOCK_INVALID, BLOCK_INVALID } },
{ { BLOCK_4X2, BLOCK_INVALID }, { BLOCK_INVALID, BLOCK_INVALID } },
#endif
{ { BLOCK_4X4, BLOCK_INVALID }, { BLOCK_INVALID, BLOCK_INVALID } },
{ { BLOCK_4X8, BLOCK_4X4 }, { BLOCK_INVALID, BLOCK_INVALID } },
{ { BLOCK_8X4, BLOCK_INVALID }, { BLOCK_4X4, BLOCK_INVALID } },
......@@ -658,8 +777,61 @@ static const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2] = {
};
static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][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
// 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
{
// BLOCK_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, TX_2X2 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
#if CONFIG_TX64X64
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
#endif // CONFIG_TX64X64
{ { 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 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
},
{
// BLOCK_2X4
{ { 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 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
#if CONFIG_TX64X64
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
#endif // CONFIG_TX64X64
{ { 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 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
},
{
// BLOCK_2X4
{ { 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 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
#if CONFIG_TX64X64
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
#endif // CONFIG_TX64X64
{ { 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 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
{ { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } },
},
#endif
{
// BLOCK_4X4
#if CONFIG_CB4X4
......@@ -976,6 +1148,11 @@ static const struct {
PARTITION_CONTEXT left;
} partition_context_lookup[BLOCK_SIZES] = {
#if CONFIG_EXT_PARTITION
#if CONFIG_CB4X4
{ 31, 31 }, // 2X2 - {0b11111, 0b11111}
{ 31, 31 }, // 2X4 - {0b11111, 0b11111}
{ 31, 31 }, // 4X2 - {0b11111, 0b11111}
#endif
{ 31, 31 }, // 4X4 - {0b11111, 0b11111}
{ 31, 30 }, // 4X8 - {0b11111, 0b11110}
{ 30, 31 }, // 8X4 - {0b11110, 0b11111}
......@@ -993,6 +1170,11 @@ static const struct {
{ 0, 16 }, // 128X64- {0b00000, 0b10000}
{ 0, 0 }, // 128X128-{0b00000, 0b00000}
#else
#if CONFIG_CB4X4
{ 15, 15 }, // 2X2 - {0b1111, 0b1111}
{ 15, 15 }, // 2X4 - {0b1111, 0b1111}
{ 15, 15 }, // 4X2 - {0b1111, 0b1111}
#endif
{ 15, 15 }, // 4X4 - {0b1111, 0b1111}
{ 15, 14 }, // 4X8 - {0b1111, 0b1110}
{ 14, 15 }, // 8X4 - {0b1110, 0b1111}
......
......@@ -81,6 +81,11 @@ typedef enum BITSTREAM_PROFILE {
// type, so that we can save memory when they are used in structs/arrays.
typedef enum ATTRIBUTE_PACKED {
#if CONFIG_CB4X4
BLOCK_2X2,
BLOCK_2X4,
BLOCK_4X2,
#endif
BLOCK_4X4,
BLOCK_4X8,
BLOCK_8X4,
......
......@@ -98,6 +98,11 @@ static const uint64_t above_64x64_txform_mask[TX_SIZES] = {
// 00000000
// 00000000
static const uint64_t left_prediction_mask[BLOCK_SIZES] = {
#if CONFIG_CB4X4
0x0000000000000001ULL, // BLOCK_2X2,
0x0000000000000001ULL, // BLOCK_2X4,
0x0000000000000001ULL, // BLOCK_4X2,
#endif
0x0000000000000001ULL, // BLOCK_4X4,
0x0000000000000001ULL, // BLOCK_4X8,
0x0000000000000001ULL, // BLOCK_8X4,
......@@ -115,6 +120,11 @@ static const uint64_t left_prediction_mask[BLOCK_SIZES] = {
// 64 bit mask to shift and set for each prediction size.
static const uint64_t above_prediction_mask[BLOCK_SIZES] = {
#if CONFIG_CB4X4
0x0000000000000001ULL, // BLOCK_2X2
0x0000000000000001ULL, // BLOCK_2X4
0x0000000000000001ULL, // BLOCK_4X2
#endif
0x0000000000000001ULL, // BLOCK_4X4
0x0000000000000001ULL, // BLOCK_4X8
0x0000000000000001ULL, // BLOCK_8X4
......@@ -133,6 +143,11 @@ static const uint64_t above_prediction_mask[BLOCK_SIZES] = {
// each 8x8 block that would be in the left most block of the given block
// size in the 64x64 block.
static const uint64_t size_mask[BLOCK_SIZES] = {
#if CONFIG_CB4X4
0x0000000000000001ULL, // BLOCK_2X2
0x0000000000000001ULL, // BLOCK_2X4
0x0000000000000001ULL, // BLOCK_4X2
#endif
0x0000000000000001ULL, // BLOCK_4X4
0x0000000000000001ULL, // BLOCK_4X8
0x0000000000000001ULL, // BLOCK_8X4
......@@ -181,6 +196,11 @@ static const uint16_t above_64x64_txform_mask_uv[TX_SIZES] = {
// 16 bit left mask to shift and set for each uv prediction size.
static const uint16_t left_prediction_mask_uv[BLOCK_SIZES] = {
#if CONFIG_CB4X4
0x0001, // BLOCK_2X2,
0x0001, // BLOCK_2X4,
0x0001, // BLOCK_4X2,
#endif
0x0001, // BLOCK_4X4,
0x0001, // BLOCK_4X8,
0x0001, // BLOCK_8X4,
......@@ -197,6 +217,11 @@ static const uint16_t left_prediction_mask_uv[BLOCK_SIZES] = {
};
// 16 bit above mask to shift and set for uv each prediction size.
static const uint16_t above_prediction_mask_uv[BLOCK_SIZES] = {
#if CONFIG_CB4X4
0x0001, // BLOCK_2X2
0x0001, // BLOCK_2X4
0x0001, // BLOCK_4X2
#endif
0x0001, // BLOCK_4X4
0x0001, // BLOCK_4X8
0x0001, // BLOCK_8X4
......@@ -214,6 +239,11 @@ static const uint16_t above_prediction_mask_uv[BLOCK_SIZES] = {
// 64 bit mask to shift and set for each uv prediction size
static const uint16_t size_mask_uv[BLOCK_SIZES] = {
#if CONFIG_CB4X4
0x0001, // BLOCK_2X2
0x0001, // BLOCK_2X4
0x0001, // BLOCK_4X2
#endif
0x0001, // BLOCK_4X4
0x0001, // BLOCK_4X8
0x0001, // BLOCK_8X4
......
......@@ -123,6 +123,10 @@ static const uint8_t orders_8x8[256] = {
/* clang-format off */
static const uint8_t *const orders[BLOCK_SIZES] = {
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2
orders_8x8, orders_8x8, orders_8x8,
#endif
// 4X4
orders_8x8,
// 4X8, 8X4, 8X8
......@@ -140,6 +144,10 @@ static const uint8_t *const orders[BLOCK_SIZES] = {
#else
/* clang-format off */
static const uint8_t *const orders[BLOCK_SIZES] = {
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2
orders_16x16, orders_16x16, orders_16x16,
#endif
// 4X4
orders_16x16,
// 4X8, 8X4, 8X8
......
......@@ -2928,6 +2928,9 @@ static void rd_use_partition(AV1_COMP *cpi, ThreadData *td,
/* clang-format off */
static const BLOCK_SIZE min_partition_size[BLOCK_SIZES] = {
#if CONFIG_CB4X4
BLOCK_2X2, BLOCK_2X2, BLOCK_2X2, // 2x2, 2x4, 4x2
#endif
BLOCK_4X4, // 4x4
BLOCK_4X4, BLOCK_4X4, BLOCK_4X4, // 4x8, 8x4, 8x8
BLOCK_4X4, BLOCK_4X4, BLOCK_8X8, // 8x16, 16x8, 16x16
......@@ -2939,6 +2942,9 @@ static const BLOCK_SIZE min_partition_size[BLOCK_SIZES] = {
};
static const BLOCK_SIZE max_partition_size[BLOCK_SIZES] = {
#if CONFIG_CB4X4
BLOCK_4X4, BLOCK_4X4, BLOCK_4X4, // 2x2, 2x4, 4x2
#endif
BLOCK_8X8, // 4x4
BLOCK_16X16, BLOCK_16X16, BLOCK_16X16, // 4x8, 8x4, 8x8
BLOCK_32X32, BLOCK_32X32, BLOCK_32X32, // 8x16, 16x8, 16x16
......@@ -2951,6 +2957,9 @@ static const BLOCK_SIZE max_partition_size[BLOCK_SIZES] = {
// Next square block size less or equal than current block size.
static const BLOCK_SIZE next_square_size[BLOCK_SIZES] = {
#if CONFIG_CB4X4
BLOCK_2X2, BLOCK_2X2, BLOCK_2X2, // 2x2, 2x4, 4x2
#endif
BLOCK_4X4, // 4x4
BLOCK_4X4, BLOCK_4X4, BLOCK_8X8, // 4x8, 8x4, 8x8
BLOCK_8X8, BLOCK_8X8, BLOCK_16X16, // 8x16, 16x8, 16x16
......
......@@ -63,6 +63,9 @@ void av1_rd_cost_init(RD_COST *rd_cost) {
// This table is used to correct for block size.
// The factors here are << 2 (2 = x0.5, 32 = x8 etc).
static const uint8_t rd_thresh_block_size_factor[BLOCK_SIZES] = {
#if CONFIG_CB4X4
2, 2, 2,
#endif
2, 3, 3, 4, 6, 6, 8, 12, 12, 16, 24, 24, 32,
#if CONFIG_EXT_PARTITION
48, 48, 64
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment