diff options
author | Paul Wilkins <paulwilkins@google.com> | 2013-03-26 14:40:24 +0000 |
---|---|---|
committer | Paul Wilkins <paulwilkins@google.com> | 2013-03-28 12:49:02 +0000 |
commit | 17ef6a8dfd31fc5787d291dfc254d3acd5d814ef (patch) | |
tree | 60ba2333dd05859a05d3ab04f939d209d00ad05c /vp9/encoder | |
parent | befb0393c5eb835a8aa53d101edc204d80400048 (diff) | |
download | libvpx-17ef6a8dfd31fc5787d291dfc254d3acd5d814ef.tar libvpx-17ef6a8dfd31fc5787d291dfc254d3acd5d814ef.tar.gz libvpx-17ef6a8dfd31fc5787d291dfc254d3acd5d814ef.tar.bz2 libvpx-17ef6a8dfd31fc5787d291dfc254d3acd5d814ef.zip |
Adjust mv_ratio_accumulator threshold.
This threshold effectively limits the amount of motion
from one end of a GF/ARF group to the other.
This patch makes the threshold depend on image size.
Change-Id: Id45d1d7bced815f86ddd037be53164894b00b82f
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_firstpass.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 92bb1080f..70f9e3153 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -1536,7 +1536,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { double this_frame_mv_in_out = 0.0; double mv_in_out_accumulator = 0.0; double abs_mv_in_out_accumulator = 0.0; - + double mv_ratio_accumulator_thresh; int max_bits = frame_max_bits(cpi); // Max for a single frame unsigned int allow_alt_ref = @@ -1568,10 +1568,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { if (cpi->common.frame_type == KEY_FRAME) gf_group_err -= gf_first_frame_err; - // Scan forward to try and work out how many frames the next gf group - // should contain and what level of boost is appropriate for the GF - // or ARF that will be coded with the group - i = 0; + // Motion breakout threshold for loop below depends on image size. + mv_ratio_accumulator_thresh = (cpi->common.width + cpi->common.height) / 10.0; // Work out a maximum interval for the GF. // If the image appears completely static we can extend beyond this. @@ -1585,6 +1583,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { if (active_max_gf_interval > cpi->max_gf_interval) active_max_gf_interval = cpi->max_gf_interval; + i = 0; while (((i < cpi->twopass.static_scene_max_gf_interval) || ((cpi->twopass.frames_to_key - i) < MIN_GF_INTERVAL)) && (i < cpi->twopass.frames_to_key)) { @@ -1644,7 +1643,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { ((cpi->twopass.frames_to_key - i) >= MIN_GF_INTERVAL) && ((boost_score > 125.0) || (next_frame.pcnt_inter < 0.75)) && (!flash_detected) && - ((mv_ratio_accumulator > 100.0) || + ((mv_ratio_accumulator > mv_ratio_accumulator_thresh) || (abs_mv_in_out_accumulator > 3.0) || (mv_in_out_accumulator < -2.0) || ((boost_score - old_boost_score) < IIFACTOR)) |