Commit 74ad0917 authored by Alex Converse's avatar Alex Converse

Don't clobber |allow_screen_content_tools|.

Screen content tools can be forced on or inferred by color counting.
This prevents the inferred status of the tools from getting clobbered
when controls are evaluated.

BUG=aomedia:656

This also fixes the build with --disable-palette --enable-intrabc

Change-Id: If815a1eff2f9419117477f14cda143dd669c87c6
parent 2f7d37bf
......@@ -5082,16 +5082,22 @@ static void encode_frame_internal(AV1_COMP *cpi) {
av1_zero(rdc->coef_counts);
av1_zero(rdc->comp_pred_diff);
#if CONFIG_PALETTE || CONFIG_INTRABC
if (frame_is_intra_only(cm)) {
#if CONFIG_PALETTE
if (cpi->auto_tune_content && frame_is_intra_only(cm)) {
cm->allow_screen_content_tools = is_screen_content(
cpi->source->y_buffer,
cm->allow_screen_content_tools =
cpi->oxcf.content == AOM_CONTENT_SCREEN ||
is_screen_content(cpi->source->y_buffer,
#if CONFIG_HIGHBITDEPTH
cpi->source->flags & YV12_FLAG_HIGHBITDEPTH, xd->bd,
cpi->source->flags & YV12_FLAG_HIGHBITDEPTH, xd->bd,
#endif // CONFIG_HIGHBITDEPTH
cpi->source->y_stride, cpi->source->y_width, cpi->source->y_height);
}
cpi->source->y_stride, cpi->source->y_width,
cpi->source->y_height);
#else
cm->allow_screen_content_tools = cpi->oxcf.content == AOM_CONTENT_SCREEN;
#endif // CONFIG_PALETTE
}
#endif // CONFIG_PALETTE || CONFIG_INTRABC
#if CONFIG_GLOBAL_MOTION
av1_zero(rdc->global_motion_used);
......
......@@ -2197,17 +2197,12 @@ void av1_change_config(struct AV1_COMP *cpi, const AV1EncoderConfig *oxcf) {
: REFRESH_FRAME_CONTEXT_BACKWARD;
cm->reset_frame_context = RESET_FRAME_CONTEXT_NONE;
#if CONFIG_PALETTE || CONFIG_INTRABC
if (frame_is_intra_only(cm)) {
cm->allow_screen_content_tools = (cpi->oxcf.content == AOM_CONTENT_SCREEN);
// Automatically decide if screen content tools should be enabled.
cpi->auto_tune_content = (cpi->oxcf.content == AOM_CONTENT_DEFAULT);
}
if (x->palette_buffer == 0) {
#if CONFIG_PALETTE
if (x->palette_buffer == NULL) {
CHECK_MEM_ERROR(cm, x->palette_buffer,
aom_memalign(16, sizeof(*x->palette_buffer)));
}
#endif // CONFIG_PALETTE || CONFIG_INTRABC
#endif // CONFIG_PALETTE
#if CONFIG_EXT_INTER
set_compound_tools(cm);
#endif // CONFIG_EXT_INTER
......
......@@ -655,12 +655,6 @@ typedef struct AV1_COMP {
#if CONFIG_SPEED_REFS
int sb_scanning_pass_idx;
#endif // CONFIG_SPEED_REFS
#if CONFIG_PALETTE || CONFIG_INTRABC
// Specify if encoder does automatic classification of source video as
// screen content or not.
int auto_tune_content;
#endif // CONFIG_PALETTE || CONFIG_INTRABC
} AV1_COMP;
void av1_initialize_enc(void);
......
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