Commit 4d3cf459 authored by Hui Su's avatar Hui Su Committed by Gerrit Code Review
Browse files

Merge "Merge MISC_FIXES" into nextgenv2

parents af084fbe 66f2f65e
...@@ -104,9 +104,7 @@ typedef struct { ...@@ -104,9 +104,7 @@ typedef struct {
TX_SIZE inter_tx_size[64]; TX_SIZE inter_tx_size[64];
#endif #endif
int8_t skip; int8_t skip;
#if CONFIG_MISC_FIXES
int8_t has_no_coeffs; int8_t has_no_coeffs;
#endif
int8_t segment_id; int8_t segment_id;
int8_t seg_id_predicted; // valid only when temporal_update is enabled int8_t seg_id_predicted; // valid only when temporal_update is enabled
......
...@@ -127,21 +127,6 @@ const vpx_prob vp10_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] = ...@@ -127,21 +127,6 @@ const vpx_prob vp10_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] =
} }
}; };
#if !CONFIG_MISC_FIXES
const vpx_prob vp10_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1] = {
{ 144, 11, 54, 157, 195, 130, 46, 58, 108 }, // y = dc
{ 118, 15, 123, 148, 131, 101, 44, 93, 131 }, // y = v
{ 113, 12, 23, 188, 226, 142, 26, 32, 125 }, // y = h
{ 120, 11, 50, 123, 163, 135, 64, 77, 103 }, // y = d45
{ 113, 9, 36, 155, 111, 157, 32, 44, 161 }, // y = d135
{ 116, 9, 55, 176, 76, 96, 37, 61, 149 }, // y = d117
{ 115, 9, 28, 141, 161, 167, 21, 25, 193 }, // y = d153
{ 120, 12, 32, 145, 195, 142, 32, 38, 86 }, // y = d207
{ 116, 12, 64, 120, 140, 125, 49, 115, 121 }, // y = d63
{ 102, 19, 66, 162, 182, 122, 35, 59, 128 } // y = tm
};
#endif
static const vpx_prob default_if_y_probs[BLOCK_SIZE_GROUPS][INTRA_MODES - 1] = { static const vpx_prob default_if_y_probs[BLOCK_SIZE_GROUPS][INTRA_MODES - 1] = {
{ 65, 32, 18, 144, 162, 194, 41, 51, 98 }, // block_size < 8x8 { 65, 32, 18, 144, 162, 194, 41, 51, 98 }, // block_size < 8x8
{ 132, 68, 18, 165, 217, 196, 45, 40, 78 }, // block_size < 16x16 { 132, 68, 18, 165, 217, 196, 45, 40, 78 }, // block_size < 16x16
...@@ -162,32 +147,6 @@ static const vpx_prob default_uv_probs[INTRA_MODES][INTRA_MODES - 1] = { ...@@ -162,32 +147,6 @@ static const vpx_prob default_uv_probs[INTRA_MODES][INTRA_MODES - 1] = {
{ 101, 21, 107, 181, 192, 103, 19, 67, 125 } // y = tm { 101, 21, 107, 181, 192, 103, 19, 67, 125 } // y = tm
}; };
#if !CONFIG_MISC_FIXES
const vpx_prob vp10_kf_partition_probs[PARTITION_CONTEXTS]
[PARTITION_TYPES - 1] = {
// 8x8 -> 4x4
{ 158, 97, 94 }, // a/l both not split
{ 93, 24, 99 }, // a split, l not split
{ 85, 119, 44 }, // l split, a not split
{ 62, 59, 67 }, // a/l both split
// 16x16 -> 8x8
{ 149, 53, 53 }, // a/l both not split
{ 94, 20, 48 }, // a split, l not split
{ 83, 53, 24 }, // l split, a not split
{ 52, 18, 18 }, // a/l both split
// 32x32 -> 16x16
{ 150, 40, 39 }, // a/l both not split
{ 78, 12, 26 }, // a split, l not split
{ 67, 33, 11 }, // l split, a not split
{ 24, 7, 5 }, // a/l both split
// 64x64 -> 32x32
{ 174, 35, 49 }, // a/l both not split
{ 68, 11, 27 }, // a split, l not split
{ 57, 15, 9 }, // l split, a not split
{ 12, 3, 3 }, // a/l both split
};
#endif
static const vpx_prob default_partition_probs[PARTITION_CONTEXTS] static const vpx_prob default_partition_probs[PARTITION_CONTEXTS]
[PARTITION_TYPES - 1] = { [PARTITION_TYPES - 1] = {
// 8x8 -> 4x4 // 8x8 -> 4x4
...@@ -1085,13 +1044,12 @@ default_intra_ext_tx_prob[EXT_TX_SETS_INTRA][EXT_TX_SIZES] ...@@ -1085,13 +1044,12 @@ default_intra_ext_tx_prob[EXT_TX_SETS_INTRA][EXT_TX_SIZES]
} }
}; };
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
// FIXME(someone) need real defaults here // FIXME(someone) need real defaults here
static const struct segmentation_probs default_seg_probs = { static const struct segmentation_probs default_seg_probs = {
{ 128, 128, 128, 128, 128, 128, 128 }, { 128, 128, 128, 128, 128, 128, 128 },
{ 128, 128, 128 }, { 128, 128, 128 },
}; };
#endif
#if CONFIG_EXT_INTRA #if CONFIG_EXT_INTRA
static const vpx_prob default_ext_intra_probs[2] = {230, 230}; static const vpx_prob default_ext_intra_probs[2] = {230, 230};
...@@ -1116,10 +1074,8 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { ...@@ -1116,10 +1074,8 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
vp10_copy(fc->inter_ext_tx_prob, default_inter_ext_tx_prob); vp10_copy(fc->inter_ext_tx_prob, default_inter_ext_tx_prob);
vp10_copy(fc->intra_ext_tx_prob, default_intra_ext_tx_prob); vp10_copy(fc->intra_ext_tx_prob, default_intra_ext_tx_prob);
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
vp10_copy(fc->seg.tree_probs, default_seg_probs.tree_probs); vp10_copy(fc->seg.tree_probs, default_seg_probs.tree_probs);
vp10_copy(fc->seg.pred_probs, default_seg_probs.pred_probs); vp10_copy(fc->seg.pred_probs, default_seg_probs.pred_probs);
#endif
#if CONFIG_EXT_INTRA #if CONFIG_EXT_INTRA
vp10_copy(fc->ext_intra_probs, default_ext_intra_probs); vp10_copy(fc->ext_intra_probs, default_ext_intra_probs);
#endif // CONFIG_EXT_INTRA #endif // CONFIG_EXT_INTRA
...@@ -1168,16 +1124,6 @@ void vp10_adapt_inter_frame_probs(VP10_COMMON *cm) { ...@@ -1168,16 +1124,6 @@ void vp10_adapt_inter_frame_probs(VP10_COMMON *cm) {
vpx_tree_merge_probs(vp10_intra_mode_tree, pre_fc->y_mode_prob[i], vpx_tree_merge_probs(vp10_intra_mode_tree, pre_fc->y_mode_prob[i],
counts->y_mode[i], fc->y_mode_prob[i]); counts->y_mode[i], fc->y_mode_prob[i]);
#if !CONFIG_MISC_FIXES
for (i = 0; i < INTRA_MODES; ++i)
vpx_tree_merge_probs(vp10_intra_mode_tree, pre_fc->uv_mode_prob[i],
counts->uv_mode[i], fc->uv_mode_prob[i]);
for (i = 0; i < PARTITION_CONTEXTS; i++)
vpx_tree_merge_probs(vp10_partition_tree, pre_fc->partition_prob[i],
counts->partition[i], fc->partition_prob[i]);
#endif
if (cm->interp_filter == SWITCHABLE) { if (cm->interp_filter == SWITCHABLE) {
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++)
vpx_tree_merge_probs(vp10_switchable_interp_tree, vpx_tree_merge_probs(vp10_switchable_interp_tree,
...@@ -1252,7 +1198,7 @@ void vp10_adapt_intra_frame_probs(VP10_COMMON *cm) { ...@@ -1252,7 +1198,7 @@ void vp10_adapt_intra_frame_probs(VP10_COMMON *cm) {
} }
} }
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
if (cm->seg.temporal_update) { if (cm->seg.temporal_update) {
for (i = 0; i < PREDICTION_PROBS; i++) for (i = 0; i < PREDICTION_PROBS; i++)
fc->seg.pred_probs[i] = mode_mv_merge_probs(pre_fc->seg.pred_probs[i], fc->seg.pred_probs[i] = mode_mv_merge_probs(pre_fc->seg.pred_probs[i],
...@@ -1272,7 +1218,7 @@ void vp10_adapt_intra_frame_probs(VP10_COMMON *cm) { ...@@ -1272,7 +1218,7 @@ void vp10_adapt_intra_frame_probs(VP10_COMMON *cm) {
for (i = 0; i < PARTITION_CONTEXTS; i++) for (i = 0; i < PARTITION_CONTEXTS; i++)
vpx_tree_merge_probs(vp10_partition_tree, pre_fc->partition_prob[i], vpx_tree_merge_probs(vp10_partition_tree, pre_fc->partition_prob[i],
counts->partition[i], fc->partition_prob[i]); counts->partition[i], fc->partition_prob[i]);
#endif
#if CONFIG_EXT_INTRA #if CONFIG_EXT_INTRA
for (i = 0; i < PLANE_TYPES; ++i) { for (i = 0; i < PLANE_TYPES; ++i) {
fc->ext_intra_probs[i] = mode_mv_merge_probs( fc->ext_intra_probs[i] = mode_mv_merge_probs(
......
...@@ -77,9 +77,7 @@ typedef struct frame_contexts { ...@@ -77,9 +77,7 @@ typedef struct frame_contexts {
vpx_prob intra_ext_tx_prob[EXT_TX_SETS_INTRA][EXT_TX_SIZES][INTRA_MODES] vpx_prob intra_ext_tx_prob[EXT_TX_SETS_INTRA][EXT_TX_SIZES][INTRA_MODES]
[TX_TYPES - 1]; [TX_TYPES - 1];
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
struct segmentation_probs seg; struct segmentation_probs seg;
#endif
#if CONFIG_EXT_INTRA #if CONFIG_EXT_INTRA
vpx_prob ext_intra_probs[PLANE_TYPES]; vpx_prob ext_intra_probs[PLANE_TYPES];
#endif // CONFIG_EXT_INTRA #endif // CONFIG_EXT_INTRA
...@@ -111,9 +109,7 @@ typedef struct FRAME_COUNTS { ...@@ -111,9 +109,7 @@ typedef struct FRAME_COUNTS {
unsigned int intra_ext_tx[EXT_TX_SETS_INTRA][EXT_TX_SIZES][INTRA_MODES] unsigned int intra_ext_tx[EXT_TX_SETS_INTRA][EXT_TX_SIZES][INTRA_MODES]
[TX_TYPES]; [TX_TYPES];
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
struct seg_counts seg; struct seg_counts seg;
#endif
#if CONFIG_EXT_INTRA #if CONFIG_EXT_INTRA
unsigned int ext_intra[PLANE_TYPES][2]; unsigned int ext_intra[PLANE_TYPES][2];
#endif // CONFIG_EXT_INTRA #endif // CONFIG_EXT_INTRA
...@@ -121,11 +117,6 @@ typedef struct FRAME_COUNTS { ...@@ -121,11 +117,6 @@ typedef struct FRAME_COUNTS {
extern const vpx_prob vp10_kf_y_mode_prob[INTRA_MODES][INTRA_MODES] extern const vpx_prob vp10_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
[INTRA_MODES - 1]; [INTRA_MODES - 1];
#if !CONFIG_MISC_FIXES
extern const vpx_prob vp10_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
extern const vpx_prob vp10_kf_partition_probs[PARTITION_CONTEXTS]
[PARTITION_TYPES - 1];
#endif
extern const vpx_prob extern const vpx_prob
vp10_default_palette_y_mode_prob[PALETTE_BLOCK_SIZES][PALETTE_Y_MODE_CONTEXTS]; vp10_default_palette_y_mode_prob[PALETTE_BLOCK_SIZES][PALETTE_Y_MODE_CONTEXTS];
extern const vpx_prob extern const vpx_prob
......
...@@ -719,11 +719,7 @@ static void build_masks(const loop_filter_info_n *const lfi_n, ...@@ -719,11 +719,7 @@ static void build_masks(const loop_filter_info_n *const lfi_n,
uint64_t *const int_4x4_y = &lfm->int_4x4_y; uint64_t *const int_4x4_y = &lfm->int_4x4_y;
uint16_t *const left_uv = &lfm->left_uv[tx_size_uv]; uint16_t *const left_uv = &lfm->left_uv[tx_size_uv];
uint16_t *const above_uv = &lfm->above_uv[tx_size_uv]; uint16_t *const above_uv = &lfm->above_uv[tx_size_uv];
#if CONFIG_MISC_FIXES
uint16_t *const int_4x4_uv = &lfm->left_int_4x4_uv; uint16_t *const int_4x4_uv = &lfm->left_int_4x4_uv;
#else
uint16_t *const int_4x4_uv = &lfm->int_4x4_uv;
#endif
int i; int i;
// If filter level is 0 we don't loop filter. // If filter level is 0 we don't loop filter.
...@@ -758,13 +754,8 @@ static void build_masks(const loop_filter_info_n *const lfi_n, ...@@ -758,13 +754,8 @@ static void build_masks(const loop_filter_info_n *const lfi_n,
// If the block has no coefficients and is not intra we skip applying // If the block has no coefficients and is not intra we skip applying
// the loop filter on block edges. // the loop filter on block edges.
#if CONFIG_MISC_FIXES
if ((mbmi->skip || mbmi->has_no_coeffs) && is_inter_block(mbmi)) if ((mbmi->skip || mbmi->has_no_coeffs) && is_inter_block(mbmi))
return; return;
#else
if (mbmi->skip && is_inter_block(mbmi))
return;
#endif
// Here we are adding a mask for the transform size. The transform // Here we are adding a mask for the transform size. The transform
// size mask is set to be correct for a 64x64 prediction block size. We // size mask is set to be correct for a 64x64 prediction block size. We
...@@ -821,13 +812,8 @@ static void build_y_mask(const loop_filter_info_n *const lfi_n, ...@@ -821,13 +812,8 @@ static void build_y_mask(const loop_filter_info_n *const lfi_n,
*above_y |= above_prediction_mask[block_size] << shift_y; *above_y |= above_prediction_mask[block_size] << shift_y;
*left_y |= left_prediction_mask[block_size] << shift_y; *left_y |= left_prediction_mask[block_size] << shift_y;
#if CONFIG_MISC_FIXES
if ((mbmi->skip || mbmi->has_no_coeffs) && is_inter_block(mbmi)) if ((mbmi->skip || mbmi->has_no_coeffs) && is_inter_block(mbmi))
return; return;
#else
if (mbmi->skip && is_inter_block(mbmi))
return;
#endif
*above_y |= (size_mask[block_size] & *above_y |= (size_mask[block_size] &
above_64x64_txform_mask[tx_size_y]) << shift_y; above_64x64_txform_mask[tx_size_y]) << shift_y;
...@@ -1019,11 +1005,7 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col, ...@@ -1019,11 +1005,7 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col,
lfm->above_uv[i] &= mask_uv; lfm->above_uv[i] &= mask_uv;
} }
lfm->int_4x4_y &= mask_y; lfm->int_4x4_y &= mask_y;
#if CONFIG_MISC_FIXES
lfm->above_int_4x4_uv = lfm->left_int_4x4_uv & mask_uv; lfm->above_int_4x4_uv = lfm->left_int_4x4_uv & mask_uv;
#else
lfm->int_4x4_uv &= mask_uv;
#endif
// We don't apply a wide loop filter on the last uv block row. If set // We don't apply a wide loop filter on the last uv block row. If set
// apply the shorter one instead. // apply the shorter one instead.
...@@ -1057,11 +1039,7 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col, ...@@ -1057,11 +1039,7 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col,
lfm->above_uv[i] &= mask_uv; lfm->above_uv[i] &= mask_uv;
} }
lfm->int_4x4_y &= mask_y; lfm->int_4x4_y &= mask_y;
#if CONFIG_MISC_FIXES
lfm->left_int_4x4_uv &= mask_uv_int; lfm->left_int_4x4_uv &= mask_uv_int;
#else
lfm->int_4x4_uv &= mask_uv_int;
#endif
// We don't apply a wide loop filter on the last uv column. If set // We don't apply a wide loop filter on the last uv column. If set
// apply the shorter one instead. // apply the shorter one instead.
...@@ -1091,11 +1069,7 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col, ...@@ -1091,11 +1069,7 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col,
assert(!(lfm->left_uv[TX_16X16]&lfm->left_uv[TX_8X8])); assert(!(lfm->left_uv[TX_16X16]&lfm->left_uv[TX_8X8]));
assert(!(lfm->left_uv[TX_16X16] & lfm->left_uv[TX_4X4])); assert(!(lfm->left_uv[TX_16X16] & lfm->left_uv[TX_4X4]));
assert(!(lfm->left_uv[TX_8X8] & lfm->left_uv[TX_4X4])); assert(!(lfm->left_uv[TX_8X8] & lfm->left_uv[TX_4X4]));
#if CONFIG_MISC_FIXES
assert(!(lfm->left_int_4x4_uv & lfm->left_uv[TX_16X16])); assert(!(lfm->left_int_4x4_uv & lfm->left_uv[TX_16X16]));
#else
assert(!(lfm->int_4x4_uv & lfm->left_uv[TX_16X16]));
#endif
assert(!(lfm->above_y[TX_16X16] & lfm->above_y[TX_8X8])); assert(!(lfm->above_y[TX_16X16] & lfm->above_y[TX_8X8]));
assert(!(lfm->above_y[TX_16X16] & lfm->above_y[TX_4X4])); assert(!(lfm->above_y[TX_16X16] & lfm->above_y[TX_4X4]));
assert(!(lfm->above_y[TX_8X8] & lfm->above_y[TX_4X4])); assert(!(lfm->above_y[TX_8X8] & lfm->above_y[TX_4X4]));
...@@ -1103,11 +1077,7 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col, ...@@ -1103,11 +1077,7 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col,
assert(!(lfm->above_uv[TX_16X16] & lfm->above_uv[TX_8X8])); assert(!(lfm->above_uv[TX_16X16] & lfm->above_uv[TX_8X8]));
assert(!(lfm->above_uv[TX_16X16] & lfm->above_uv[TX_4X4])); assert(!(lfm->above_uv[TX_16X16] & lfm->above_uv[TX_4X4]));
assert(!(lfm->above_uv[TX_8X8] & lfm->above_uv[TX_4X4])); assert(!(lfm->above_uv[TX_8X8] & lfm->above_uv[TX_4X4]));
#if CONFIG_MISC_FIXES
assert(!(lfm->above_int_4x4_uv & lfm->above_uv[TX_16X16])); assert(!(lfm->above_int_4x4_uv & lfm->above_uv[TX_16X16]));
#else
assert(!(lfm->int_4x4_uv & lfm->above_uv[TX_16X16]));
#endif
} }
static void filter_selectively_vert(uint8_t *s, int pitch, static void filter_selectively_vert(uint8_t *s, int pitch,
...@@ -1510,11 +1480,7 @@ void vp10_filter_block_plane_ss11(VP10_COMMON *const cm, ...@@ -1510,11 +1480,7 @@ void vp10_filter_block_plane_ss11(VP10_COMMON *const cm,
uint16_t mask_16x16 = lfm->left_uv[TX_16X16]; uint16_t mask_16x16 = lfm->left_uv[TX_16X16];
uint16_t mask_8x8 = lfm->left_uv[TX_8X8]; uint16_t mask_8x8 = lfm->left_uv[TX_8X8];
uint16_t mask_4x4 = lfm->left_uv[TX_4X4]; uint16_t mask_4x4 = lfm->left_uv[TX_4X4];
#if CONFIG_MISC_FIXES
uint16_t mask_4x4_int = lfm->left_int_4x4_uv; uint16_t mask_4x4_int = lfm->left_int_4x4_uv;
#else
uint16_t mask_4x4_int = lfm->int_4x4_uv;
#endif
assert(plane->subsampling_x == 1 && plane->subsampling_y == 1); assert(plane->subsampling_x == 1 && plane->subsampling_y == 1);
...@@ -1566,11 +1532,7 @@ void vp10_filter_block_plane_ss11(VP10_COMMON *const cm, ...@@ -1566,11 +1532,7 @@ void vp10_filter_block_plane_ss11(VP10_COMMON *const cm,
mask_16x16 = lfm->above_uv[TX_16X16]; mask_16x16 = lfm->above_uv[TX_16X16];
mask_8x8 = lfm->above_uv[TX_8X8]; mask_8x8 = lfm->above_uv[TX_8X8];
mask_4x4 = lfm->above_uv[TX_4X4]; mask_4x4 = lfm->above_uv[TX_4X4];
#if CONFIG_MISC_FIXES
mask_4x4_int = lfm->above_int_4x4_uv; mask_4x4_int = lfm->above_int_4x4_uv;
#else
mask_4x4_int = lfm->int_4x4_uv;
#endif
for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 2) { for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 2) {
const int skip_border_4x4_r = mi_row + r == cm->mi_rows - 1; const int skip_border_4x4_r = mi_row + r == cm->mi_rows - 1;
......
...@@ -80,12 +80,8 @@ typedef struct { ...@@ -80,12 +80,8 @@ typedef struct {
uint64_t int_4x4_y; uint64_t int_4x4_y;
uint16_t left_uv[TX_SIZES]; uint16_t left_uv[TX_SIZES];
uint16_t above_uv[TX_SIZES]; uint16_t above_uv[TX_SIZES];
#if CONFIG_MISC_FIXES
uint16_t left_int_4x4_uv; uint16_t left_int_4x4_uv;
uint16_t above_int_4x4_uv; uint16_t above_int_4x4_uv;
#else
uint16_t int_4x4_uv;
#endif
uint8_t lfl_y[64]; uint8_t lfl_y[64];
uint8_t lfl_uv[16]; uint8_t lfl_uv[16];
} LOOP_FILTER_MASK; } LOOP_FILTER_MASK;
......
...@@ -30,11 +30,6 @@ static void find_mv_refs_idx(const VP10_COMMON *cm, const MACROBLOCKD *xd, ...@@ -30,11 +30,6 @@ static void find_mv_refs_idx(const VP10_COMMON *cm, const MACROBLOCKD *xd,
const int bw = num_8x8_blocks_wide_lookup[mi->mbmi.sb_type] << 3; const int bw = num_8x8_blocks_wide_lookup[mi->mbmi.sb_type] << 3;
const int bh = num_8x8_blocks_high_lookup[mi->mbmi.sb_type] << 3; const int bh = num_8x8_blocks_high_lookup[mi->mbmi.sb_type] << 3;
#if !CONFIG_MISC_FIXES
// Blank the reference vector list
memset(mv_ref_list, 0, sizeof(*mv_ref_list) * MAX_MV_REF_CANDIDATES);
#endif
// The nearest 2 blocks are treated differently // The nearest 2 blocks are treated differently
// if the size < 8x8 we get the mv from the bmi substructure, // if the size < 8x8 we get the mv from the bmi substructure,
// and we also need to keep a mode count. // and we also need to keep a mode count.
...@@ -133,9 +128,6 @@ static void find_mv_refs_idx(const VP10_COMMON *cm, const MACROBLOCKD *xd, ...@@ -133,9 +128,6 @@ static void find_mv_refs_idx(const VP10_COMMON *cm, const MACROBLOCKD *xd,
} }
if (prev_frame_mvs->ref_frame[1] > INTRA_FRAME && if (prev_frame_mvs->ref_frame[1] > INTRA_FRAME &&
#if !CONFIG_MISC_FIXES
prev_frame_mvs->mv[1].as_int != prev_frame_mvs->mv[0].as_int &&
#endif
prev_frame_mvs->ref_frame[1] != ref_frame) { prev_frame_mvs->ref_frame[1] != ref_frame) {
int_mv mv = prev_frame_mvs->mv[1]; int_mv mv = prev_frame_mvs->mv[1];
if (ref_sign_bias[prev_frame_mvs->ref_frame[1]] != if (ref_sign_bias[prev_frame_mvs->ref_frame[1]] !=
...@@ -148,17 +140,9 @@ static void find_mv_refs_idx(const VP10_COMMON *cm, const MACROBLOCKD *xd, ...@@ -148,17 +140,9 @@ static void find_mv_refs_idx(const VP10_COMMON *cm, const MACROBLOCKD *xd,
} }
Done: Done:
mode_context[ref_frame] = counter_to_context[context_counter]; mode_context[ref_frame] = counter_to_context[context_counter];
#if CONFIG_MISC_FIXES
for (i = refmv_count; i < MAX_MV_REF_CANDIDATES; ++i) for (i = refmv_count; i < MAX_MV_REF_CANDIDATES; ++i)
mv_ref_list[i].as_int = 0; mv_ref_list[i].as_int = 0;
#else
// Clamp vectors
for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i)
clamp_mv_ref(&mv_ref_list[i].as_mv, bw, bh, xd);
#endif
} }
void vp10_find_mv_refs(const VP10_COMMON *cm, const MACROBLOCKD *xd, void vp10_find_mv_refs(const VP10_COMMON *cm, const MACROBLOCKD *xd,
......
...@@ -119,26 +119,13 @@ static const int idx_n_column_to_subblock[4][2] = { ...@@ -119,26 +119,13 @@ static const int idx_n_column_to_subblock[4][2] = {
}; };
// clamp_mv_ref // clamp_mv_ref
#if CONFIG_MISC_FIXES
#define MV_BORDER (8 << 3) // Allow 8 pels in 1/8th pel units #define MV_BORDER (8 << 3) // Allow 8 pels in 1/8th pel units
#else
#define MV_BORDER (16 << 3) // Allow 16 pels in 1/8th pel units
#endif
static INLINE void clamp_mv_ref(MV *mv, int bw, int bh, const MACROBLOCKD *xd) { static INLINE void clamp_mv_ref(MV *mv, int bw, int bh, const MACROBLOCKD *xd) {
#if CONFIG_MISC_FIXES
clamp_mv(mv, xd->mb_to_left_edge - bw * 8 - MV_BORDER, clamp_mv(mv, xd->mb_to_left_edge - bw * 8 - MV_BORDER,
xd->mb_to_right_edge + bw * 8 + MV_BORDER, xd->mb_to_right_edge + bw * 8 + MV_BORDER,
xd->mb_to_top_edge - bh * 8 - MV_BORDER, xd->mb_to_top_edge - bh * 8 - MV_BORDER,
xd->mb_to_bottom_edge + bh * 8 + MV_BORDER); xd->mb_to_bottom_edge + bh * 8 + MV_BORDER);
#else
(void) bw;
(void) bh;
clamp_mv(mv, xd->mb_to_left_edge - MV_BORDER,
xd->mb_to_right_edge + MV_BORDER,
xd->mb_to_top_edge - MV_BORDER,
xd->mb_to_bottom_edge + MV_BORDER);
#endif
} }
// This function returns either the appropriate sub block or block's mv // This function returns either the appropriate sub block or block's mv
...@@ -164,11 +151,7 @@ static INLINE int_mv scale_mv(const MB_MODE_INFO *mbmi, int ref, ...@@ -164,11 +151,7 @@ static INLINE int_mv scale_mv(const MB_MODE_INFO *mbmi, int ref,
return mv; return mv;
} }
#if CONFIG_MISC_FIXES
#define CLIP_IN_ADD(mv, bw, bh, xd) clamp_mv_ref(mv, bw, bh, xd) #define CLIP_IN_ADD(mv, bw, bh, xd) clamp_mv_ref(mv, bw, bh, xd)
#else
#define CLIP_IN_ADD(mv, bw, bh, xd) do {} while (0)
#endif
// This macro is used to add a motion vector mv_ref list if it isn't // This macro is used to add a motion vector mv_ref list if it isn't
// already in the list. If it's the second motion vector it will also // already in the list. If it's the second motion vector it will also
...@@ -194,8 +177,6 @@ static INLINE int_mv scale_mv(const MB_MODE_INFO *mbmi, int ref, ...@@ -194,8 +177,6 @@ static INLINE int_mv scale_mv(const MB_MODE_INFO *mbmi, int ref,
ADD_MV_REF_LIST(scale_mv((mbmi), 0, ref_frame, ref_sign_bias), \ ADD_MV_REF_LIST(scale_mv((mbmi), 0, ref_frame, ref_sign_bias), \
refmv_count, mv_ref_list, bw, bh, xd, Done); \ refmv_count, mv_ref_list, bw, bh, xd, Done); \
if (has_second_ref(mbmi) && \ if (has_second_ref(mbmi) && \
(CONFIG_MISC_FIXES || \
(mbmi)->mv[1].as_int != (mbmi)->mv[0].as_int) && \
(mbmi)->ref_frame[1] != ref_frame) \ (mbmi)->ref_frame[1] != ref_frame) \
ADD_MV_REF_LIST(scale_mv((mbmi), 1, ref_frame, ref_sign_bias), \ ADD_MV_REF_LIST(scale_mv((mbmi), 1, ref_frame, ref_sign_bias), \
refmv_count, mv_ref_list, bw, bh, xd, Done); \ refmv_count, mv_ref_list, bw, bh, xd, Done); \
......
...@@ -255,9 +255,6 @@ typedef struct VP10Common { ...@@ -255,9 +255,6 @@ typedef struct VP10Common {
struct loopfilter lf; struct loopfilter lf;
struct segmentation seg; struct segmentation seg;
#if !CONFIG_MISC_FIXES
struct segmentation_probs segp;
#endif
int frame_parallel_decode; // frame-based threading. int frame_parallel_decode; // frame-based threading.
......
This diff is collapsed.
...@@ -462,7 +462,6 @@ void vp10_accumulate_frame_counts(VP10_COMMON *cm, FRAME_COUNTS *counts, ...@@ -462,7 +462,6 @@ void vp10_accumulate_frame_counts(VP10_COMMON *cm, FRAME_COUNTS *counts,
} }
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
for (i = 0; i < PREDICTION_PROBS; i++) for (i = 0; i < PREDICTION_PROBS; i++)
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
cm->counts.seg.pred[i][j] += counts->seg.pred[i][j]; cm->counts.seg.pred[i][j] += counts->seg.pred[i][j];
...@@ -471,7 +470,6 @@ void vp10_accumulate_frame_counts(VP10_COMMON *cm, FRAME_COUNTS *counts, ...@@ -471,7 +470,6 @@ void vp10_accumulate_frame_counts(VP10_COMMON *cm, FRAME_COUNTS *counts,
cm->counts.seg.tree_total[i] += counts->seg.tree_total[i]; cm->counts.seg.tree_total[i] += counts->seg.tree_total[i];
cm->counts.seg.tree_mispred[i] += counts->seg.tree_mispred[i]; cm->counts.seg.tree_mispred[i] += counts->seg.tree_mispred[i];
} }
#endif
#if CONFIG_EXT_INTRA #if CONFIG_EXT_INTRA
for (i = 0; i < PLANE_TYPES; ++i) for (i = 0; i < PLANE_TYPES; ++i)
......
...@@ -78,36 +78,14 @@ static int read_is_valid(const uint8_t *start, size_t len, const uint8_t *end) { ...@@ -78,36 +78,14 @@ static int read_is_valid(const uint8_t *start, size_t len, const uint8_t *end) {
return len != 0 && len <= (size_t)(end - start); return len != 0 && len <= (size_t)(end - start);
} }
static int read_inv_signed_literal(struct vpx_read_bit_buffer *rb,
int bits) {
#if CONFIG_MISC_FIXES
const int nbits = sizeof(unsigned) * 8 - bits - 1;
const unsigned value = vpx_rb_read_literal(rb, bits + 1) << nbits;
return ((int) value) >> nbits;
#else
return vpx_rb_read_signed_literal(rb, bits);
#endif
}
static int decode_unsigned_max(struct vpx_read_bit_buffer *rb, int max) { static int decode_unsigned_max(struct vpx_read_bit_buffer *rb, int max) {
const int data = vpx_rb_read_literal(rb, get_unsigned_bits(max)); const int data = vpx_rb_read_literal(rb, get_unsigned_bits(max));
return data > max ? max : data; return data > max ? max : data;
}