summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_firstpass.c
diff options
context:
space:
mode:
authorAdrian Grange <agrange@google.com>2013-04-17 10:12:31 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-04-17 10:12:31 -0700
commitadf285f6c141b77be26d05916b36874b5ab52a48 (patch)
treeafa3d16d91cc4d9f98450dcd18f9a1a5ebae62c7 /vp9/encoder/vp9_firstpass.c
parentcbd6eaa9241ff18160e06a64023ae4802cac8c0c (diff)
parent9b84d113566216b700e65487cd2fbc5293be492c (diff)
downloadlibvpx-adf285f6c141b77be26d05916b36874b5ab52a48.tar
libvpx-adf285f6c141b77be26d05916b36874b5ab52a48.tar.gz
libvpx-adf285f6c141b77be26d05916b36874b5ab52a48.tar.bz2
libvpx-adf285f6c141b77be26d05916b36874b5ab52a48.zip
Merge "Move configure_arnr_filter function" into experimental
Diffstat (limited to 'vp9/encoder/vp9_firstpass.c')
-rw-r--r--vp9/encoder/vp9_firstpass.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index cda3b5d6d..e4e7b9a4e 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -1447,77 +1447,6 @@ static int calc_arf_boost(
return arf_boost;
}
-void configure_arnr_filter(VP9_COMP *cpi, const unsigned int this_frame,
- int group_boost) {
- int half_gf_int;
- int frames_after_arf;
- int frames_bwd = cpi->oxcf.arnr_max_frames - 1;
- int frames_fwd = cpi->oxcf.arnr_max_frames - 1;
- int q;
-
- // Define the arnr filter width for this group of frames:
- // We only filter frames that lie within a distance of half
- // the GF interval from the ARF frame. We also have to trap
- // cases where the filter extends beyond the end of clip.
- // Note: this_frame->frame has been updated in the loop
- // so it now points at the ARF frame.
- half_gf_int = cpi->baseline_gf_interval >> 1;
- frames_after_arf = (int)(cpi->twopass.total_stats->count - this_frame - 1);
-
- switch (cpi->oxcf.arnr_type) {
- case 1: // Backward filter
- frames_fwd = 0;
- if (frames_bwd > half_gf_int)
- frames_bwd = half_gf_int;
- break;
-
- case 2: // Forward filter
- if (frames_fwd > half_gf_int)
- frames_fwd = half_gf_int;
- if (frames_fwd > frames_after_arf)
- frames_fwd = frames_after_arf;
- frames_bwd = 0;
- break;
-
- case 3: // Centered filter
- default:
- frames_fwd >>= 1;
- if (frames_fwd > frames_after_arf)
- frames_fwd = frames_after_arf;
- if (frames_fwd > half_gf_int)
- frames_fwd = half_gf_int;
-
- frames_bwd = frames_fwd;
-
- // For even length filter there is one more frame backward
- // than forward: e.g. len=6 ==> bbbAff, len=7 ==> bbbAfff.
- if (frames_bwd < half_gf_int)
- frames_bwd += (cpi->oxcf.arnr_max_frames + 1) & 0x1;
- break;
- }
-
- cpi->active_arnr_frames = frames_bwd + 1 + frames_fwd;
-
- // Adjust the strength based on active max q
- q = ((int)vp9_convert_qindex_to_q(cpi->active_worst_quality) >> 1);
- if (q > 8) {
- cpi->active_arnr_strength = cpi->oxcf.arnr_strength;
- } else {
- cpi->active_arnr_strength = cpi->oxcf.arnr_strength - (8 - q);
- if (cpi->active_arnr_strength < 0)
- cpi->active_arnr_strength = 0;
- }
-
- // Adjust number of frames in filter and strength based on gf boost level.
- if (cpi->active_arnr_frames > (group_boost / 150)) {
- cpi->active_arnr_frames = (group_boost / 150);
- cpi->active_arnr_frames += !(cpi->active_arnr_frames & 1);
- }
- if (cpi->active_arnr_strength > (group_boost / 300)) {
- cpi->active_arnr_strength = (group_boost / 300);
- }
-}
-
#if CONFIG_MULTIPLE_ARF
// Work out the frame coding order for a GF or an ARF group.
// The current implementation codes frames in their natural order for a