summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2019-02-05 18:30:57 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-02-05 18:30:57 +0000
commitba38d25c3d86c7ffc9da3f73dd088d76f81ba3c6 (patch)
treef306deb655ed0c71aaf5ffd6d3d9266fa5d3d623
parent5316cfe95af4364aee5eb7faf3f66b3a3f9c56fe (diff)
parent2cdc78fc61369c2e9721e1643c26fa70da54acd9 (diff)
downloadlibvpx-ba38d25c3d86c7ffc9da3f73dd088d76f81ba3c6.tar
libvpx-ba38d25c3d86c7ffc9da3f73dd088d76f81ba3c6.tar.gz
libvpx-ba38d25c3d86c7ffc9da3f73dd088d76f81ba3c6.tar.bz2
libvpx-ba38d25c3d86c7ffc9da3f73dd088d76f81ba3c6.zip
Merge "vp8: Add extra conditon for overshoot-drop"
-rw-r--r--vp8/encoder/onyx_if.c1
-rw-r--r--vp8/encoder/onyx_int.h1
-rw-r--r--vp8/encoder/ratectrl.c3
3 files changed, 4 insertions, 1 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index adc25024c..9aca0f24b 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -3950,6 +3950,7 @@ static void encode_frame_to_data_rate(VP8_COMP *cpi, size_t *size,
if (cpi->pass == 0 && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
if (vp8_drop_encodedframe_overshoot(cpi, Q)) return;
+ cpi->last_pred_err_mb = (int)(cpi->mb.prediction_error / cpi->common.MBs);
}
cpi->projected_frame_size -= vp8_estimate_entropy_savings(cpi);
diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h
index 603de8bcb..5189d4338 100644
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -510,6 +510,7 @@ typedef struct VP8_COMP {
int force_maxqp;
int frames_since_last_drop_overshoot;
+ int last_pred_err_mb;
// GF update for 1 pass cbr.
int gf_update_onepass_cbr;
diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c
index ce07a6f19..d7badeb5a 100644
--- a/vp8/encoder/ratectrl.c
+++ b/vp8/encoder/ratectrl.c
@@ -1484,7 +1484,8 @@ int vp8_drop_encodedframe_overshoot(VP8_COMP *cpi, int Q) {
if (cpi->drop_frames_allowed && pred_err_mb > (thresh_pred_err_mb << 4))
thresh_rate = thresh_rate >> 3;
if ((Q < thresh_qp && cpi->projected_frame_size > thresh_rate &&
- pred_err_mb > thresh_pred_err_mb) ||
+ pred_err_mb > thresh_pred_err_mb &&
+ pred_err_mb > 2 * cpi->last_pred_err_mb) ||
force_drop_overshoot) {
unsigned int i;
double new_correction_factor;