Commit a66a2cb2 authored by Luc Trudeau's avatar Luc Trudeau

[CFL] CfL for Intra frames only

This commit serves as a baseline to test CfL in video sequences. This
starting baseline uses CfL only in intra frames. This allows to measure
the contribution of CfL in intra frames over the whole video sequence.

Results on Objective-1-fast (Compare to master with CfL disabled)
   PSNR | PSNR Cb | PSNR Cr | PSNR HVS |    SSIM | MS SSIM | CIEDE 2000
-0.1869 | -2.4708 | -1.9988 |  -0.1725 | -0.1390 | -0.1453 |    -0.9564

https://arewecompressedyet.com/?job=master%402017-09-13&job=cfl-no-inter%402017-09-13

Change-Id: I20b2f239455b43e977588dc738b21e0508ad9333
parent 3b635245
......@@ -1202,7 +1202,9 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
#if CONFIG_CFL
if (mbmi->uv_mode == UV_CFL_PRED) {
mbmi->cfl_alpha_idx = read_cfl_alphas(ec_ctx, r, &mbmi->cfl_alpha_signs);
xd->cfl->store_y = 1;
// TODO(ltrudeau) Remove key_frame check (used to test CfL only in Intra
// frame).
xd->cfl->store_y = cm->frame_type == KEY_FRAME;
} else {
xd->cfl->store_y = 0;
}
......@@ -1214,7 +1216,9 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
mbmi->uv_mode = UV_DC_PRED;
#if CONFIG_CFL
xd->cfl->is_chroma_reference = 0;
xd->cfl->store_y = 1;
// TODO(ltrudeau) Remove key_frame check (used to test CfL only in Intra
// frame).
xd->cfl->store_y = cm->frame_type == KEY_FRAME;
#endif
}
#endif
......@@ -1795,7 +1799,9 @@ static void read_intra_block_mode_info(AV1_COMMON *const cm, const int mi_row,
if (mbmi->uv_mode == UV_CFL_PRED) {
mbmi->cfl_alpha_idx =
read_cfl_alphas(xd->tile_ctx, r, &mbmi->cfl_alpha_signs);
xd->cfl->store_y = 1;
// TODO(ltrudeau) Remove key_frame check (used to test CfL only in Intra
// frame).
xd->cfl->store_y = cm->frame_type == KEY_FRAME;
} else {
xd->cfl->store_y = 0;
}
......
......@@ -6136,7 +6136,9 @@ static void encode_superblock(const AV1_COMP *const cpi, ThreadData *td,
if (!is_inter) {
#if CONFIG_CFL
xd->cfl->store_y = 1;
// TODO(ltrudeau) Remove key_frame check (used to test CfL only in Intra
// frame).
xd->cfl->store_y = cm->frame_type == KEY_FRAME;
#endif // CONFIG_CFL
int plane;
mbmi->skip = 1;
......
......@@ -6013,11 +6013,18 @@ static int64_t rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
mbmi->uv_mode = mode;
#if CONFIG_CFL
const AV1_COMMON *const cm = &cpi->common;
int cfl_alpha_rate = 0;
if (mode == UV_CFL_PRED) {
assert(!is_directional_mode);
const TX_SIZE uv_tx_size = av1_get_uv_tx_size(mbmi, &xd->plane[1]);
cfl_alpha_rate = cfl_rd_pick_alpha(x, uv_tx_size);
// TODO(ltrudeau) Remove key_frame check (used to test CfL only in Intra
// frame).
if (cm->frame_type == KEY_FRAME) {
const TX_SIZE uv_tx_size = av1_get_uv_tx_size(mbmi, &xd->plane[1]);
cfl_alpha_rate = cfl_rd_pick_alpha(x, uv_tx_size);
} else {
continue;
}
}
#endif
#if CONFIG_EXT_INTRA
......@@ -9920,9 +9927,13 @@ void av1_rd_pick_intra_mode_sb(const AV1_COMP *cpi, MACROBLOCK *x,
// Don't store the luma value if no chroma is associated.
// Don't worry, we will store this reconstructed luma in the following
// encode dry-run the chroma plane will never know.
xd->cfl->store_y = !x->skip_chroma_rd;
// TODO(ltrudeau) Delete frame type check (only used to test key-frame only
// CfL)
xd->cfl->store_y = !x->skip_chroma_rd && cm->frame_type == KEY_FRAME;
#else
xd->cfl->store_y = 1;
// TODO(ltrudeau) Delete frame type check (only used to test key-frame only
// CfL)
xd->cfl->store_y = cm->frame_type == KEY_FRAME;
#endif // CONFIG_CB4X4
if (xd->cfl->store_y) {
txfm_rd_in_plane(x, cpi, &this_rd_stats, INT64_MAX, AOM_PLANE_Y,
......
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