Commit db0c7d4f authored by Angie Chiang's avatar Angie Chiang

Use av1_set_txb_context in encode_block

Change-Id: Ida4a10fae54591f8f5b740739ab71a2650303958
parent b3a12b5e
......@@ -735,26 +735,18 @@ static void encode_block(int plane, int block, int blk_row, int blk_col,
}
#endif
#if !CONFIG_PVQ
if (p->eobs[block] && !xd->lossless[xd->mi[0]->mbmi.segment_id]) {
*a = *l = av1_optimize_b(cm, x, plane, block, tx_size, ctx) > 0;
} else {
*a = *l = p->eobs[block] > 0;
}
#if CONFIG_VAR_TX
int i;
for (i = 0; i < tx_size_wide_unit[tx_size]; ++i) a[i] = a[0];
for (i = 0; i < tx_size_high_unit[tx_size]; ++i) l[i] = l[0];
if (p->eobs[block] && !xd->lossless[xd->mi[0]->mbmi.segment_id])
av1_optimize_b(cm, x, plane, block, tx_size, ctx);
#endif
av1_set_txb_context(x, plane, block, tx_size, a, l);
#if !CONFIG_PVQ
if (p->eobs[block]) *(args->skip) = 0;
if (p->eobs[block] == 0) return;
#else
(void)ctx;
*a = *l = !x->pvq_skip[plane];
if (!x->pvq_skip[plane]) *(args->skip) = 0;
if (x->pvq_skip[plane]) return;
......@@ -1010,10 +1002,8 @@ void av1_encode_sb_supertx(AV1_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE bsize) {
}
#endif // CONFIG_SUPERTX
void av1_set_txb_context(MACROBLOCK *x, int plane, int block,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
void av1_set_txb_context(MACROBLOCK *x, int plane, int block, TX_SIZE tx_size,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l) {
(void)plane_bsize;
(void)tx_size;
#if !CONFIG_PVQ
struct macroblock_plane *p = &x->plane[plane];
......@@ -1022,6 +1012,13 @@ void av1_set_txb_context(MACROBLOCK *x, int plane, int block,
(void)block;
*a = *l = !x->pvq_skip[plane];
#endif // !CONFIG_PVQ
#if CONFIG_VAR_TX || CONFIG_LV_MAP
int i;
for (i = 0; i < tx_size_wide_unit[tx_size]; ++i) a[i] = a[0];
for (i = 0; i < tx_size_high_unit[tx_size]; ++i) l[i] = l[0];
#endif
}
static void encode_block_intra_and_set_context(int plane, int block,
......@@ -1035,7 +1032,7 @@ static void encode_block_intra_and_set_context(int plane, int block,
MACROBLOCK *x = args->x;
ENTROPY_CONTEXT *a = &args->ta[blk_col];
ENTROPY_CONTEXT *l = &args->tl[blk_row];
av1_set_txb_context(x, plane, block, plane_bsize, tx_size, a, l);
av1_set_txb_context(x, plane, block, tx_size, a, l);
}
void av1_encode_block_intra(int plane, int block, int blk_row, int blk_col,
......
......@@ -63,8 +63,7 @@ int av1_optimize_b(const AV1_COMMON *cm, MACROBLOCK *mb, int plane, int block,
void av1_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
void av1_set_txb_context(MACROBLOCK *x, int plane, int block,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
void av1_set_txb_context(MACROBLOCK *x, int plane, int block, TX_SIZE tx_size,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l);
void av1_encode_block_intra(int plane, int block, int blk_row, int blk_col,
......
......@@ -1581,8 +1581,8 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
#else
this_rd_stats.rate = x->rate;
#endif // !CONFIG_PVQ
av1_set_txb_context(x, plane, block, plane_bsize, tx_size,
args->t_above + blk_col, args->t_left + blk_row);
av1_set_txb_context(x, plane, block, tx_size, args->t_above + blk_col,
args->t_left + blk_row);
rd1 = RDCOST(x->rdmult, x->rddiv, this_rd_stats.rate, this_rd_stats.dist);
rd2 = RDCOST(x->rdmult, x->rddiv, 0, this_rd_stats.sse);
......
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