Commit 218556e2 authored by David Barker's avatar David Barker

[NORMATIVE-SYNTAX, intrabc] Disallow intrabc+superres

Superres should not be used together with intrabc, for the same
reasons why the other loop filters are disabled when intrabc is
used. However, we actually read superres information first,
so the simplest change is to only read allow_intrabc if superres is off.

BUG=aomedia:1384

Change-Id: I55c4c8ace72ab3fac9417da5cf803883be7efb84
parent 1e2084a2
......@@ -2877,7 +2877,13 @@ static int read_uncompressed_header(AV1Decoder *pbi,
pbi->need_resync = 0;
}
#if CONFIG_INTRABC
if (cm->allow_screen_content_tools) cm->allow_intrabc = aom_rb_read_bit(rb);
#if CONFIG_HORZONLY_FRAME_SUPERRES
if (cm->allow_screen_content_tools &&
(av1_superres_unscaled(cm) || !NO_FILTER_FOR_IBC))
#else
if (cm->allow_screen_content_tools)
#endif // CONFIG_HORZONLY_FRAME_SUPERRES
cm->allow_intrabc = aom_rb_read_bit(rb);
#endif // CONFIG_INTRABC
cm->use_prev_frame_mvs = 0;
} else {
......@@ -2927,9 +2933,14 @@ static int read_uncompressed_header(AV1Decoder *pbi,
pbi->need_resync = 0;
}
#if CONFIG_INTRABC
#if CONFIG_HORZONLY_FRAME_SUPERRES
if (cm->allow_screen_content_tools &&
(av1_superres_unscaled(cm) || !NO_FILTER_FOR_IBC))
#else
if (cm->allow_screen_content_tools)
#endif // CONFIG_HORZONLY_FRAME_SUPERRES
cm->allow_intrabc = aom_rb_read_bit(rb);
#endif // CONFIG_INTRABC
#endif // CONFIG_INTRABC // CONFIG_INTRABC
} else if (pbi->need_resync != 1) { /* Skip if need resync */
#if CONFIG_OBU
pbi->refresh_frame_flags = (cm->frame_type == S_FRAME)
......@@ -3582,35 +3593,37 @@ void av1_decode_tg_tiles_and_wrapup(AV1Decoder *pbi, const uint8_t *data,
return;
}
#if CONFIG_INTRABC
if (!(cm->allow_intrabc && NO_FILTER_FOR_IBC)) {
#endif
#if CONFIG_LOOP_RESTORATION
if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
av1_loop_restoration_save_boundary_lines(&pbi->cur_buf->buf, cm, 0);
}
if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
av1_loop_restoration_save_boundary_lines(&pbi->cur_buf->buf, cm, 0);
}
#endif // CONFIG_LOOP_RESTORATION
if (!cm->skip_loop_filter &&
#if CONFIG_INTRABC
!(cm->allow_intrabc && NO_FILTER_FOR_IBC) &&
#endif // CONFIG_INTRABC
!cm->all_lossless &&
(cm->cdef_bits || cm->cdef_strengths[0] || cm->cdef_uv_strengths[0])) {
av1_cdef_frame(&pbi->cur_buf->buf, cm, &pbi->mb);
}
if (!cm->skip_loop_filter && !cm->all_lossless &&
(cm->cdef_bits || cm->cdef_strengths[0] || cm->cdef_uv_strengths[0])) {
av1_cdef_frame(&pbi->cur_buf->buf, cm, &pbi->mb);
}
#if CONFIG_HORZONLY_FRAME_SUPERRES
superres_post_decode(pbi);
superres_post_decode(pbi);
#endif // CONFIG_HORZONLY_FRAME_SUPERRES
#if CONFIG_LOOP_RESTORATION
if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
av1_loop_restoration_save_boundary_lines(&pbi->cur_buf->buf, cm, 1);
av1_loop_restoration_filter_frame((YV12_BUFFER_CONFIG *)xd->cur_buf, cm);
}
if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
av1_loop_restoration_save_boundary_lines(&pbi->cur_buf->buf, cm, 1);
av1_loop_restoration_filter_frame((YV12_BUFFER_CONFIG *)xd->cur_buf, cm);
}
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_INTRABC
}
#endif
if (!xd->corrupted) {
if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {
......
......@@ -3745,7 +3745,15 @@ static void write_uncompressed_header_frame(AV1_COMP *cpi,
write_frame_size(cm, wb);
#endif
#if CONFIG_INTRABC
if (cm->allow_screen_content_tools) aom_wb_write_bit(wb, cm->allow_intrabc);
#if CONFIG_HORZONLY_FRAME_SUPERRES
assert(av1_superres_unscaled(cm) ||
!(cm->allow_intrabc && NO_FILTER_FOR_IBC));
if (cm->allow_screen_content_tools &&
(av1_superres_unscaled(cm) || !NO_FILTER_FOR_IBC))
#else
if (cm->allow_screen_content_tools)
#endif
aom_wb_write_bit(wb, cm->allow_intrabc);
#endif // CONFIG_INTRABC
} else {
#if !CONFIG_NO_FRAME_CONTEXT_SIGNALING
......@@ -3780,7 +3788,14 @@ static void write_uncompressed_header_frame(AV1_COMP *cpi,
write_frame_size(cm, wb);
#endif
#if CONFIG_INTRABC
#if CONFIG_HORZONLY_FRAME_SUPERRES
assert(av1_superres_unscaled(cm) ||
!(cm->allow_intrabc && NO_FILTER_FOR_IBC));
if (cm->allow_screen_content_tools &&
(av1_superres_unscaled(cm) || !NO_FILTER_FOR_IBC))
#else
if (cm->allow_screen_content_tools)
#endif
aom_wb_write_bit(wb, cm->allow_intrabc);
#endif // CONFIG_INTRABC
} else {
......@@ -4081,7 +4096,15 @@ static void write_uncompressed_header_obu(AV1_COMP *cpi,
write_frame_size(cm, wb);
#endif
#if CONFIG_INTRABC
if (cm->allow_screen_content_tools) aom_wb_write_bit(wb, cm->allow_intrabc);
#if CONFIG_HORZONLY_FRAME_SUPERRES
assert(av1_superres_unscaled(cm) ||
!(cm->allow_intrabc && NO_FILTER_FOR_IBC));
if (cm->allow_screen_content_tools &&
(av1_superres_unscaled(cm) || !NO_FILTER_FOR_IBC))
#else
if (cm->allow_screen_content_tools)
#endif
aom_wb_write_bit(wb, cm->allow_intrabc);
#endif // CONFIG_INTRABC
} else if (cm->frame_type == INTRA_ONLY_FRAME) {
#if !CONFIG_NO_FRAME_CONTEXT_SIGNALING
......@@ -4102,7 +4125,14 @@ static void write_uncompressed_header_obu(AV1_COMP *cpi,
write_frame_size(cm, wb);
#endif
#if CONFIG_INTRABC
#if CONFIG_HORZONLY_FRAME_SUPERRES
assert(av1_superres_unscaled(cm) ||
!(cm->allow_intrabc && NO_FILTER_FOR_IBC));
if (cm->allow_screen_content_tools &&
(av1_superres_unscaled(cm) || !NO_FILTER_FOR_IBC))
#else
if (cm->allow_screen_content_tools)
#endif
aom_wb_write_bit(wb, cm->allow_intrabc);
#endif // CONFIG_INTRABC
}
......
......@@ -4262,6 +4262,12 @@ static void encode_frame_internal(AV1_COMP *cpi) {
cm->allow_intrabc = cm->allow_screen_content_tools;
// Reset the flag.
cpi->intrabc_used = 0;
#if CONFIG_HORZONLY_FRAME_SUPERRES
// Need to disable intrabc when superres is selected
if (NO_FILTER_FOR_IBC && !av1_superres_unscaled(cm)) {
cm->allow_intrabc = 0;
}
#endif
#endif // CONFIG_INTRABC
#if CONFIG_HASH_ME
......
......@@ -5170,9 +5170,6 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
#endif // CONFIG_LOOP_RESTORATION
if (is_lossless_requested(&cpi->oxcf)
#if CONFIG_INTRABC
|| (cm->allow_intrabc && NO_FILTER_FOR_IBC)
#endif // CONFIG_INTRABC
#if CONFIG_EXT_TILE
|| cm->large_scale_tile
#endif // CONFIG_EXT_TILE
......@@ -5185,9 +5182,6 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
int no_cdef = 0;
if (is_lossless_requested(&cpi->oxcf) || !cpi->oxcf.using_cdef
#if CONFIG_INTRABC
|| (cm->allow_intrabc && NO_FILTER_FOR_IBC)
#endif // CONFIG_INTRABC
#if CONFIG_EXT_TILE
|| cm->large_scale_tile
#endif
......@@ -5274,9 +5268,6 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
}
}
#endif // CONFIG_LOOP_RESTORATION
// TODO(debargha): Fix mv search range on encoder side
// aom_extend_frame_inner_borders(cm->frame_to_show, num_planes);
aom_extend_frame_borders(cm->frame_to_show, num_planes);
}
static void encode_without_recode_loop(AV1_COMP *cpi) {
......@@ -6098,7 +6089,14 @@ static int encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size, uint8_t *dest,
// off.
// Pick the loop filter level for the frame.
loopfilter_frame(cpi, cm);
#if CONFIG_INTRABC
if (!(cm->allow_intrabc && NO_FILTER_FOR_IBC))
#endif
loopfilter_frame(cpi, cm);
// TODO(debargha): Fix mv search range on encoder side
// aom_extend_frame_inner_borders(cm->frame_to_show, av1_num_planes(cm));
aom_extend_frame_borders(cm->frame_to_show, av1_num_planes(cm));
#ifdef OUTPUT_YUV_REC
aom_write_one_yuv_frame(cm, cm->frame_to_show);
......
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