Commit 6697acfb authored by Sebastien Alaiwan's avatar Sebastien Alaiwan Committed by Urvang Joshi

Remove BGSPRITE experiment

This experiment has been abandonned for AV1.

Change-Id: I393e188420450b838fa53e8d7a4a00d41a4a2c6d
parent 6b172bba
......@@ -313,13 +313,6 @@ if (CONFIG_ACCOUNTING)
"${AOM_ROOT}/av1/decoder/accounting.h")
endif ()
if (CONFIG_BGSPRITE)
set(AOM_AV1_ENCODER_SOURCES
${AOM_AV1_ENCODER_SOURCES}
"${AOM_ROOT}/av1/encoder/bgsprite.c"
"${AOM_ROOT}/av1/encoder/bgsprite.h")
endif ()
set(AOM_AV1_ENCODER_SOURCES
${AOM_AV1_ENCODER_SOURCES}
"${AOM_ROOT}/av1/encoder/corner_detect.c"
......
This diff is collapsed.
/*
* Copyright (c) 2017, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#ifndef AV1_ENCODER_BGSPRITE_H_
#define AV1_ENCODER_BGSPRITE_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "av1/encoder/encoder.h"
// Creates alternate reference frame staring from source image + frames up to
// 'distance' past source frame.
// Returns 0 on success and 1 on failure.
int av1_background_sprite(AV1_COMP *cpi, int distance);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // AV1_ENCODER_BGSPRITE_H_
......@@ -4628,14 +4628,9 @@ void av1_encode_frame(AV1_COMP *cpi) {
int64_t *const mode_thrs = rd_opt->prediction_type_threshes[frame_type];
const int is_alt_ref = frame_type == ALTREF_FRAME;
/* prediction (compound, single or hybrid) mode selection */
#if CONFIG_BGSPRITE
(void)is_alt_ref;
if (!cpi->allow_comp_inter_inter)
#else
/* prediction (compound, single or hybrid) mode selection */
// NOTE: "is_alt_ref" is true only for OVERLAY/INTNL_OVERLAY frames
if (is_alt_ref || !cpi->allow_comp_inter_inter)
#endif // CONFIG_BGSPRITE
cm->reference_mode = SINGLE_REFERENCE;
else
cm->reference_mode = REFERENCE_MODE_SELECT;
......
......@@ -28,9 +28,6 @@
#include "av1/encoder/aq_cyclicrefresh.h"
#include "av1/encoder/aq_variance.h"
#include "av1/encoder/bitstream.h"
#if CONFIG_BGSPRITE
#include "av1/encoder/bgsprite.h"
#endif // CONFIG_BGSPRITE
#include "av1/encoder/context_tree.h"
#include "av1/encoder/encodeframe.h"
#include "av1/encoder/encodemv.h"
......@@ -6823,17 +6820,8 @@ int av1_get_compressed_data(AV1_COMP *cpi, unsigned int *frame_flags,
cpi->alt_ref_source = source;
if (oxcf->arnr_max_frames > 0) {
// Produce the filtered ARF frame.
#if CONFIG_BGSPRITE
int bgsprite_ret = av1_background_sprite(cpi, arf_src_index);
// Do temporal filter if bgsprite not generated.
if (bgsprite_ret != 0)
#endif // CONFIG_BGSPRITE
av1_temporal_filter(cpi,
#if CONFIG_BGSPRITE
NULL, &cpi->alt_ref_buffer,
#endif // CONFIG_BGSPRITE
arf_src_index);
// Produce the filtered ARF frame.
av1_temporal_filter(cpi, arf_src_index);
aom_extend_frame_borders(&cpi->alt_ref_buffer, num_planes);
force_src_buffer = &cpi->alt_ref_buffer;
}
......@@ -6874,11 +6862,7 @@ int av1_get_compressed_data(AV1_COMP *cpi, unsigned int *frame_flags,
if (oxcf->arnr_max_frames > 0) {
// Produce the filtered ARF frame.
av1_temporal_filter(cpi,
#if CONFIG_BGSPRITE
NULL, NULL,
#endif // CONFIG_BGSPRITE
arf_src_index);
av1_temporal_filter(cpi, arf_src_index);
aom_extend_frame_borders(&cpi->alt_ref_buffer, num_planes);
force_src_buffer = &cpi->alt_ref_buffer;
}
......
......@@ -613,9 +613,6 @@ typedef struct AV1_COMP {
int extra_arf_allowed;
int bwd_ref_allowed;
#if CONFIG_BGSPRITE
int bgsprite_allowed;
#endif // CONFIG_BGSPRITE
#if CONFIG_INTRABC
// A flag to indicate if intrabc is ever used in current frame.
int intrabc_used;
......
......@@ -2585,10 +2585,6 @@ static void define_gf_group(AV1_COMP *cpi, FIRSTPASS_STATS *this_frame) {
double avg_sr_coded_error = 0;
double avg_raw_err_stdev = 0;
int non_zero_stdev_count = 0;
#if CONFIG_BGSPRITE
double avg_pcnt_second_ref = 0;
int non_zero_pcnt_second_ref_count = 0;
#endif
i = 0;
while (i < rc->static_scene_max_gf_interval && i < rc->frames_to_key) {
......@@ -2619,12 +2615,6 @@ static void define_gf_group(AV1_COMP *cpi, FIRSTPASS_STATS *this_frame) {
non_zero_stdev_count++;
avg_raw_err_stdev += next_frame.raw_error_stdev;
}
#if CONFIG_BGSPRITE
if (this_frame->pcnt_second_ref) {
avg_pcnt_second_ref += this_frame->pcnt_second_ref;
}
non_zero_pcnt_second_ref_count++;
#endif // CONFIG_BGSPRITE
// Accumulate the effect of prediction quality decay.
if (!flash_detected) {
......@@ -2701,17 +2691,6 @@ static void define_gf_group(AV1_COMP *cpi, FIRSTPASS_STATS *this_frame) {
(zero_motion_accumulator < 0.995))
? 1
: 0;
#if CONFIG_BGSPRITE
if (non_zero_pcnt_second_ref_count) {
avg_pcnt_second_ref /= non_zero_pcnt_second_ref_count;
}
cpi->bgsprite_allowed = 1;
if (abs_mv_in_out_accumulator > 0.30 || decay_accumulator < 0.90 ||
avg_sr_coded_error / num_mbs < 20 || avg_pcnt_second_ref < 0.30) {
cpi->bgsprite_allowed = 0;
}
#endif // CONFIG_BGSPRITE
} else {
rc->gfu_boost = AOMMAX((int)boost_score, MIN_ARF_GF_BOOST);
rc->source_alt_ref_pending = 0;
......
......@@ -289,9 +289,6 @@ static int temporal_filter_find_matching_mb_c(AV1_COMP *cpi,
}
static void temporal_filter_iterate_c(AV1_COMP *cpi,
#if CONFIG_BGSPRITE
YV12_BUFFER_CONFIG *target,
#endif // CONFIG_BGSPRITE
YV12_BUFFER_CONFIG **frames,
int frame_count, int alt_ref_index,
int strength,
......@@ -424,17 +421,9 @@ static void temporal_filter_iterate_c(AV1_COMP *cpi,
if (mbd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
uint16_t *dst1_16;
uint16_t *dst2_16;
#if CONFIG_BGSPRITE
dst1 = target->y_buffer;
#else
dst1 = cpi->alt_ref_buffer.y_buffer;
#endif // CONFIG_BGSPRITE
dst1 = cpi->alt_ref_buffer.y_buffer;
dst1_16 = CONVERT_TO_SHORTPTR(dst1);
#if CONFIG_BGSPRITE
stride = target->y_stride;
#else
stride = cpi->alt_ref_buffer.y_stride;
#endif // CONFIG_BGSPRITE
stride = cpi->alt_ref_buffer.y_stride;
byte = mb_y_offset;
for (i = 0, k = 0; i < 16; i++) {
for (j = 0; j < 16; j++, k++) {
......@@ -473,13 +462,8 @@ static void temporal_filter_iterate_c(AV1_COMP *cpi,
byte += stride - mb_uv_width;
}
} else {
#if CONFIG_BGSPRITE
dst1 = target->y_buffer;
stride = target->y_stride;
#else
dst1 = cpi->alt_ref_buffer.y_buffer;
stride = cpi->alt_ref_buffer.y_stride;
#endif // CONFIG_BGSPRITE
dst1 = cpi->alt_ref_buffer.y_buffer;
stride = cpi->alt_ref_buffer.y_stride;
byte = mb_y_offset;
for (i = 0, k = 0; i < 16; i++) {
for (j = 0; j < 16; j++, k++) {
......@@ -491,15 +475,9 @@ static void temporal_filter_iterate_c(AV1_COMP *cpi,
}
byte += stride - 16;
}
#if CONFIG_BGSPRITE
dst1 = target->u_buffer;
dst2 = target->v_buffer;
stride = target->uv_stride;
#else
dst1 = cpi->alt_ref_buffer.u_buffer;
dst2 = cpi->alt_ref_buffer.v_buffer;
stride = cpi->alt_ref_buffer.uv_stride;
#endif // CONFIG_BGSPRITE
dst1 = cpi->alt_ref_buffer.u_buffer;
dst2 = cpi->alt_ref_buffer.v_buffer;
stride = cpi->alt_ref_buffer.uv_stride;
byte = mb_uv_offset;
for (i = 0, k = 256; i < mb_uv_height; i++) {
for (j = 0; j < mb_uv_width; j++, k++) {
......@@ -589,11 +567,7 @@ static void adjust_arnr_filter(AV1_COMP *cpi, int distance, int group_boost,
*arnr_strength = strength;
}
void av1_temporal_filter(AV1_COMP *cpi,
#if CONFIG_BGSPRITE
YV12_BUFFER_CONFIG *bg, YV12_BUFFER_CONFIG *target,
#endif // CONFIG_BGSPRITE
int distance) {
void av1_temporal_filter(AV1_COMP *cpi, int distance) {
RATE_CONTROL *const rc = &cpi->rc;
int frame;
int frames_to_blur;
......@@ -646,18 +620,9 @@ void av1_temporal_filter(AV1_COMP *cpi,
// Setup frame pointers, NULL indicates frame not included in filter.
for (frame = 0; frame < frames_to_blur; ++frame) {
const int which_buffer = start_frame - frame;
#if CONFIG_BGSPRITE
if (frame == frames_to_blur_backward && bg != NULL) {
// Insert bg into frames at ARF index.
frames[frames_to_blur - 1 - frame] = bg;
} else {
#endif // CONFIG_BGSPRITE
struct lookahead_entry *buf =
av1_lookahead_peek(cpi->lookahead, which_buffer);
frames[frames_to_blur - 1 - frame] = &buf->img;
#if CONFIG_BGSPRITE
}
#endif // CONFIG_BGSPRITE
struct lookahead_entry *buf =
av1_lookahead_peek(cpi->lookahead, which_buffer);
frames[frames_to_blur - 1 - frame] = &buf->img;
}
if (frames_to_blur > 0) {
......@@ -670,10 +635,6 @@ void av1_temporal_filter(AV1_COMP *cpi,
cpi->common.use_highbitdepth);
}
temporal_filter_iterate_c(cpi,
#if CONFIG_BGSPRITE
target,
#endif // CONFIG_BGSPRITE
frames, frames_to_blur, frames_to_blur_backward,
strength, &sf);
temporal_filter_iterate_c(cpi, frames, frames_to_blur,
frames_to_blur_backward, strength, &sf);
}
......@@ -16,11 +16,7 @@
extern "C" {
#endif
void av1_temporal_filter(AV1_COMP *cpi,
#if CONFIG_BGSPRITE
YV12_BUFFER_CONFIG *bg, YV12_BUFFER_CONFIG *target,
#endif // CONFIG_BGSPRITE
int distance);
void av1_temporal_filter(AV1_COMP *cpi, int distance);
#ifdef __cplusplus
} // extern "C"
......
......@@ -90,7 +90,6 @@ set(CONFIG_SPATIAL_RESAMPLING 1 CACHE NUMBER "Spatial resampling.")
set(CONFIG_AMVR 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_AOM_QM 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_AOM_QM_EXT 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_BGSPRITE 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_CDF_STORAGE_REDUCTION 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_CDF_UPDATE_MODE 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_CFL 1 CACHE NUMBER "AV1 experiment flag.")
......
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