Commit a8474b61 authored by Luc Trudeau's avatar Luc Trudeau Committed by David Michael Barr

[CFL] Don't Store Luma Pixels When CfL is not Allowed

Change-Id: I09cf970a9be3a7dfe7e134bec5d778cda77f2682
parent 3889c6d8
......@@ -465,6 +465,8 @@ void cfl_store_tx(MACROBLOCKD *const xd, int row, int col, TX_SIZE tx_size,
struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
uint8_t *dst =
&pd->dst.buf[(row * pd->dst.stride + col) << tx_size_wide_log2[0]];
assert(is_cfl_allowed(&xd->mi[0]->mbmi));
if (block_size_high[bsize] == 4 || block_size_wide[bsize] == 4) {
// Only dimensions of size 4 can have an odd offset.
assert(!((col & 1) && tx_size_wide[tx_size] != 4));
......@@ -484,6 +486,8 @@ void cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize, TX_SIZE tx_size) {
int row = 0;
int col = 0;
bsize = AOMMAX(BLOCK_4X4, bsize);
assert(is_cfl_allowed(&xd->mi[0]->mbmi));
if (block_size_high[bsize] == 4 || block_size_wide[bsize] == 4) {
sub8x8_adjust_offset(cfl, &row, &col);
#if CONFIG_DEBUG
......
......@@ -219,7 +219,7 @@ static void predict_and_reconstruct_intra_block(
}
}
#if CONFIG_CFL
if (plane == AOM_PLANE_Y && xd->cfl.store_y) {
if (plane == AOM_PLANE_Y && xd->cfl.store_y && is_cfl_allowed(mbmi)) {
cfl_store_tx(xd, row, col, tx_size, mbmi->sb_type);
}
#endif // CONFIG_CFL
......@@ -567,7 +567,8 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
}
#if CONFIG_CFL
if (mbmi->uv_mode != UV_CFL_PRED) {
if (!cfl->is_chroma_reference && is_inter_block(mbmi)) {
if (!cfl->is_chroma_reference && is_inter_block(mbmi) &&
is_cfl_allowed(mbmi)) {
cfl_store_block(xd, mbmi->sb_type, mbmi->tx_size);
}
}
......
......@@ -5050,7 +5050,8 @@ static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data,
CFL_CTX *const cfl = &xd->cfl;
if (is_inter_block(mbmi) &&
!is_chroma_reference(mi_row, mi_col, bsize, cfl->subsampling_x,
cfl->subsampling_y)) {
cfl->subsampling_y) &&
is_cfl_allowed(mbmi)) {
cfl_store_block(xd, mbmi->sb_type, mbmi->tx_size);
}
#endif // CONFIG_CFL
......
......@@ -925,7 +925,8 @@ void av1_encode_block_intra(int plane, int block, int blk_row, int blk_col,
if (*eob) *(args->skip) = 0;
#if CONFIG_CFL
if (plane == AOM_PLANE_Y && xd->cfl.store_y) {
if (plane == AOM_PLANE_Y && xd->cfl.store_y &&
is_cfl_allowed(&xd->mi[0]->mbmi)) {
cfl_store_tx(xd, blk_row, blk_col, tx_size, plane_bsize);
}
#endif // CONFIG_CFL
......
......@@ -2142,7 +2142,7 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
return;
}
#if CONFIG_CFL
if (plane == AOM_PLANE_Y && xd->cfl.store_y) {
if (plane == AOM_PLANE_Y && xd->cfl.store_y && is_cfl_allowed(mbmi)) {
assert(!is_inter_block(mbmi) || plane_bsize < BLOCK_8X8);
cfl_store_tx(xd, blk_row, blk_col, tx_size, plane_bsize);
}
......
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