Commit 6341f5c5 authored by Yushin Cho's avatar Yushin Cho

Remove av1 coeff context setting when PVQ is used

Entropy context of above and left block is not used
when PVQ is turned on.

Change-Id: I50c908bba800382438a48f7cc83f8b0f177393a1
parent 68abef8c
......@@ -559,6 +559,7 @@ void av1_xform_quant(const AV1_COMMON *cm, MACROBLOCK *x, int plane, int block,
int16_t *src_int16;
const int src_stride = p->src.stride;
(void)ctx;
(void)scan_order;
(void)qcoeff;
......@@ -693,7 +694,9 @@ static void encode_block(int plane, int block, int blk_row, int blk_col,
struct macroblockd_plane *const pd = &xd->plane[plane];
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
uint8_t *dst;
#if !CONFIG_PVQ
ENTROPY_CONTEXT *a, *l;
#endif
INV_TXFM_PARAM inv_txfm_param;
const int block_raster_idx = av1_block_index_to_raster_order(tx_size, block);
#if CONFIG_PVQ
......@@ -705,6 +708,8 @@ static void encode_block(int plane, int block, int blk_row, int blk_col,
#endif
dst = &pd->dst
.buf[(blk_row * pd->dst.stride + blk_col) << tx_size_wide_log2[0]];
#if !CONFIG_PVQ
a = &args->ta[blk_col];
l = &args->tl[blk_row];
#if CONFIG_VAR_TX
......@@ -712,6 +717,9 @@ static void encode_block(int plane, int block, int blk_row, int blk_col,
#else
ctx = combine_entropy_contexts(*a, *l);
#endif
#else
ctx = 0;
#endif // CONFIG_PVQ
#if CONFIG_VAR_TX
// Assert not magic number (uninitialized).
......@@ -734,14 +742,13 @@ static void encode_block(int plane, int block, int blk_row, int blk_col,
p->eobs[block] = 0;
}
#endif
#if !CONFIG_PVQ
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;
......@@ -1002,16 +1009,13 @@ void av1_encode_sb_supertx(AV1_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE bsize) {
}
#endif // CONFIG_SUPERTX
#if !CONFIG_PVQ
void av1_set_txb_context(MACROBLOCK *x, int plane, int block, TX_SIZE tx_size,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l) {
(void)tx_size;
#if !CONFIG_PVQ
struct macroblock_plane *p = &x->plane[plane];
*a = *l = p->eobs[block] > 0;
#else // !CONFIG_PVQ
(void)block;
*a = *l = !x->pvq_skip[plane];
#endif // !CONFIG_PVQ
#if CONFIG_VAR_TX || CONFIG_LV_MAP
int i;
......@@ -1020,6 +1024,7 @@ void av1_set_txb_context(MACROBLOCK *x, int plane, int block, TX_SIZE tx_size,
for (i = 0; i < tx_size_high_unit[tx_size]; ++i) l[i] = l[0];
#endif
}
#endif
static void encode_block_intra_and_set_context(int plane, int block,
int blk_row, int blk_col,
......@@ -1027,12 +1032,13 @@ static void encode_block_intra_and_set_context(int plane, int block,
TX_SIZE tx_size, void *arg) {
av1_encode_block_intra(plane, block, blk_row, blk_col, plane_bsize, tx_size,
arg);
#if !CONFIG_PVQ
struct encode_b_args *const args = arg;
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, tx_size, a, l);
#endif
}
void av1_encode_block_intra(int plane, int block, int blk_row, int blk_col,
......
......@@ -1465,8 +1465,11 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
use_activity_masking = x->daala_enc.use_activity_masking;
#endif // CONFIG_PVQ
#endif // CONFIG_DAALA_DIST
#if !CONFIG_PVQ
ENTROPY_CONTEXT *a = args->t_above + blk_col;
ENTROPY_CONTEXT *l = args->t_left + blk_row;
#endif // CONFIG_PVQ
av1_init_rd_stats(&this_rd_stats);
......@@ -1580,11 +1583,10 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
av1_update_txb_coeff_cost(&this_rd_stats, plane, tx_size, blk_row, blk_col,
this_rd_stats.rate);
#endif // CONFIG_RD_DEBUG
av1_set_txb_context(x, plane, block, tx_size, a, l);
#else
this_rd_stats.rate = x->rate;
#endif // !CONFIG_PVQ
av1_set_txb_context(x, plane, block, tx_size, a, l);
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);
......@@ -5388,8 +5390,6 @@ static int64_t encode_inter_mb_segment_sub8x8(
*(tl + (k >> 1)) = !(p->eobs[block] == 0);
#else
thisrate += x->rate;
*(ta + (k & 1)) = !x->pvq_skip[0];
*(tl + (k >> 1)) = !x->pvq_skip[0];
#endif // !CONFIG_PVQ
#if CONFIG_EXT_TX
if (tx_size == TX_8X4) {
......
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