Commit 66f2f65e authored by hui su's avatar hui su
Browse files

Merge MISC_FIXES

Remove MISC_FIXES flags except for the changes on MV precision, which
has a 0.1% performance drop.

On derflr, the impact is -0.012%.

Change-Id: I0a74e5a212dd0cb827192a318c92a714c9681e45
parent 5f9e089b
......@@ -104,9 +104,7 @@ typedef struct {
TX_SIZE inter_tx_size[64];
#endif
int8_t skip;
#if CONFIG_MISC_FIXES
int8_t has_no_coeffs;
#endif
int8_t segment_id;
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] =
}
};
#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] = {
{ 65, 32, 18, 144, 162, 194, 41, 51, 98 }, // block_size < 8x8
{ 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] = {
{ 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]
[PARTITION_TYPES - 1] = {
// 8x8 -> 4x4
......@@ -1085,13 +1044,12 @@ default_intra_ext_tx_prob[EXT_TX_SETS_INTRA][EXT_TX_SIZES]
}
};
#endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
// FIXME(someone) need real defaults here
static const struct segmentation_probs default_seg_probs = {
{ 128, 128, 128, 128, 128, 128, 128 },
{ 128, 128, 128 },
};
#endif
#if CONFIG_EXT_INTRA
static const vpx_prob default_ext_intra_probs[2] = {230, 230};
......@@ -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->intra_ext_tx_prob, default_intra_ext_tx_prob);
#endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
vp10_copy(fc->seg.tree_probs, default_seg_probs.tree_probs);
vp10_copy(fc->seg.pred_probs, default_seg_probs.pred_probs);
#endif
#if CONFIG_EXT_INTRA
vp10_copy(fc->ext_intra_probs, default_ext_intra_probs);
#endif // CONFIG_EXT_INTRA
......@@ -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],
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) {
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++)
vpx_tree_merge_probs(vp10_switchable_interp_tree,
......@@ -1252,7 +1198,7 @@ void vp10_adapt_intra_frame_probs(VP10_COMMON *cm) {
}
}
#endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
if (cm->seg.temporal_update) {
for (i = 0; i < PREDICTION_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) {
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 CONFIG_EXT_INTRA
for (i = 0; i < PLANE_TYPES; ++i) {
fc->ext_intra_probs[i] = mode_mv_merge_probs(
......
......@@ -77,9 +77,7 @@ typedef struct frame_contexts {
vpx_prob intra_ext_tx_prob[EXT_TX_SETS_INTRA][EXT_TX_SIZES][INTRA_MODES]
[TX_TYPES - 1];
#endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
struct segmentation_probs seg;
#endif
#if CONFIG_EXT_INTRA
vpx_prob ext_intra_probs[PLANE_TYPES];
#endif // CONFIG_EXT_INTRA
......@@ -111,9 +109,7 @@ typedef struct FRAME_COUNTS {
unsigned int intra_ext_tx[EXT_TX_SETS_INTRA][EXT_TX_SIZES][INTRA_MODES]
[TX_TYPES];
#endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
struct seg_counts seg;
#endif
#if CONFIG_EXT_INTRA
unsigned int ext_intra[PLANE_TYPES][2];
#endif // CONFIG_EXT_INTRA
......@@ -121,11 +117,6 @@ typedef struct FRAME_COUNTS {
extern const vpx_prob vp10_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
[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
vp10_default_palette_y_mode_prob[PALETTE_BLOCK_SIZES][PALETTE_Y_MODE_CONTEXTS];
extern const vpx_prob
......
......@@ -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;
uint16_t *const left_uv = &lfm->left_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;
#else
uint16_t *const int_4x4_uv = &lfm->int_4x4_uv;
#endif
int i;
// 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,
// If the block has no coefficients and is not intra we skip applying
// the loop filter on block edges.
#if CONFIG_MISC_FIXES
if ((mbmi->skip || mbmi->has_no_coeffs) && is_inter_block(mbmi))
return;
#else
if (mbmi->skip && is_inter_block(mbmi))
return;
#endif
// 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
......@@ -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;
*left_y |= left_prediction_mask[block_size] << shift_y;
#if CONFIG_MISC_FIXES
if ((mbmi->skip || mbmi->has_no_coeffs) && is_inter_block(mbmi))
return;
#else
if (mbmi->skip && is_inter_block(mbmi))
return;
#endif
*above_y |= (size_mask[block_size] &
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,
lfm->above_uv[i] &= mask_uv;
}
lfm->int_4x4_y &= mask_y;
#if CONFIG_MISC_FIXES
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
// 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,
lfm->above_uv[i] &= mask_uv;
}
lfm->int_4x4_y &= mask_y;
#if CONFIG_MISC_FIXES
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
// 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,
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_8X8] & lfm->left_uv[TX_4X4]));
#if CONFIG_MISC_FIXES
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_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,
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_8X8] & lfm->above_uv[TX_4X4]));
#if CONFIG_MISC_FIXES
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,
......@@ -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_8x8 = lfm->left_uv[TX_8X8];
uint16_t mask_4x4 = lfm->left_uv[TX_4X4];
#if CONFIG_MISC_FIXES
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);
......@@ -1566,11 +1532,7 @@ void vp10_filter_block_plane_ss11(VP10_COMMON *const cm,
mask_16x16 = lfm->above_uv[TX_16X16];
mask_8x8 = lfm->above_uv[TX_8X8];
mask_4x4 = lfm->above_uv[TX_4X4];
#if CONFIG_MISC_FIXES
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) {
const int skip_border_4x4_r = mi_row + r == cm->mi_rows - 1;
......
......@@ -80,12 +80,8 @@ typedef struct {
uint64_t int_4x4_y;
uint16_t left_uv[TX_SIZES];
uint16_t above_uv[TX_SIZES];
#if CONFIG_MISC_FIXES
uint16_t left_int_4x4_uv;
uint16_t above_int_4x4_uv;
#else
uint16_t int_4x4_uv;
#endif
uint8_t lfl_y[64];
uint8_t lfl_uv[16];
} LOOP_FILTER_MASK;
......
......@@ -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 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
// if the size < 8x8 we get the mv from the bmi substructure,
// 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,
}
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) {
int_mv mv = prev_frame_mvs->mv[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,
}
Done:
mode_context[ref_frame] = counter_to_context[context_counter];
#if CONFIG_MISC_FIXES
for (i = refmv_count; i < MAX_MV_REF_CANDIDATES; ++i)
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,
......
......@@ -119,26 +119,13 @@ static const int idx_n_column_to_subblock[4][2] = {
};
// clamp_mv_ref
#if CONFIG_MISC_FIXES
#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) {
#if CONFIG_MISC_FIXES
clamp_mv(mv, xd->mb_to_left_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_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
......@@ -164,11 +151,7 @@ static INLINE int_mv scale_mv(const MB_MODE_INFO *mbmi, int ref,
return mv;
}
#if CONFIG_MISC_FIXES
#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
// 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,
ADD_MV_REF_LIST(scale_mv((mbmi), 0, ref_frame, ref_sign_bias), \
refmv_count, mv_ref_list, bw, bh, xd, Done); \
if (has_second_ref(mbmi) && \
(CONFIG_MISC_FIXES || \
(mbmi)->mv[1].as_int != (mbmi)->mv[0].as_int) && \
(mbmi)->ref_frame[1] != ref_frame) \
ADD_MV_REF_LIST(scale_mv((mbmi), 1, ref_frame, ref_sign_bias), \
refmv_count, mv_ref_list, bw, bh, xd, Done); \
......
......@@ -255,9 +255,6 @@ typedef struct VP10Common {
struct loopfilter lf;
struct segmentation seg;
#if !CONFIG_MISC_FIXES
struct segmentation_probs segp;
#endif
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,
}
#endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
for (i = 0; i < PREDICTION_PROBS; i++)
for (j = 0; j < 2; 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,
cm->counts.seg.tree_total[i] += counts->seg.tree_total[i];
cm->counts.seg.tree_mispred[i] += counts->seg.tree_mispred[i];
}
#endif
#if CONFIG_EXT_INTRA
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) {
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) {
const int data = vpx_rb_read_literal(rb, get_unsigned_bits(max));
return data > max ? max : data;
}
#if CONFIG_MISC_FIXES
static TX_MODE read_tx_mode(struct vpx_read_bit_buffer *rb) {
return vpx_rb_read_bit(rb) ? TX_MODE_SELECT : vpx_rb_read_literal(rb, 2);
}
#else
static TX_MODE read_tx_mode(vpx_reader *r) {
TX_MODE tx_mode = vpx_read_literal(r, 2);
if (tx_mode == ALLOW_32X32)
tx_mode += vpx_read_bit(r);
return tx_mode;
}
#endif
static void read_tx_mode_probs(struct tx_probs *tx_probs, vpx_reader *r) {
int i, j;
......@@ -139,7 +117,6 @@ static void read_inter_mode_probs(FRAME_CONTEXT *fc, vpx_reader *r) {
vp10_diff_update_prob(r, &fc->inter_mode_probs[i][j]);
}
#if CONFIG_MISC_FIXES
static REFERENCE_MODE read_frame_reference_mode(const VP10_COMMON *cm,
struct vpx_read_bit_buffer *rb) {
if (is_compound_reference_allowed(cm)) {
......@@ -150,18 +127,6 @@ static REFERENCE_MODE read_frame_reference_mode(const VP10_COMMON *cm,
return SINGLE_REFERENCE;
}
}
#else
static REFERENCE_MODE read_frame_reference_mode(const VP10_COMMON *cm,
vpx_reader *r) {
if (is_compound_reference_allowed(cm)) {
return vpx_read_bit(r) ? (vpx_read_bit(r) ? REFERENCE_MODE_SELECT
: COMPOUND_REFERENCE)
: SINGLE_REFERENCE;
} else {
return SINGLE_REFERENCE;
}
}
#endif
static void read_frame_reference_mode_probs(VP10_COMMON *cm, vpx_reader *r) {
FRAME_CONTEXT *const fc = cm->fc;
......@@ -185,12 +150,7 @@ static void read_frame_reference_mode_probs(VP10_COMMON *cm, vpx_reader *r) {
static void update_mv_probs(vpx_prob *p, int n, vpx_reader *r) {
int i;
for (i = 0; i < n; ++i)
#if CONFIG_MISC_FIXES
vp10_diff_update_prob(r, &p[i]);
#else
if (vpx_read(r, MV_UPDATE_PROB))
p[i] = (vpx_read_literal(r, 7) << 1) | 1;
#endif
}
static void read_mv_probs(nmv_context *ctx, int allow_hp, vpx_reader *r) {
......@@ -997,11 +957,7 @@ static void decode_block(VP10Decoder *const pbi, MACROBLOCKD *const xd,
}
if (!less8x8 && eobtotal == 0)
#if CONFIG_MISC_FIXES
mbmi->has_no_coeffs = 1; // skip loopfilter
#else
mbmi->skip = 1; // skip loopfilter
#endif
}
}
......@@ -1159,9 +1115,6 @@ static void read_coef_probs(FRAME_CONTEXT *fc, TX_MODE tx_mode,
static void setup_segmentation(VP10_COMMON *const cm,
struct vpx_read_bit_buffer *rb) {
struct segmentation *const seg = &cm->seg;
#if !CONFIG_MISC_FIXES
struct segmentation_probs *const segp = &cm->segp;
#endif
int i, j;
seg->update_map = 0;
......@@ -1178,26 +1131,11 @@ static void setup_segmentation(VP10_COMMON *const cm,
seg->update_map = vpx_rb_read_bit(rb);
}
if (seg->update_map) {
#if !CONFIG_MISC_FIXES
for (i = 0; i < SEG_TREE_PROBS; i++)
segp->tree_probs[i] = vpx_rb_read_bit(rb) ? vpx_rb_read_literal(rb, 8)
: MAX_PROB;
#endif
if (frame_is_intra_only(cm) || cm->error_resilient_mode) {
seg->temporal_update = 0;
} else {
seg->temporal_update = vpx_rb_read_bit(rb);
}
#if !CONFIG_MISC_FIXES
if (seg->temporal_update) {
for (i = 0; i < PREDICTION_PROBS; i++)
segp->pred_probs[i] = vpx_rb_read_bit(rb) ? vpx_rb_read_literal(rb, 8)
: MAX_PROB;
} else {
for (i = 0; i < PREDICTION_PROBS; i++)
segp->pred_probs[i] = MAX_PROB;
}
#endif
}
// Segmentation data update
......@@ -1251,7 +1189,7 @@ static void setup_loopfilter(struct loopfilter *lf,
static INLINE int read_delta_q(struct vpx_read_bit_buffer *rb) {
return vpx_rb_read_bit(rb) ?
vpx_rb_read_inv_signed_literal(rb, CONFIG_MISC_FIXES ? 6 : 4) : 0;
vpx_rb_read_inv_signed_literal(rb, 6) : 0;
}
static void setup_quantization(VP10_COMMON *const cm, MACROBLOCKD *const xd,
......@@ -1264,15 +1202,9 @@ static void setup_quantization(VP10_COMMON *const cm, MACROBLOCKD *const xd,
cm->uv_ac_delta_q = read_delta_q(rb);
cm->dequant_bit_depth = cm->bit_depth;
for (i = 0; i < (cm->seg.enabled ? MAX_SEGMENTS : 1); ++i) {
#if CONFIG_MISC_FIXES
const int qindex = vp10_get_qindex(&cm->seg, i, cm->base_qindex);
#endif
xd->lossless[i] = cm->y_dc_delta_q == 0 &&
#if CONFIG_MISC_FIXES
qindex == 0 &&
#else
cm->base_qindex == 0 &&
#endif
cm->uv_dc_delta_q == 0 &&
cm->uv_ac_delta_q == 0;
}
......@@ -1414,10 +1346,8 @@ static void setup_frame_size_with_refs(VP10_COMMON *cm,
YV12_BUFFER_CONFIG *const buf = cm->frame_refs[i].buf;
width = buf->y_crop_width;
height = buf->y_crop_height;
#if CONFIG_MISC_FIXES
cm->render_width = buf->render_width;
cm->render_height = buf->render_height;
#endif
found = 1;
break;
}
......@@ -1425,9 +1355,7 @@ static void setup_frame_size_with_refs(VP10_COMMON *cm,
if (!found) {
vp10_read_frame_size(rb, &width, &height);
#if CONFIG_MISC_FIXES
setup_render_size(cm, rb);
#endif
}
if (width <= 0 || height <= 0)
......@@ -1459,9 +1387,6 @@ static void setup_frame_size_with_refs(VP10_COMMON *cm,
}
resize_context_buffers(cm, width, height);
#if !CONFIG_MISC_FIXES
setup_render_size(cm, rb);
#endif
lock_buffer_pool(pool);
if (vpx_realloc_frame_buffer(
......@@ -1508,14 +1433,10 @@ static void setup_tile_info(VP10_COMMON *cm, struct vpx_read_bit_buffer *rb) {
if (cm->log2_tile_rows)
cm->log2_tile_rows += vpx_rb_read_bit(rb);
#if CONFIG_MISC_FIXES
// tile size magnitude
if (cm->log2_tile_rows > 0 || cm->log2_tile_cols > 0) {
cm->tile_sz_mag = vpx_rb_read_literal(rb, 2);
}
#else
cm->tile_sz_mag = 3;
#endif
}
typedef struct TileBuffer {
......@@ -1559,9 +1480,9 @@ static void get_tile_buffer(const uint8_t *const data_end,
if (decrypt_cb) {
uint8_t be_data[4];
decrypt_cb(decrypt_state, *data, be_data, tile_sz_mag + 1);
size = mem_get_varsize(be_data, tile_sz_mag) + CONFIG_MISC_FIXES;
size = mem_get_varsize(be_data, tile_sz_mag) + 1;
} else {
size = mem_get_varsize(*data, tile_sz_mag) + CONFIG_MISC_FIXES;
size = mem_get_varsize(*data, tile_sz_mag) + 1;
}
*data += tile_sz_mag + 1;
......@@ -2011,9 +1932,7 @@ static void read_bitdepth_colorspace_sampling(
static size_t read_uncompressed_header(VP10Decoder *pbi,
struct vpx_read_bit_buffer *rb) {
VP10_COMMON *const cm = &pbi->common;
#if CONFIG_MISC_FIXES
MACROBLOCKD *const xd = &pbi->mb;
#endif
BufferPool *const pool = cm->buffer_pool;
RefCntBuffer *const frame_bufs = pool->frame_bufs;
int i, mask, ref_index = 0;
......@@ -2092,7 +2011,6 @@ static size_t read_uncompressed_header(VP10Decoder *pbi,