Commit 2f7d37bf authored by Alex Converse's avatar Alex Converse

Revert "aomenc: remove config control of "allow_screen_content_tools""

This reverts commit 1b5328e0.

This commit has some pretty negative consequences with block copy. I
need to be able to force block copy on for arbitrary sequences while it
is still in development, and I need to be able to keep the palette
enable status between block copy and non-block copy runs.

Change If815a1eff2f9419117477f14cda143dd669c87c6 will prevent
allow_screen_content_tools from getting clobbered and still allow us to
force it on.
BUG=aomedia:656

Change-Id: I7a2f4207b5d2da35aec7870250e8b330c58a0e13
parent 2c6ca5fe
......@@ -513,7 +513,6 @@ static const arg_def_t input_chroma_sample_position =
chroma_sample_position_enum);
#endif
// TODO(huisu): remove "tune-content" control flag.
static const struct arg_enum_list tune_content_enum[] = {
{ "default", AOM_CONTENT_DEFAULT },
{ "screen", AOM_CONTENT_SCREEN },
......
......@@ -5082,10 +5082,8 @@ static void encode_frame_internal(AV1_COMP *cpi) {
av1_zero(rdc->coef_counts);
av1_zero(rdc->comp_pred_diff);
#if CONFIG_PALETTE || CONFIG_INTRABC
// 'allow_screen_content_tools' is assigned at intra-only frame, and will
// remain unchanged till the next intra-only frame.
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,
#if CONFIG_HIGHBITDEPTH
......@@ -5093,7 +5091,7 @@ static void encode_frame_internal(AV1_COMP *cpi) {
#endif // CONFIG_HIGHBITDEPTH
cpi->source->y_stride, cpi->source->y_width, cpi->source->y_height);
}
#endif // CONFIG_PALETTE || CONFIG_INTRABC
#endif // CONFIG_PALETTE
#if CONFIG_GLOBAL_MOTION
av1_zero(rdc->global_motion_used);
......
......@@ -2198,6 +2198,11 @@ void av1_change_config(struct AV1_COMP *cpi, const AV1EncoderConfig *oxcf) {
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) {
CHECK_MEM_ERROR(cm, x->palette_buffer,
aom_memalign(16, sizeof(*x->palette_buffer)));
......
......@@ -655,6 +655,12 @@ 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