Commit feb517c8 authored by Jingning Han's avatar Jingning Han

Make cb4x4 mode support supertx

This commit makes the cb4x4 mode support supertx operation.

Change-Id: I1a713b2268c1029aebeb43aa6aeb0fa37b16810f
parent 1856e43f
...@@ -1670,12 +1670,22 @@ static const aom_prob default_filter_intra_probs[2] = { 230, 230 }; ...@@ -1670,12 +1670,22 @@ static const aom_prob default_filter_intra_probs[2] = { 230, 230 };
#if CONFIG_SUPERTX #if CONFIG_SUPERTX
static const aom_prob default_supertx_prob[PARTITION_SUPERTX_CONTEXTS] static const aom_prob default_supertx_prob[PARTITION_SUPERTX_CONTEXTS]
[TX_SIZES] = { [TX_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_TX64X64
{ 1, 1, 160, 160, 170, 180 },
{ 1, 1, 200, 200, 210, 220 },
#else
{ 1, 1, 160, 160, 170 },
{ 1, 1, 200, 200, 210 },
#endif // CONFIG_TX64X64
#else
#if CONFIG_TX64X64 #if CONFIG_TX64X64
{ 1, 160, 160, 170, 180 }, { 1, 160, 160, 170, 180 },
{ 1, 200, 200, 210, 220 }, { 1, 200, 200, 210, 220 },
#else #else
{ 1, 160, 160, 170 }, { 1, 160, 160, 170 },
{ 1, 200, 200, 210 }, { 1, 200, 200, 210 },
#endif // CONFIG_CB4X4
#endif // CONFIG_TX64X64 #endif // CONFIG_TX64X64
}; };
#endif // CONFIG_SUPERTX #endif // CONFIG_SUPERTX
......
...@@ -1006,6 +1006,11 @@ void av1_setup_pre_planes(MACROBLOCKD *xd, int idx, ...@@ -1006,6 +1006,11 @@ void av1_setup_pre_planes(MACROBLOCKD *xd, int idx,
} }
#if CONFIG_SUPERTX #if CONFIG_SUPERTX
#if CONFIG_CB4X4
static const uint8_t mask_4[4] = { 64, 62, 12, 0 };
static const uint8_t mask_4_uv[4] = { 64, 62, 12, 0 };
#endif // CONFIG_CB4X4
static const uint8_t mask_8[8] = { 64, 64, 62, 52, 12, 2, 0, 0 }; static const uint8_t mask_8[8] = { 64, 64, 62, 52, 12, 2, 0, 0 };
static const uint8_t mask_16[16] = { 63, 62, 60, 58, 55, 50, 43, 36, static const uint8_t mask_16[16] = { 63, 62, 60, 58, 55, 50, 43, 36,
...@@ -1027,6 +1032,9 @@ static const uint8_t mask_32_uv[32] = { 64, 64, 64, 64, 64, 64, 64, 64, ...@@ -1027,6 +1032,9 @@ static const uint8_t mask_32_uv[32] = { 64, 64, 64, 64, 64, 64, 64, 64,
static const uint8_t *get_supertx_mask(int length, int plane) { static const uint8_t *get_supertx_mask(int length, int plane) {
switch (length) { switch (length) {
#if CONFIG_CB4X4
case 4: return plane ? mask_4_uv : mask_4;
#endif // CONFIG_CB4X4
case 8: return plane ? mask_8_uv : mask_8; case 8: return plane ? mask_8_uv : mask_8;
case 16: return plane ? mask_16_uv : mask_16; case 16: return plane ? mask_16_uv : mask_16;
case 32: return plane ? mask_32_uv : mask_32; case 32: return plane ? mask_32_uv : mask_32;
......
...@@ -812,7 +812,12 @@ static void dec_extend_dir(AV1Decoder *const pbi, MACROBLOCKD *const xd, ...@@ -812,7 +812,12 @@ static void dec_extend_dir(AV1Decoder *const pbi, MACROBLOCKD *const xd,
const int mi_height = mi_size_high[bsize]; const int mi_height = mi_size_high[bsize];
int xss = xd->plane[1].subsampling_x; int xss = xd->plane[1].subsampling_x;
int yss = xd->plane[1].subsampling_y; int yss = xd->plane[1].subsampling_y;
int b_sub8x8 = (bsize < BLOCK_8X8) ? 1 : 0; #if CONFIG_CB4X4
const int unify_bsize = 1;
#else
const int unify_bsize = 0;
#endif
int b_sub8x8 = (bsize < BLOCK_8X8) && !unify_bsize ? 1 : 0;
BLOCK_SIZE extend_bsize; BLOCK_SIZE extend_bsize;
int unit, mi_row_pred, mi_col_pred; int unit, mi_row_pred, mi_col_pred;
...@@ -911,6 +916,11 @@ static void dec_predict_sb_complex(AV1Decoder *const pbi, MACROBLOCKD *const xd, ...@@ -911,6 +916,11 @@ static void dec_predict_sb_complex(AV1Decoder *const pbi, MACROBLOCKD *const xd,
int i; int i;
const int mi_offset = mi_row * cm->mi_stride + mi_col; const int mi_offset = mi_row * cm->mi_stride + mi_col;
uint8_t *dst_buf1[3], *dst_buf2[3], *dst_buf3[3]; uint8_t *dst_buf1[3], *dst_buf2[3], *dst_buf3[3];
#if CONFIG_CB4X4
const int unify_bsize = 1;
#else
const int unify_bsize = 0;
#endif
DECLARE_ALIGNED(16, uint8_t, tmp_buf1[MAX_MB_PLANE * MAX_TX_SQUARE * 2]); DECLARE_ALIGNED(16, uint8_t, tmp_buf1[MAX_MB_PLANE * MAX_TX_SQUARE * 2]);
DECLARE_ALIGNED(16, uint8_t, tmp_buf2[MAX_MB_PLANE * MAX_TX_SQUARE * 2]); DECLARE_ALIGNED(16, uint8_t, tmp_buf2[MAX_MB_PLANE * MAX_TX_SQUARE * 2]);
...@@ -966,7 +976,7 @@ static void dec_predict_sb_complex(AV1Decoder *const pbi, MACROBLOCKD *const xd, ...@@ -966,7 +976,7 @@ static void dec_predict_sb_complex(AV1Decoder *const pbi, MACROBLOCKD *const xd,
mi_row_top, mi_col_top, dst_buf, dst_stride); mi_row_top, mi_col_top, dst_buf, dst_stride);
break; break;
case PARTITION_HORZ: case PARTITION_HORZ:
if (bsize == BLOCK_8X8) { if (bsize == BLOCK_8X8 && !unify_bsize) {
// For sub8x8, predict in 8x8 unit // For sub8x8, predict in 8x8 unit
// First half // First half
dec_predict_b_extend(pbi, xd, tile, 0, mi_row, mi_col, mi_row, mi_col, dec_predict_b_extend(pbi, xd, tile, 0, mi_row, mi_col, mi_row, mi_col,
...@@ -1030,7 +1040,7 @@ static void dec_predict_sb_complex(AV1Decoder *const pbi, MACROBLOCKD *const xd, ...@@ -1030,7 +1040,7 @@ static void dec_predict_sb_complex(AV1Decoder *const pbi, MACROBLOCKD *const xd,
} }
break; break;
case PARTITION_VERT: case PARTITION_VERT:
if (bsize == BLOCK_8X8) { if (bsize == BLOCK_8X8 && !unify_bsize) {
// First half // First half
dec_predict_b_extend(pbi, xd, tile, 0, mi_row, mi_col, mi_row, mi_col, dec_predict_b_extend(pbi, xd, tile, 0, mi_row, mi_col, mi_row, mi_col,
mi_row_top, mi_col_top, dst_buf, dst_stride, mi_row_top, mi_col_top, dst_buf, dst_stride,
...@@ -1093,7 +1103,7 @@ static void dec_predict_sb_complex(AV1Decoder *const pbi, MACROBLOCKD *const xd, ...@@ -1093,7 +1103,7 @@ static void dec_predict_sb_complex(AV1Decoder *const pbi, MACROBLOCKD *const xd,
} }
break; break;
case PARTITION_SPLIT: case PARTITION_SPLIT:
if (bsize == BLOCK_8X8) { if (bsize == BLOCK_8X8 && !unify_bsize) {
dec_predict_b_extend(pbi, xd, tile, 0, mi_row, mi_col, mi_row, mi_col, dec_predict_b_extend(pbi, xd, tile, 0, mi_row, mi_col, mi_row, mi_col,
mi_row_top, mi_col_top, dst_buf, dst_stride, mi_row_top, mi_col_top, dst_buf, dst_stride,
top_bsize, BLOCK_8X8, 1, 0); top_bsize, BLOCK_8X8, 1, 0);
...@@ -1134,7 +1144,7 @@ static void dec_predict_sb_complex(AV1Decoder *const pbi, MACROBLOCKD *const xd, ...@@ -1134,7 +1144,7 @@ static void dec_predict_sb_complex(AV1Decoder *const pbi, MACROBLOCKD *const xd,
dst_buf3, dst_stride3); dst_buf3, dst_stride3);
} }
for (i = 0; i < MAX_MB_PLANE; i++) { for (i = 0; i < MAX_MB_PLANE; i++) {
if (bsize == BLOCK_8X8 && i != 0) if (bsize == BLOCK_8X8 && i != 0 && !unify_bsize)
continue; // Skip <4x4 chroma smoothing continue; // Skip <4x4 chroma smoothing
if (mi_row < cm->mi_rows && mi_col + hbs < cm->mi_cols) { if (mi_row < cm->mi_rows && mi_col + hbs < cm->mi_cols) {
av1_build_masked_inter_predictor_complex( av1_build_masked_inter_predictor_complex(
...@@ -4073,7 +4083,7 @@ static void read_supertx_probs(FRAME_CONTEXT *fc, aom_reader *r) { ...@@ -4073,7 +4083,7 @@ static void read_supertx_probs(FRAME_CONTEXT *fc, aom_reader *r) {
int i, j; int i, j;
if (aom_read(r, GROUP_DIFF_UPDATE_PROB, ACCT_STR)) { if (aom_read(r, GROUP_DIFF_UPDATE_PROB, ACCT_STR)) {
for (i = 0; i < PARTITION_SUPERTX_CONTEXTS; ++i) { for (i = 0; i < PARTITION_SUPERTX_CONTEXTS; ++i) {
for (j = 1; j < TX_SIZES; ++j) { for (j = TX_8X8; j < TX_SIZES; ++j) {
av1_diff_update_prob(r, &fc->supertx_prob[i][j], ACCT_STR); av1_diff_update_prob(r, &fc->supertx_prob[i][j], ACCT_STR);
} }
} }
......
This diff is collapsed.
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