Commit 3667d62e authored by Jingning Han's avatar Jingning Han Committed by Gerrit Code Review

Merge "Disable trellis optimized quantization in the first-pass" into nextgenv2

parents dd2064a0 813201e1
......@@ -1201,7 +1201,7 @@ void vp10_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
MACROBLOCKD *const xd = &x->e_mbd;
struct optimize_ctx ctx;
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
struct encode_b_args arg = {x, &ctx, &mbmi->skip, NULL, NULL};
struct encode_b_args arg = {x, &ctx, &mbmi->skip, NULL, NULL, 1};
int plane;
mbmi->skip = 1;
......@@ -1262,7 +1262,7 @@ void vp10_encode_sb_supertx(MACROBLOCK *x, BLOCK_SIZE bsize) {
MACROBLOCKD *const xd = &x->e_mbd;
struct optimize_ctx ctx;
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
struct encode_b_args arg = {x, &ctx, &mbmi->skip, NULL, NULL};
struct encode_b_args arg = {x, &ctx, &mbmi->skip, NULL, NULL, 1};
int plane;
mbmi->skip = 1;
......@@ -1338,16 +1338,22 @@ void vp10_encode_block_intra(int plane, int block, int blk_row, int blk_col,
l = &args->tl[blk_row];
ctx = combine_entropy_contexts(*a, *l);
if (args->enable_optimize_b) {
#if CONFIG_NEW_QUANT
vp10_xform_quant_nuq(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size, ctx);
vp10_xform_quant_nuq(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size, ctx);
#else // CONFIG_NEW_QUANT
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
VP10_XFORM_QUANT_FP);
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
VP10_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT
if (p->eobs[block]) {
*a = *l = vp10_optimize_b(x, plane, block, tx_size, ctx) > 0;
if (p->eobs[block]) {
*a = *l = vp10_optimize_b(x, plane, block, tx_size, ctx) > 0;
} else {
*a = *l = 0;
}
} else {
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
VP10_XFORM_QUANT_B);
*a = *l = p->eobs[block] > 0;
}
......@@ -1378,7 +1384,8 @@ void vp10_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane,
ENTROPY_CONTEXT ta[2 * MAX_MIB_SIZE];
ENTROPY_CONTEXT tl[2 * MAX_MIB_SIZE];
struct encode_b_args arg = {x, NULL, &xd->mi[0]->mbmi.skip, ta, tl};
struct encode_b_args arg = {x, NULL, &xd->mi[0]->mbmi.skip,
ta, tl, enable_optimize_b};
if (enable_optimize_b) {
const struct macroblockd_plane* const pd = &xd->plane[plane];
const TX_SIZE tx_size = plane ? get_uv_tx_size(&xd->mi[0]->mbmi, pd) :
......
......@@ -29,6 +29,7 @@ struct encode_b_args {
int8_t *skip;
ENTROPY_CONTEXT *ta;
ENTROPY_CONTEXT *tl;
int8_t enable_optimize_b;
};
typedef enum VP10_XFORM_QUANT {
......
......@@ -1208,9 +1208,8 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
return;
if (!is_inter_block(mbmi)) {
struct encode_b_args intra_arg = {x, NULL, &mbmi->skip, args->t_above,
args->t_left};
struct encode_b_args intra_arg = {
x, NULL, &mbmi->skip, args->t_above, args->t_left, 1};
vp10_encode_block_intra(plane, block, blk_row, blk_col,
plane_bsize, tx_size, &intra_arg);
......
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