Commit 94d84461 authored by Yue Chen's avatar Yue Chen Committed by Debargha Mukherjee

Remove full interintra mode set & adjust probs of the simplified set

Improved the performance a little bit compared to using the full set

Change-Id: I28a96459fa77d7e1d5c101d162faa2effd525341
parent eec47e65
......@@ -1086,33 +1086,13 @@ static const aom_prob default_interintra_prob[BLOCK_SIZE_GROUPS] = {
208, 208, 208, 208,
};
#if REDUCED_INTERINTRA_MODES == 1
static const aom_prob
default_interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1] = {
{ 65, 32, 144 }, // block_size < 8x8
{ 132, 68, 165 }, // block_size < 16x16
{ 173, 80, 176 }, // block_size < 32x32
{ 221, 135, 194 } // block_size >= 32x32
{ 88, 16, 150 }, // block_size < 8x8
{ 75, 26, 150 }, // block_size < 16x16
{ 73, 24, 150 }, // block_size < 32x32
{ 96, 27, 150 } // block_size >= 32x32
};
#else // REDUCED_INTERINTRA_MODES
#if CONFIG_ALT_INTRA
static const aom_prob
default_interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1] = {
{ 88, 16, 47, 133, 143, 150, 70, 48, 84, 122 }, // block_size < 8x8
{ 75, 26, 51, 120, 158, 157, 44, 45, 56, 102 }, // block_size < 16x16
{ 73, 24, 60, 115, 184, 164, 26, 36, 32, 63 }, // block_size < 32x32
{ 96, 27, 50, 107, 221, 148, 16, 22, 14, 39 }, // block_size >= 32x32
};
#else
static const aom_prob
default_interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1] = {
{ 65, 32, 18, 144, 162, 194, 41, 51, 98 }, // block_size < 8x8
{ 132, 68, 18, 165, 217, 196, 45, 40, 78 }, // block_size < 16x16
{ 173, 80, 19, 176, 240, 193, 64, 35, 46 }, // block_size < 32x32
{ 221, 135, 38, 194, 248, 121, 96, 85, 29 } // block_size >= 32x32
};
#endif // CONFIG_ALT_INTRA
#endif // REDUCED_INTERINTRA_MODES
static const aom_prob default_wedge_interintra_prob[BLOCK_SIZES] = {
#if CONFIG_CB4X4
......@@ -1285,7 +1265,6 @@ const aom_tree_index av1_inter_mode_tree[TREE_SIZE(INTER_MODES)] = {
#if CONFIG_EXT_INTER
/* clang-format off */
#if CONFIG_INTERINTRA
#if REDUCED_INTERINTRA_MODES == 1
const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = {
-II_DC_PRED, 2, /* 0 = II_DC_NODE */
#if CONFIG_ALT_INTRA
......@@ -1295,34 +1274,6 @@ const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = {
#endif
-II_V_PRED, -II_H_PRED /* 2 = II_V_NODE */
};
#else // REDUCED_INTERINTRA_MODES
#if CONFIG_ALT_INTRA
const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = {
-II_DC_PRED, 2, /* 0 = II_DC_NODE */
-II_TM_PRED, 4, /* 1 = II_TM_NODE */
-II_V_PRED, 6, /* 2 = II_V_NODE */
8, 12, /* 3 = II_COM_NODE */
-II_H_PRED, 10, /* 4 = II_H_NODE */
-II_D135_PRED, -II_D117_PRED, /* 5 = II_D135_NODE */
-II_D45_PRED, 14, /* 6 = II_D45_NODE */
-II_D63_PRED, 16, /* 7 = II_D63_NODE */
-II_D153_PRED, 18, /* 8 = II_D153_NODE */
-II_D207_PRED, -II_SMOOTH_PRED, /* 9 = II_D207_NODE */
};
#else
const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = {
-II_DC_PRED, 2, /* 0 = II_DC_NODE */
-II_TM_PRED, 4, /* 1 = II_TM_NODE */
-II_V_PRED, 6, /* 2 = II_V_NODE */
8, 12, /* 3 = II_COM_NODE */
-II_H_PRED, 10, /* 4 = II_H_NODE */
-II_D135_PRED, -II_D117_PRED, /* 5 = II_D135_NODE */
-II_D45_PRED, 14, /* 6 = II_D45_NODE */
-II_D63_PRED, 16, /* 7 = II_D63_NODE */
-II_D153_PRED, -II_D207_PRED /* 8 = II_D153_NODE */
};
#endif
#endif // REDUCED_INTERINTRA_MODES
#endif // CONFIG_INTERINTRA
const aom_tree_index av1_inter_compound_mode_tree
......
......@@ -367,8 +367,6 @@ typedef enum {
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
#define REDUCED_INTERINTRA_MODES 0
#if REDUCED_INTERINTRA_MODES == 1
typedef enum {
II_DC_PRED = 0,
II_V_PRED,
......@@ -380,24 +378,6 @@ typedef enum {
#endif // CONFIG_ALT_INTRA
INTERINTRA_MODES
} INTERINTRA_MODE;
#else
typedef enum {
II_DC_PRED = 0,
II_V_PRED,
II_H_PRED,
II_D45_PRED,
II_D135_PRED,
II_D117_PRED,
II_D153_PRED,
II_D207_PRED,
II_D63_PRED,
#if CONFIG_ALT_INTRA
II_SMOOTH_PRED,
#endif // CONFIG_ALT_INTRA
II_TM_PRED,
INTERINTRA_MODES
} INTERINTRA_MODE;
#endif
#endif
typedef enum {
......
......@@ -2628,56 +2628,8 @@ static void combine_interintra(INTERINTRA_MODE mode, int use_wedge_interintra,
}
break;
#if REDUCED_INTERINTRA_MODES == 0
case II_D63_PRED:
case II_D117_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale = (ii_weights1d[i * size_scale] * 3 +
ii_weights1d[j * size_scale]) >>
2;
comppred[i * compstride + j] =
AOM_BLEND_A64(scale, intrapred[i * intrastride + j],
interpred[i * interstride + j]);
}
}
break;
case II_D207_PRED:
case II_D153_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale = (ii_weights1d[j * size_scale] * 3 +
ii_weights1d[i * size_scale]) >>
2;
comppred[i * compstride + j] =
AOM_BLEND_A64(scale, intrapred[i * intrastride + j],
interpred[i * interstride + j]);
}
}
break;
case II_D45_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale =
(ii_weights1d[i * size_scale] + ii_weights1d[j * size_scale]) >>
1;
comppred[i * compstride + j] =
AOM_BLEND_A64(scale, intrapred[i * intrastride + j],
interpred[i * interstride + j]);
}
}
break;
#endif
#if REDUCED_INTERINTRA_MODES == 0 || CONFIG_ALT_INTRA
#if REDUCED_INTERINTRA_MODES == 0
case II_D135_PRED:
#endif
#if CONFIG_ALT_INTRA
case II_SMOOTH_PRED:
#endif
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale = ii_weights1d[(i < j ? i : j) * size_scale];
......@@ -2689,7 +2641,7 @@ static void combine_interintra(INTERINTRA_MODE mode, int use_wedge_interintra,
break;
#endif
#if !(REDUCED_INTERINTRA_MODES == 1 && CONFIG_ALT_INTRA)
#if !CONFIG_ALT_INTRA
case II_TM_PRED:
#endif
case II_DC_PRED:
......@@ -2755,56 +2707,8 @@ static void combine_interintra_highbd(
}
break;
#if REDUCED_INTERINTRA_MODES == 0
case II_D63_PRED:
case II_D117_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale = (ii_weights1d[i * size_scale] * 3 +
ii_weights1d[j * size_scale]) >>
2;
comppred[i * compstride + j] =
AOM_BLEND_A64(scale, intrapred[i * intrastride + j],
interpred[i * interstride + j]);
}
}
break;
case II_D207_PRED:
case II_D153_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale = (ii_weights1d[j * size_scale] * 3 +
ii_weights1d[i * size_scale]) >>
2;
comppred[i * compstride + j] =
AOM_BLEND_A64(scale, intrapred[i * intrastride + j],
interpred[i * interstride + j]);
}
}
break;
case II_D45_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale =
(ii_weights1d[i * size_scale] + ii_weights1d[j * size_scale]) >>
1;
comppred[i * compstride + j] =
AOM_BLEND_A64(scale, intrapred[i * intrastride + j],
interpred[i * interstride + j]);
}
}
break;
#endif
#if REDUCED_INTERINTRA_MODES == 0 || CONFIG_ALT_INTRA
#if REDUCED_INTERINTRA_MODES == 0
case II_D135_PRED:
#endif
#if CONFIG_ALT_INTRA
case II_SMOOTH_PRED:
#endif
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale = ii_weights1d[(i < j ? i : j) * size_scale];
......@@ -2816,7 +2720,7 @@ static void combine_interintra_highbd(
break;
#endif
#if !(REDUCED_INTERINTRA_MODES == 1 && CONFIG_ALT_INTRA)
#if !CONFIG_ALT_INTRA
case II_TM_PRED:
#endif
case II_DC_PRED:
......
......@@ -29,7 +29,6 @@ void av1_predict_intra_block(const MACROBLOCKD *xd, int bw, int bh,
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
// Mapping of interintra to intra mode for use in the intra component
#if REDUCED_INTERINTRA_MODES == 1
static const PREDICTION_MODE interintra_to_intra_mode[INTERINTRA_MODES] = {
DC_PRED, V_PRED, H_PRED,
#if CONFIG_ALT_INTRA
......@@ -54,30 +53,7 @@ static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = {
II_TM_PRED
#endif
};
#else
static const PREDICTION_MODE interintra_to_intra_mode[INTERINTRA_MODES] = {
DC_PRED, V_PRED, H_PRED, D45_PRED, D135_PRED,
D117_PRED, D153_PRED, D207_PRED, D63_PRED,
#if CONFIG_ALT_INTRA
SMOOTH_PRED,
#endif
TM_PRED
};
// Mapping of intra mode to the interintra mode
static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = {
II_DC_PRED, II_V_PRED, II_H_PRED, II_D45_PRED, II_D135_PRED,
II_D117_PRED, II_D153_PRED, II_D207_PRED, II_D63_PRED,
#if CONFIG_ALT_INTRA
II_SMOOTH_PRED,
#endif
II_TM_PRED
};
#endif
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
#ifdef __cplusplus
} // extern "C"
#endif
#if CONFIG_FILTER_INTRA
#define FILTER_INTRA_PREC_BITS 10
......@@ -98,4 +74,7 @@ static INLINE int av1_is_directional_mode(PREDICTION_MODE mode,
}
#endif // CONFIG_EXT_INTRA
#ifdef __cplusplus
} // extern "C"
#endif
#endif // AV1_COMMON_RECONINTRA_H_
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