Commit 88fe7871 authored by Debargha Mukherjee's avatar Debargha Mukherjee

Refactor wedge generation

Change-Id: I2ec4f562e28a4673477e20186f9d6167b24b76b8
parent cf3ee225
......@@ -53,31 +53,41 @@ static INLINE int is_inter_mode(PREDICTION_MODE mode) {
}
#if CONFIG_EXT_INTER
#define WEDGE_BITS_SML 3
#define WEDGE_BITS_MED 4
#define WEDGE_BITS_BIG 5
#define WEDGE_BITS_SML 2
#define WEDGE_BITS_MED 3
#define WEDGE_BITS_BIG 4
#define WEDGE_NONE -1
#define WEDGE_WEIGHT_BITS 6
static INLINE int get_wedge_bits(BLOCK_SIZE sb_type) {
if (sb_type < BLOCK_8X8)
return 0;
if (sb_type <= BLOCK_8X8)
return WEDGE_BITS_SML;
else if (sb_type <= BLOCK_32X32)
return WEDGE_BITS_MED;
else
return WEDGE_BITS_BIG;
}
static const int get_wedge_bits_lookup[BLOCK_SIZES] = {
0,
0,
0,
WEDGE_BITS_SML,
WEDGE_BITS_MED,
WEDGE_BITS_MED,
WEDGE_BITS_MED,
WEDGE_BITS_MED,
WEDGE_BITS_MED,
WEDGE_BITS_MED,
WEDGE_BITS_BIG,
WEDGE_BITS_BIG,
WEDGE_BITS_BIG,
#if CONFIG_EXT_PARTITION
WEDGE_BITS_BIG,
WEDGE_BITS_BIG,
WEDGE_BITS_BIG,
#endif // CONFIG_EXT_PARTITION
};
static INLINE int is_interinter_wedge_used(BLOCK_SIZE sb_type) {
(void) sb_type;
return get_wedge_bits(sb_type) > 0;
return get_wedge_bits_lookup[sb_type] > 0;
}
static INLINE int is_interintra_wedge_used(BLOCK_SIZE sb_type) {
(void) sb_type;
return 0; // get_wedge_bits(sb_type) > 0;
return get_wedge_bits_lookup[sb_type] > 0;
}
static INLINE int is_inter_singleref_mode(PREDICTION_MODE mode) {
......@@ -205,9 +215,10 @@ typedef struct {
// TODO(debargha): Consolidate these flags
int use_wedge_interintra;
int interintra_wedge_index;
int interintra_uv_wedge_index;
int interintra_wedge_sign;
int use_wedge_interinter;
int interinter_wedge_index;
int interinter_wedge_sign;
#endif // CONFIG_EXT_INTER
#if CONFIG_OBMC
......
This diff is collapsed.
......@@ -410,6 +410,7 @@ void vp10_build_prediction_by_left_preds(VP10_COMMON *cm,
void vp10_init_wedge_masks();
const uint8_t *vp10_get_soft_mask(int wedge_index,
int wedge_sign,
BLOCK_SIZE sb_type,
int h, int w);
......
......@@ -1566,8 +1566,8 @@ static void read_inter_block_mode_info(VP10Decoder *const pbi,
xd->counts->wedge_interintra[bsize][mbmi->use_wedge_interintra]++;
if (mbmi->use_wedge_interintra) {
mbmi->interintra_wedge_index =
mbmi->interintra_uv_wedge_index =
vp10_read_literal(r, get_wedge_bits(bsize));
vp10_read_literal(r, get_wedge_bits_lookup[bsize]);
mbmi->interintra_wedge_sign = 0;
}
}
}
......@@ -1599,7 +1599,8 @@ static void read_inter_block_mode_info(VP10Decoder *const pbi,
xd->counts->wedge_interinter[bsize][mbmi->use_wedge_interinter]++;
if (mbmi->use_wedge_interinter) {
mbmi->interinter_wedge_index =
vp10_read_literal(r, get_wedge_bits(bsize));
vp10_read_literal(r, get_wedge_bits_lookup[bsize]);
mbmi->interinter_wedge_sign = vp10_read_bit(r);
}
}
#endif // CONFIG_EXT_INTER
......
......@@ -1316,7 +1316,8 @@ static void pack_inter_mode_mvs(VP10_COMP *cpi, const MODE_INFO *mi,
cm->fc->wedge_interintra_prob[bsize]);
if (mbmi->use_wedge_interintra) {
vp10_write_literal(w, mbmi->interintra_wedge_index,
get_wedge_bits(bsize));
get_wedge_bits_lookup[bsize]);
assert(mbmi->interintra_wedge_sign == 0);
}
}
}
......@@ -1343,9 +1344,11 @@ static void pack_inter_mode_mvs(VP10_COMP *cpi, const MODE_INFO *mi,
is_interinter_wedge_used(bsize)) {
vp10_write(w, mbmi->use_wedge_interinter,
cm->fc->wedge_interinter_prob[bsize]);
if (mbmi->use_wedge_interinter)
if (mbmi->use_wedge_interinter) {
vp10_write_literal(w, mbmi->interinter_wedge_index,
get_wedge_bits(bsize));
get_wedge_bits_lookup[bsize]);
vp10_write_bit(w, mbmi->interinter_wedge_sign);
}
}
#endif // CONFIG_EXT_INTER
......
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