pd->dst.buf, pd->dst.stride);
}
-#define RDTRUNC(RM, DM, R, D) \
- (((1 << (VP9_PROB_COST_SHIFT - 1)) + (R) * (RM)) & \
- ((1 << VP9_PROB_COST_SHIFT) - 1))
-
typedef struct vp10_token_state {
int rate;
int error;
} vp10_token_state;
// TODO(jimbankoski): experiment to find optimal RD numbers.
-static const int plane_rd_mult[REF_TYPES][PLANE_TYPES] ={ {9, 7}, {7, 5}, };
+static const int plane_rd_mult[REF_TYPES][PLANE_TYPES] ={ {9, 7}, {8, 5}, };
#define UPDATE_RD_COST()\
{\
rd_cost0 = RDCOST(rdmult, rddiv, rate0, error0);\
rd_cost1 = RDCOST(rdmult, rddiv, rate1, error1);\
- if (rd_cost0 == rd_cost1) {\
- rd_cost0 = RDTRUNC(rdmult, rddiv, rate0, error0);\
- rd_cost1 = RDTRUNC(rdmult, rddiv, rate1, error1);\
- }\
}
// This function is a place holder for now but may ultimately need
return pt;
}
-static int optimize_b(MACROBLOCK *mb, int plane, int block,
- TX_SIZE tx_size, int ctx) {
+int vp10_optimize_b(MACROBLOCK *mb, int plane, int block,
+ TX_SIZE tx_size, int ctx) {
MACROBLOCKD *const xd = &mb->e_mbd;
struct macroblock_plane *const p = &mb->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
tx_size);
#else
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize,
- tx_size, VP10_XFORM_QUANT_B);
+ tx_size, VP10_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT
} else if (x->skip_txfm[plane][blk_index] == SKIP_TXFM_AC_ONLY) {
// fast path forward transform and quantization
tx_size);
#else
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize,
- tx_size, VP10_XFORM_QUANT_B);
+ tx_size, VP10_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT
}
}
}
#endif
ctx = combine_entropy_contexts(*a, *l);
- *a = *l = optimize_b(x, plane, block, tx_size, ctx) > 0;
+ *a = *l = vp10_optimize_b(x, plane, block, tx_size, ctx) > 0;
} else {
*a = *l = p->eobs[block] > 0;
}
if (x->optimize) {
int ctx;
ctx = combine_entropy_contexts(*a, *l);
- *a = *l = optimize_b(x, plane, block, tx_size, ctx) > 0;
+ *a = *l = vp10_optimize_b(x, plane, block, tx_size, ctx) > 0;
} else {
*a = *l = p->eobs[block] > 0;
}
int rate;
int64_t dist;
int64_t sse;
+#if !CONFIG_NEW_QUANT
+ ENTROPY_CONTEXT coeff_ctx = combine_entropy_contexts(
+ *(args->t_above + blk_col), *(args->t_left + blk_row));
+#endif
if (args->exit_early)
return;
plane_bsize, tx_size);
#else
vp10_xform_quant(x, plane, block, blk_row, blk_col,
- plane_bsize, tx_size, VP10_XFORM_QUANT_B);
+ plane_bsize, tx_size, VP10_XFORM_QUANT_FP);
+ vp10_optimize_b(x, plane, block, tx_size, coeff_ctx);
#endif // CONFIG_NEW_QUANT
- dist_block(args->cpi, x, plane, block, blk_row, blk_col,
+ dist_block(args->cpi, x, plane, block, blk_row, blk_col,
tx_size, &dist, &sse);
} else if (x->skip_txfm[plane][block >> (tx_size << 1)] ==
SKIP_TXFM_AC_ONLY) {
tx_size);
#else
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
- VP10_XFORM_QUANT_B);
+ VP10_XFORM_QUANT_FP);
+ vp10_optimize_b(x, plane, block, tx_size, coeff_ctx);
#endif // CONFIG_NEW_QUANT
dist_block(args->cpi, x, plane, block, blk_row, blk_col,
tx_size, &dist, &sse);
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
VP10_XFORM_QUANT_B);
+ vp10_optimize_b(x, plane, block, tx_size, coeff_ctx);
+
// TODO(any): Use dist_block to compute distortion
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {