Merge "Add extended partition support to decode" into nextgen
This commit is contained in:
commit
e0617385d6
@ -69,6 +69,59 @@ const PARTITION_TYPE partition_lookup[][BLOCK_SIZES] = {
|
||||
}
|
||||
};
|
||||
|
||||
#if CONFIG_EXT_PARTITION
|
||||
const BLOCK_SIZE subsize_lookup[EXT_PARTITION_TYPES][BLOCK_SIZES] = {
|
||||
{ // PARTITION_NONE
|
||||
BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
|
||||
BLOCK_8X8, BLOCK_8X16, BLOCK_16X8,
|
||||
BLOCK_16X16, BLOCK_16X32, BLOCK_32X16,
|
||||
BLOCK_32X32, BLOCK_32X64, BLOCK_64X32,
|
||||
BLOCK_64X64,
|
||||
}, { // PARTITION_HORZ
|
||||
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_8X4, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_16X8, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_32X16, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_64X32,
|
||||
}, { // PARTITION_VERT
|
||||
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_4X8, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_8X16, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_16X32, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_32X64,
|
||||
}, { // PARTITION_SPLIT
|
||||
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_4X4, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_8X8, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_16X16, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_32X32,
|
||||
}, { // PARTITION_HORZ_A
|
||||
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_8X4, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_16X8, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_32X16, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_64X32,
|
||||
}, { // PARTITION_HORZ_B
|
||||
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_8X4, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_16X8, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_32X16, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_64X32,
|
||||
}, { // PARTITION_VERT_A
|
||||
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_4X8, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_8X16, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_16X32, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_32X64,
|
||||
}, { // PARTITION_VERT_B
|
||||
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_4X8, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_8X16, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_16X32, BLOCK_INVALID, BLOCK_INVALID,
|
||||
BLOCK_32X64,
|
||||
}
|
||||
};
|
||||
#else
|
||||
const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = {
|
||||
{ // PARTITION_NONE
|
||||
BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
|
||||
@ -96,6 +149,7 @@ const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = {
|
||||
BLOCK_32X32,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
const TX_SIZE max_txsize_lookup[BLOCK_SIZES] = {
|
||||
TX_4X4, TX_4X4, TX_4X4,
|
||||
|
@ -27,7 +27,11 @@ extern const int num_4x4_blocks_wide_lookup[BLOCK_SIZES];
|
||||
extern const int size_group_lookup[BLOCK_SIZES];
|
||||
extern const int num_pels_log2_lookup[BLOCK_SIZES];
|
||||
extern const PARTITION_TYPE partition_lookup[][BLOCK_SIZES];
|
||||
#if CONFIG_EXT_PARTITION
|
||||
extern const BLOCK_SIZE subsize_lookup[EXT_PARTITION_TYPES][BLOCK_SIZES];
|
||||
#else
|
||||
extern const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES];
|
||||
#endif
|
||||
extern const TX_SIZE max_txsize_lookup[BLOCK_SIZES];
|
||||
extern const BLOCK_SIZE txsize_to_bsize[TX_SIZES];
|
||||
extern const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES];
|
||||
|
@ -364,6 +364,55 @@ static const vp9_prob default_filterintra_prob[TX_SIZES][INTRA_MODES] = {
|
||||
};
|
||||
#endif // CONFIG_FILTERINTRA
|
||||
|
||||
#if CONFIG_EXT_PARTITION
|
||||
const vp9_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
|
||||
[EXT_PARTITION_TYPES - 1] = {
|
||||
// 8x8 -> 4x4
|
||||
{ 158, 97, 94, 128, 128, 128, 128 }, // a/l both not split
|
||||
{ 93, 24, 99, 128, 128, 128, 128 }, // a split, l not split
|
||||
{ 85, 119, 44, 128, 128, 128, 128 }, // l split, a not split
|
||||
{ 62, 59, 67, 128, 128, 128, 128 }, // a/l both split
|
||||
// 16x16 -> 8x8
|
||||
{ 149, 53, 53, 128, 128, 128, 128 }, // a/l both not split
|
||||
{ 94, 20, 48, 128, 128, 128, 128 }, // a split, l not split
|
||||
{ 83, 53, 24, 128, 128, 128, 128 }, // l split, a not split
|
||||
{ 52, 18, 18, 128, 128, 128, 128 }, // a/l both split
|
||||
// 32x32 -> 16x16
|
||||
{ 150, 40, 39, 128, 128, 128, 128 }, // a/l both not split
|
||||
{ 78, 12, 26, 128, 128, 128, 128 }, // a split, l not split
|
||||
{ 67, 33, 11, 128, 128, 128, 128 }, // l split, a not split
|
||||
{ 24, 7, 5, 128, 128, 128, 128 }, // a/l both split
|
||||
// 64x64 -> 32x32
|
||||
{ 174, 35, 49, 128, 128, 128, 128 }, // a/l both not split
|
||||
{ 68, 11, 27, 128, 128, 128, 128 }, // a split, l not split
|
||||
{ 57, 15, 9, 128, 128, 128, 128 }, // l split, a not split
|
||||
{ 12, 3, 3, 128, 128, 128, 128 }, // a/l both split
|
||||
};
|
||||
|
||||
static const vp9_prob default_partition_probs[PARTITION_CONTEXTS]
|
||||
[EXT_PARTITION_TYPES - 1] = {
|
||||
// 8x8 -> 4x4
|
||||
{ 199, 122, 141, 128, 128, 128, 128 }, // a/l both not split
|
||||
{ 147, 63, 159, 128, 128, 128, 128 }, // a split, l not split
|
||||
{ 148, 133, 118, 128, 128, 128, 128 }, // l split, a not split
|
||||
{ 121, 104, 114, 128, 128, 128, 128 }, // a/l both split
|
||||
// 16x16 -> 8x8
|
||||
{ 174, 73, 87, 128, 128, 128, 128 }, // a/l both not split
|
||||
{ 92, 41, 83, 128, 128, 128, 128 }, // a split, l not split
|
||||
{ 82, 99, 50, 128, 128, 128, 128 }, // l split, a not split
|
||||
{ 53, 39, 39, 128, 128, 128, 128 }, // a/l both split
|
||||
// 32x32 -> 16x16
|
||||
{ 177, 58, 59, 128, 128, 128, 128 }, // a/l both not split
|
||||
{ 68, 26, 63, 128, 128, 128, 128 }, // a split, l not split
|
||||
{ 52, 79, 25, 128, 128, 128, 128 }, // l split, a not split
|
||||
{ 17, 14, 12, 128, 128, 128, 128 }, // a/l both split
|
||||
// 64x64 -> 32x32
|
||||
{ 222, 34, 30, 128, 128, 128, 128 }, // a/l both not split
|
||||
{ 72, 16, 44, 128, 128, 128, 128 }, // a split, l not split
|
||||
{ 58, 32, 12, 128, 128, 128, 128 }, // l split, a not split
|
||||
{ 10, 7, 6, 128, 128, 128, 128 }, // a/l both split
|
||||
};
|
||||
#else
|
||||
const vp9_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
|
||||
[PARTITION_TYPES - 1] = {
|
||||
// 8x8 -> 4x4
|
||||
@ -411,6 +460,7 @@ static const vp9_prob default_partition_probs[PARTITION_CONTEXTS]
|
||||
{ 58, 32, 12 }, // l split, a not split
|
||||
{ 10, 7, 6 }, // a/l both split
|
||||
};
|
||||
#endif
|
||||
|
||||
static const vp9_prob default_inter_mode_probs[INTER_MODE_CONTEXTS]
|
||||
[INTER_MODES - 1] = {
|
||||
@ -497,6 +547,18 @@ const vp9_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)] = {
|
||||
-PARTITION_VERT, -PARTITION_SPLIT
|
||||
};
|
||||
|
||||
#if CONFIG_EXT_PARTITION
|
||||
const vp9_tree_index vp9_ext_partition_tree[TREE_SIZE(EXT_PARTITION_TYPES)] = {
|
||||
-PARTITION_NONE, 2,
|
||||
6, 4,
|
||||
8, -PARTITION_SPLIT,
|
||||
-PARTITION_HORZ, 10,
|
||||
-PARTITION_VERT, 12,
|
||||
-PARTITION_HORZ_A, -PARTITION_HORZ_B,
|
||||
-PARTITION_VERT_A, -PARTITION_VERT_B
|
||||
};
|
||||
#endif
|
||||
|
||||
static const vp9_prob default_intra_inter_p[INTRA_INTER_CONTEXTS] = {
|
||||
#if CONFIG_COPY_MODE
|
||||
35, 112, 187, 225
|
||||
@ -1090,9 +1152,17 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
|
||||
adapt_probs(vp9_intra_mode_tree, pre_fc->uv_mode_prob[i],
|
||||
counts->uv_mode[i], fc->uv_mode_prob[i]);
|
||||
|
||||
#if CONFIG_EXT_PARTITION
|
||||
adapt_probs(vp9_partition_tree, pre_fc->partition_prob[0],
|
||||
counts->partition[0], fc->partition_prob[0]);
|
||||
for (i = 1; i < PARTITION_CONTEXTS; i++)
|
||||
adapt_probs(vp9_ext_partition_tree, pre_fc->partition_prob[i],
|
||||
counts->partition[i], fc->partition_prob[i]);
|
||||
#else
|
||||
for (i = 0; i < PARTITION_CONTEXTS; i++)
|
||||
adapt_probs(vp9_partition_tree, pre_fc->partition_prob[i],
|
||||
counts->partition[i], fc->partition_prob[i]);
|
||||
#endif
|
||||
|
||||
if (cm->interp_filter == SWITCHABLE) {
|
||||
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++)
|
||||
|
@ -44,7 +44,11 @@ struct tx_counts {
|
||||
typedef struct frame_contexts {
|
||||
vp9_prob y_mode_prob[BLOCK_SIZE_GROUPS][INTRA_MODES - 1];
|
||||
vp9_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
|
||||
#if CONFIG_EXT_PARTITION
|
||||
vp9_prob partition_prob[PARTITION_CONTEXTS][EXT_PARTITION_TYPES - 1];
|
||||
#else
|
||||
vp9_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
|
||||
#endif
|
||||
vp9_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES];
|
||||
vp9_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
|
||||
[SWITCHABLE_FILTERS - 1];
|
||||
@ -109,7 +113,11 @@ typedef struct frame_contexts {
|
||||
typedef struct {
|
||||
unsigned int y_mode[BLOCK_SIZE_GROUPS][INTRA_MODES];
|
||||
unsigned int uv_mode[INTRA_MODES][INTRA_MODES];
|
||||
#if CONFIG_EXT_PARTITION
|
||||
unsigned int partition[PARTITION_CONTEXTS][EXT_PARTITION_TYPES];
|
||||
#else
|
||||
unsigned int partition[PARTITION_CONTEXTS][PARTITION_TYPES];
|
||||
#endif
|
||||
vp9_coeff_count_model coef[TX_SIZES][PLANE_TYPES];
|
||||
unsigned int eob_branch[TX_SIZES][PLANE_TYPES][REF_TYPES]
|
||||
[COEF_BANDS][COEFF_CONTEXTS];
|
||||
@ -173,11 +181,20 @@ typedef struct {
|
||||
extern const vp9_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
|
||||
extern const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
|
||||
[INTRA_MODES - 1];
|
||||
#if CONFIG_EXT_PARTITION
|
||||
extern const vp9_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
|
||||
[EXT_PARTITION_TYPES - 1];
|
||||
#else
|
||||
extern const vp9_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
|
||||
[PARTITION_TYPES - 1];
|
||||
#endif
|
||||
extern const vp9_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)];
|
||||
extern const vp9_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)];
|
||||
extern const vp9_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)];
|
||||
#if CONFIG_EXT_PARTITION
|
||||
extern const vp9_tree_index vp9_ext_partition_tree
|
||||
[TREE_SIZE(EXT_PARTITION_TYPES)];
|
||||
#endif
|
||||
extern const vp9_tree_index vp9_switchable_interp_tree
|
||||
[TREE_SIZE(SWITCHABLE_FILTERS)];
|
||||
#if CONFIG_EXT_TX
|
||||
|
@ -58,6 +58,21 @@ typedef enum BLOCK_SIZE {
|
||||
BLOCK_INVALID = BLOCK_SIZES
|
||||
} BLOCK_SIZE;
|
||||
|
||||
#if CONFIG_EXT_PARTITION
|
||||
typedef enum PARTITION_TYPE {
|
||||
PARTITION_NONE,
|
||||
PARTITION_HORZ,
|
||||
PARTITION_VERT,
|
||||
PARTITION_SPLIT,
|
||||
PARTITION_HORZ_A, // HORZ split and the left partition is recursively split
|
||||
PARTITION_HORZ_B, // HORZ split and the right partition is recursively split
|
||||
PARTITION_VERT_A, // VERT split and the top partition is recursively split
|
||||
PARTITION_VERT_B, // VERT split and the bottom partition is recursively split
|
||||
EXT_PARTITION_TYPES,
|
||||
PARTITION_TYPES = PARTITION_SPLIT + 1,
|
||||
PARTITION_INVALID = EXT_PARTITION_TYPES
|
||||
} PARTITION_TYPE;
|
||||
#else
|
||||
typedef enum PARTITION_TYPE {
|
||||
PARTITION_NONE,
|
||||
PARTITION_HORZ,
|
||||
@ -66,6 +81,7 @@ typedef enum PARTITION_TYPE {
|
||||
PARTITION_TYPES,
|
||||
PARTITION_INVALID = PARTITION_TYPES
|
||||
} PARTITION_TYPE;
|
||||
#endif
|
||||
|
||||
typedef char PARTITION_CONTEXT;
|
||||
#define PARTITION_PLOFFSET 4 // number of probability models per block size
|
||||
|
@ -355,7 +355,12 @@ static INLINE void update_partition_context(MACROBLOCKD *xd,
|
||||
BLOCK_SIZE bsize) {
|
||||
PARTITION_CONTEXT *const above_ctx = xd->above_seg_context + mi_col;
|
||||
PARTITION_CONTEXT *const left_ctx = xd->left_seg_context + (mi_row & MI_MASK);
|
||||
|
||||
#if CONFIG_EXT_PARTITION
|
||||
const int bw = num_8x8_blocks_wide_lookup[bsize];
|
||||
const int bh = num_8x8_blocks_high_lookup[bsize];
|
||||
vpx_memset(above_ctx, partition_context_lookup[subsize].above, bw);
|
||||
vpx_memset(left_ctx, partition_context_lookup[subsize].left, bh);
|
||||
#else
|
||||
// num_4x4_blocks_wide_lookup[bsize] / 2
|
||||
const int bs = num_8x8_blocks_wide_lookup[bsize];
|
||||
|
||||
@ -364,6 +369,7 @@ static INLINE void update_partition_context(MACROBLOCKD *xd,
|
||||
// bits of smaller block sizes to be zero.
|
||||
vpx_memset(above_ctx, partition_context_lookup[subsize].above, bs);
|
||||
vpx_memset(left_ctx, partition_context_lookup[subsize].left, bs);
|
||||
#endif
|
||||
}
|
||||
|
||||
static INLINE int partition_plane_context(const MACROBLOCKD *xd,
|
||||
|
@ -1333,15 +1333,22 @@ static PARTITION_TYPE read_partition(VP9_COMMON *cm, MACROBLOCKD *xd, int hbs,
|
||||
const int has_rows = (mi_row + hbs) < cm->mi_rows;
|
||||
const int has_cols = (mi_col + hbs) < cm->mi_cols;
|
||||
PARTITION_TYPE p;
|
||||
|
||||
if (has_rows && has_cols)
|
||||
if (has_rows && has_cols) {
|
||||
#if CONFIG_EXT_PARTITION
|
||||
if (bsize <= BLOCK_8X8)
|
||||
p = (PARTITION_TYPE)vp9_read_tree(r, vp9_partition_tree, probs);
|
||||
else
|
||||
p = (PARTITION_TYPE)vp9_read_tree(r, vp9_ext_partition_tree, probs);
|
||||
#else
|
||||
p = (PARTITION_TYPE)vp9_read_tree(r, vp9_partition_tree, probs);
|
||||
else if (!has_rows && has_cols)
|
||||
#endif
|
||||
} else if (!has_rows && has_cols) {
|
||||
p = vp9_read(r, probs[1]) ? PARTITION_SPLIT : PARTITION_HORZ;
|
||||
else if (has_rows && !has_cols)
|
||||
} else if (has_rows && !has_cols) {
|
||||
p = vp9_read(r, probs[2]) ? PARTITION_SPLIT : PARTITION_VERT;
|
||||
else
|
||||
} else {
|
||||
p = PARTITION_SPLIT;
|
||||
}
|
||||
|
||||
if (!cm->frame_parallel_decoding_mode)
|
||||
++cm->counts.partition[ctx][p];
|
||||
@ -1370,6 +1377,9 @@ static void decode_partition(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||
const int hbs = num_8x8_blocks_wide_lookup[bsize] / 2;
|
||||
PARTITION_TYPE partition;
|
||||
BLOCK_SIZE subsize, uv_subsize;
|
||||
#if CONFIG_EXT_PARTITION
|
||||
BLOCK_SIZE bsize2 = get_subsize(bsize, PARTITION_SPLIT);
|
||||
#endif
|
||||
#if CONFIG_SUPERTX
|
||||
const int read_token = !supertx_enabled;
|
||||
int skip = 0;
|
||||
@ -1479,6 +1489,28 @@ static void decode_partition(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||
decode_partition(cm, xd, tile, mi_row + hbs, mi_col + hbs, r, subsize);
|
||||
#endif
|
||||
break;
|
||||
#if CONFIG_EXT_PARTITION
|
||||
case PARTITION_HORZ_A:
|
||||
decode_partition(cm, xd, tile, mi_row, mi_col, r, bsize2);
|
||||
decode_partition(cm, xd, tile, mi_row, mi_col + hbs, r, bsize2);
|
||||
decode_block(cm, xd, tile, mi_row + hbs, mi_col, r, subsize);
|
||||
break;
|
||||
case PARTITION_HORZ_B:
|
||||
decode_block(cm, xd, tile, mi_row, mi_col, r, subsize);
|
||||
decode_partition(cm, xd, tile, mi_row + hbs, mi_col, r, bsize2);
|
||||
decode_partition(cm, xd, tile, mi_row + hbs, mi_col + hbs, r, bsize2);
|
||||
break;
|
||||
case PARTITION_VERT_A:
|
||||
decode_partition(cm, xd, tile, mi_row, mi_col, r, bsize2);
|
||||
decode_partition(cm, xd, tile, mi_row + hbs, mi_col, r, bsize2);
|
||||
decode_block(cm, xd, tile, mi_row, mi_col + hbs, r, subsize);
|
||||
break;
|
||||
case PARTITION_VERT_B:
|
||||
decode_block(cm, xd, tile, mi_row, mi_col, r, subsize);
|
||||
decode_partition(cm, xd, tile, mi_row, mi_col + hbs, r, bsize2);
|
||||
decode_partition(cm, xd, tile, mi_row + hbs, mi_col + hbs, r, bsize2);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
assert(0 && "Invalid partition type");
|
||||
}
|
||||
@ -1522,10 +1554,39 @@ static void decode_partition(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||
}
|
||||
#endif // CONFIG_SUPERTX
|
||||
|
||||
#if CONFIG_EXT_PARTITION
|
||||
if (bsize >= BLOCK_8X8) {
|
||||
switch (partition) {
|
||||
case PARTITION_SPLIT:
|
||||
if (bsize > BLOCK_8X8)
|
||||
break;
|
||||
case PARTITION_NONE:
|
||||
case PARTITION_HORZ:
|
||||
case PARTITION_VERT:
|
||||
update_partition_context(xd, mi_row, mi_col, subsize, bsize);
|
||||
break;
|
||||
case PARTITION_HORZ_A:
|
||||
update_partition_context(xd, mi_row + hbs, mi_col, subsize, subsize);
|
||||
break;
|
||||
case PARTITION_HORZ_B:
|
||||
update_partition_context(xd, mi_row, mi_col, subsize, subsize);
|
||||
break;
|
||||
case PARTITION_VERT_A:
|
||||
update_partition_context(xd, mi_row, mi_col + hbs, subsize, subsize);
|
||||
break;
|
||||
case PARTITION_VERT_B:
|
||||
update_partition_context(xd, mi_row, mi_col, subsize, subsize);
|
||||
break;
|
||||
default:
|
||||
assert(0 && "Invalid partition type");
|
||||
}
|
||||
}
|
||||
#else
|
||||
// update partition context
|
||||
if (bsize >= BLOCK_8X8 &&
|
||||
(bsize == BLOCK_8X8 || partition != PARTITION_SPLIT))
|
||||
update_partition_context(xd, mi_row, mi_col, subsize, bsize);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void setup_token_decoder(const uint8_t *data,
|
||||
@ -2772,10 +2833,17 @@ static int read_compressed_header(VP9Decoder *pbi, const uint8_t *data,
|
||||
for (i = 0; i < INTRA_MODES - 1; ++i)
|
||||
vp9_diff_update_prob(&r, &fc->y_mode_prob[j][i]);
|
||||
|
||||
#if CONFIG_EXT_PARTITION
|
||||
for (i = 0; i < PARTITION_TYPES - 1; ++i)
|
||||
vp9_diff_update_prob(&r, &fc->partition_prob[0][i]);
|
||||
for (j = 1; j < PARTITION_CONTEXTS; ++j)
|
||||
for (i = 0; i < EXT_PARTITION_TYPES - 1; ++i)
|
||||
vp9_diff_update_prob(&r, &fc->partition_prob[j][i]);
|
||||
#else
|
||||
for (j = 0; j < PARTITION_CONTEXTS; ++j)
|
||||
for (i = 0; i < PARTITION_TYPES - 1; ++i)
|
||||
vp9_diff_update_prob(&r, &fc->partition_prob[j][i]);
|
||||
|
||||
#endif
|
||||
read_mv_probs(nmvc, cm->allow_high_precision_mv, &r);
|
||||
#if CONFIG_EXT_TX
|
||||
read_ext_tx_probs(fc, &r);
|
||||
|
@ -39,6 +39,9 @@
|
||||
|
||||
static struct vp9_token intra_mode_encodings[INTRA_MODES];
|
||||
static struct vp9_token switchable_interp_encodings[SWITCHABLE_FILTERS];
|
||||
#if CONFIG_EXT_PARTITION
|
||||
static struct vp9_token ext_partition_encodings[EXT_PARTITION_TYPES];
|
||||
#endif
|
||||
static struct vp9_token partition_encodings[PARTITION_TYPES];
|
||||
static struct vp9_token inter_mode_encodings[INTER_MODES];
|
||||
#if CONFIG_EXT_TX
|
||||
@ -75,6 +78,9 @@ void vp9_entropy_mode_init() {
|
||||
vp9_tokens_from_tree(intra_mode_encodings, vp9_intra_mode_tree);
|
||||
vp9_tokens_from_tree(switchable_interp_encodings, vp9_switchable_interp_tree);
|
||||
vp9_tokens_from_tree(partition_encodings, vp9_partition_tree);
|
||||
#if CONFIG_EXT_PARTITION
|
||||
vp9_tokens_from_tree(ext_partition_encodings, vp9_ext_partition_tree);
|
||||
#endif
|
||||
vp9_tokens_from_tree(inter_mode_encodings, vp9_inter_mode_tree);
|
||||
#if CONFIG_EXT_TX
|
||||
vp9_tokens_from_tree(ext_tx_encodings, vp9_ext_tx_tree);
|
||||
@ -1129,7 +1135,15 @@ static void write_partition(const VP9_COMMON *const cm,
|
||||
const int has_cols = (mi_col + hbs) < cm->mi_cols;
|
||||
|
||||
if (has_rows && has_cols) {
|
||||
#if CONFIG_EXT_PARTITION
|
||||
if (bsize <= BLOCK_8X8)
|
||||
vp9_write_token(w, vp9_partition_tree, probs, &partition_encodings[p]);
|
||||
else
|
||||
vp9_write_token(w, vp9_ext_partition_tree, probs,
|
||||
&ext_partition_encodings[p]);
|
||||
#else
|
||||
vp9_write_token(w, vp9_partition_tree, probs, &partition_encodings[p]);
|
||||
#endif
|
||||
} else if (!has_rows && has_cols) {
|
||||
assert(p == PARTITION_SPLIT || p == PARTITION_HORZ);
|
||||
vp9_write(w, p == PARTITION_SPLIT, probs[1]);
|
||||
@ -2336,9 +2350,18 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
|
||||
prob_diff_update(vp9_intra_mode_tree, cm->fc.y_mode_prob[i],
|
||||
cm->counts.y_mode[i], INTRA_MODES, &header_bc);
|
||||
|
||||
#if CONFIG_EXT_PARTITION
|
||||
prob_diff_update(vp9_partition_tree, fc->partition_prob[0],
|
||||
cm->counts.partition[0], PARTITION_TYPES, &header_bc);
|
||||
for (i = 1; i < PARTITION_CONTEXTS; ++i)
|
||||
prob_diff_update(vp9_ext_partition_tree, fc->partition_prob[i],
|
||||
cm->counts.partition[i], EXT_PARTITION_TYPES,
|
||||
&header_bc);
|
||||
#else
|
||||
for (i = 0; i < PARTITION_CONTEXTS; ++i)
|
||||
prob_diff_update(vp9_partition_tree, fc->partition_prob[i],
|
||||
cm->counts.partition[i], PARTITION_TYPES, &header_bc);
|
||||
#endif
|
||||
|
||||
vp9_write_nmv_probs(cm, cm->allow_high_precision_mv, &header_bc);
|
||||
|
||||
|
@ -424,8 +424,11 @@ typedef struct VP9_COMP {
|
||||
PICK_MODE_CONTEXT *leaf_tree;
|
||||
PC_TREE *pc_tree;
|
||||
PC_TREE *pc_root;
|
||||
#if CONFIG_EXT_PARTITION
|
||||
int partition_cost[PARTITION_CONTEXTS][EXT_PARTITION_TYPES];
|
||||
#else
|
||||
int partition_cost[PARTITION_CONTEXTS][PARTITION_TYPES];
|
||||
|
||||
#endif
|
||||
int multi_arf_allowed;
|
||||
int multi_arf_enabled;
|
||||
int multi_arf_last_grp_enabled;
|
||||
|
Loading…
x
Reference in New Issue
Block a user