Commit df33be4b authored by Yaowu Xu's avatar Yaowu Xu Committed by Gerrit Code Review

Merge "Fix merge defects" into nextgenv2

parents 18aea429 5a27b3bb
...@@ -267,6 +267,7 @@ EXPERIMENT_LIST=" ...@@ -267,6 +267,7 @@ EXPERIMENT_LIST="
var_tx var_tx
ext_tx ext_tx
misc_fixes misc_fixes
ext_intra
universal_hp universal_hp
" "
CONFIG_LIST=" CONFIG_LIST="
......
...@@ -257,7 +257,7 @@ static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type, ...@@ -257,7 +257,7 @@ static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type,
const MB_MODE_INFO *const mbmi = &mi->mbmi; const MB_MODE_INFO *const mbmi = &mi->mbmi;
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
if (xd->lossless || tx_size >= TX_32X32) if ( xd->lossless[mbmi->segment_id] || tx_size >= TX_32X32)
return DCT_DCT; return DCT_DCT;
if (mbmi->sb_type >= BLOCK_8X8) { if (mbmi->sb_type >= BLOCK_8X8) {
if (plane_type == PLANE_TYPE_Y || is_inter_block(mbmi)) if (plane_type == PLANE_TYPE_Y || is_inter_block(mbmi))
......
...@@ -973,6 +973,7 @@ void vp10_adapt_intra_frame_probs(VP10_COMMON *cm) { ...@@ -973,6 +973,7 @@ void vp10_adapt_intra_frame_probs(VP10_COMMON *cm) {
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
for (i = TX_4X4; i <= TX_16X16; ++i) { for (i = TX_4X4; i <= TX_16X16; ++i) {
int j;
vpx_tree_merge_probs(vp10_tx_type_tree, pre_fc->inter_tx_type_prob[i], vpx_tree_merge_probs(vp10_tx_type_tree, pre_fc->inter_tx_type_prob[i],
counts->inter_tx_type[i], fc->inter_tx_type_prob[i]); counts->inter_tx_type[i], fc->inter_tx_type_prob[i]);
......
...@@ -379,14 +379,6 @@ static INLINE int frame_is_intra_only(const VP10_COMMON *const cm) { ...@@ -379,14 +379,6 @@ static INLINE int frame_is_intra_only(const VP10_COMMON *const cm) {
return cm->frame_type == KEY_FRAME || cm->intra_only; return cm->frame_type == KEY_FRAME || cm->intra_only;
} }
static INLINE void set_partition_probs(const VP10_COMMON *const cm,
MACROBLOCKD *const xd) {
xd->partition_probs =
frame_is_intra_only(cm) ?
&vp10_kf_partition_probs[0] :
(const vpx_prob (*)[PARTITION_TYPES - 1])cm->fc->partition_prob;
}
static INLINE void vp10_init_macroblockd(VP10_COMMON *cm, MACROBLOCKD *xd, static INLINE void vp10_init_macroblockd(VP10_COMMON *cm, MACROBLOCKD *xd,
tran_low_t *dqcoeff) { tran_low_t *dqcoeff) {
int i; int i;
...@@ -407,13 +399,6 @@ static INLINE void vp10_init_macroblockd(VP10_COMMON *cm, MACROBLOCKD *xd, ...@@ -407,13 +399,6 @@ static INLINE void vp10_init_macroblockd(VP10_COMMON *cm, MACROBLOCKD *xd,
xd->above_seg_context = cm->above_seg_context; xd->above_seg_context = cm->above_seg_context;
xd->mi_stride = cm->mi_stride; xd->mi_stride = cm->mi_stride;
xd->error_info = &cm->error; xd->error_info = &cm->error;
set_partition_probs(cm, xd);
}
static INLINE const vpx_prob* get_partition_probs(const MACROBLOCKD *xd,
int ctx) {
return xd->partition_probs[ctx];
} }
static INLINE void set_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col) { static INLINE void set_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col) {
......
...@@ -1132,7 +1132,7 @@ void vp10_xform_quant_fp(MACROBLOCK *x, int plane, int block, ...@@ -1132,7 +1132,7 @@ void vp10_xform_quant_fp(MACROBLOCK *x, int plane, int block,
break; break;
case TX_4X4: case TX_4X4:
vp10_highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, tx_type, vp10_highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, tx_type,
xd->lossless); xd->lossless[mbmi->segment_id]);
vp10_highbd_quantize_fp(coeff, 16, x->skip_block, p->zbin, p->round_fp, vp10_highbd_quantize_fp(coeff, 16, x->skip_block, p->zbin, p->round_fp,
p->quant_fp, p->quant_shift, qcoeff, dqcoeff, p->quant_fp, p->quant_shift, qcoeff, dqcoeff,
pd->dequant, eob, pd->dequant, eob,
...@@ -1220,7 +1220,7 @@ void vp10_xform_quant_dc(MACROBLOCK *x, int plane, int block, ...@@ -1220,7 +1220,7 @@ void vp10_xform_quant_dc(MACROBLOCK *x, int plane, int block,
break; break;
case TX_4X4: case TX_4X4:
vp10_highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, tx_type, vp10_highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, tx_type,
xd->lossless); xd->lossless[xd->mi[0]->mbmi.segment_id]);
vpx_highbd_quantize_dc(coeff, 16, x->skip_block, p->round, vpx_highbd_quantize_dc(coeff, 16, x->skip_block, p->round,
p->quant_fp[0], qcoeff, dqcoeff, p->quant_fp[0], qcoeff, dqcoeff,
pd->dequant[0], eob); pd->dequant[0], eob);
...@@ -1592,7 +1592,7 @@ static void encode_block_pass1(int plane, int block, int blk_row, int blk_col, ...@@ -1592,7 +1592,7 @@ static void encode_block_pass1(int plane, int block, int blk_row, int blk_col,
if (p->eobs[block] > 0) { if (p->eobs[block] > 0) {
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
if (xd->lossless) { if (xd->lossless[xd->mi[0]->mbmi.segment_id]) {
vp10_highbd_iwht4x4_add(dqcoeff, dst, pd->dst.stride, vp10_highbd_iwht4x4_add(dqcoeff, dst, pd->dst.stride,
p->eobs[block], xd->bd); p->eobs[block], xd->bd);
} else { } else {
...@@ -1602,7 +1602,7 @@ static void encode_block_pass1(int plane, int block, int blk_row, int blk_col, ...@@ -1602,7 +1602,7 @@ static void encode_block_pass1(int plane, int block, int blk_row, int blk_col,
return; return;
} }
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
if (xd->lossless) { if (xd->lossless[xd->mi[0]->mbmi.segment_id]) {
vp10_iwht4x4_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); vp10_iwht4x4_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
} else { } else {
vp10_idct4x4_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); vp10_idct4x4_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
......
...@@ -637,7 +637,8 @@ static void choose_largest_tx_size(VP10_COMP *cpi, MACROBLOCK *x, ...@@ -637,7 +637,8 @@ static void choose_largest_tx_size(VP10_COMP *cpi, MACROBLOCK *x,
mbmi->tx_size = VPXMIN(max_tx_size, largest_tx_size); mbmi->tx_size = VPXMIN(max_tx_size, largest_tx_size);
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
if (is_inter_block(mbmi) && bs >= BLOCK_8X8 && !xd->lossless) { if (is_inter_block(mbmi) && bs >= BLOCK_8X8 &&
!xd->lossless[mbmi->segment_id]) {
for (tx_type = DCT_DCT; tx_type < TX_TYPES - 1; ++tx_type) { for (tx_type = DCT_DCT; tx_type < TX_TYPES - 1; ++tx_type) {
if (mbmi->tx_type >= DST_ADST && mbmi->tx_type < IDTX && if (mbmi->tx_type >= DST_ADST && mbmi->tx_type < IDTX &&
best_tx_type == DCT_DCT) { best_tx_type == DCT_DCT) {
...@@ -666,7 +667,7 @@ static void choose_largest_tx_size(VP10_COMP *cpi, MACROBLOCK *x, ...@@ -666,7 +667,7 @@ static void choose_largest_tx_size(VP10_COMP *cpi, MACROBLOCK *x,
this_rd = RDCOST(x->rdmult, x->rddiv, s1, psse); this_rd = RDCOST(x->rdmult, x->rddiv, s1, psse);
else else
this_rd = RDCOST(x->rdmult, x->rddiv, r + s0, d); this_rd = RDCOST(x->rdmult, x->rddiv, r + s0, d);
if (is_inter_block(mbmi) && !xd->lossless && !s) if (is_inter_block(mbmi) && !xd->lossless[mbmi->segment_id] && !s)
this_rd = VPXMIN(this_rd, RDCOST(x->rdmult, x->rddiv, s1, psse)); this_rd = VPXMIN(this_rd, RDCOST(x->rdmult, x->rddiv, s1, psse));
if (this_rd < ((best_tx_type == DCT_DCT) ? ext_tx_th : 1) * best_rd) { if (this_rd < ((best_tx_type == DCT_DCT) ? ext_tx_th : 1) * best_rd) {
...@@ -685,7 +686,7 @@ static void choose_largest_tx_size(VP10_COMP *cpi, MACROBLOCK *x, ...@@ -685,7 +686,7 @@ static void choose_largest_tx_size(VP10_COMP *cpi, MACROBLOCK *x,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
if (bs >= BLOCK_8X8 && mbmi->tx_size <= TX_16X16 && if (bs >= BLOCK_8X8 && mbmi->tx_size <= TX_16X16 &&
!xd->lossless && *rate != INT_MAX) { !xd->lossless[mbmi->segment_id] && *rate != INT_MAX) {
if (is_inter_block(mbmi)) if (is_inter_block(mbmi))
*rate += cpi->inter_tx_type_costs[mbmi->tx_size][mbmi->tx_type]; *rate += cpi->inter_tx_type_costs[mbmi->tx_size][mbmi->tx_type];
else else
...@@ -758,7 +759,7 @@ static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x, ...@@ -758,7 +759,7 @@ static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
start_tx_type = DCT_DCT; start_tx_type = DCT_DCT;
if (bs >= BLOCK_8X8 && !xd->lossless) if (bs >= BLOCK_8X8 && !xd->lossless[mbmi->segment_id])
end_tx_type = TX_TYPES - 1; end_tx_type = TX_TYPES - 1;
else else
end_tx_type = DCT_DCT; end_tx_type = DCT_DCT;
...@@ -791,7 +792,8 @@ static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x, ...@@ -791,7 +792,8 @@ static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x,
&sse, ref_best_rd, 0, bs, n, &sse, ref_best_rd, 0, bs, n,
cpi->sf.use_fast_coef_costing); cpi->sf.use_fast_coef_costing);
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
if (bs >= BLOCK_8X8 && !xd->lossless && r != INT_MAX && n < TX_32X32) { if (bs >= BLOCK_8X8 && !xd->lossless[mbmi->segment_id] &&
r != INT_MAX && n < TX_32X32) {
if (is_inter_block(mbmi)) if (is_inter_block(mbmi))
r += cpi->inter_tx_type_costs[n][mbmi->tx_type]; r += cpi->inter_tx_type_costs[n][mbmi->tx_type];
else else
...@@ -817,11 +819,11 @@ static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x, ...@@ -817,11 +819,11 @@ static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x,
rd = RDCOST(x->rdmult, x->rddiv, r + s0, d); rd = RDCOST(x->rdmult, x->rddiv, r + s0, d);
} }
if (is_inter_block(mbmi) && !xd->lossless && !s) if (is_inter_block(mbmi) && !xd->lossless[mbmi->segment_id] && !s)
rd = VPXMIN(rd, RDCOST(x->rdmult, x->rddiv, s1, sse)); rd = VPXMIN(rd, RDCOST(x->rdmult, x->rddiv, s1, sse));
// Early termination in transform size search. // Early termination in transform size search.
if (cpi->sf.tx_size_search_breakout && if (0 && cpi->sf.tx_size_search_breakout &&
(rd== INT64_MAX || (rd== INT64_MAX ||
(n < (int) max_tx_size && rd > last_rd) || (n < (int) max_tx_size && rd > last_rd) ||
s == 1)) s == 1))
......
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