Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Unified Diff: source/libvpx/vp9/encoder/vp9_rd.c

Issue 394353005: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_ratectrl.c ('k') | source/libvpx/vp9/encoder/vp9_speed_features.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/encoder/vp9_rd.c
===================================================================
--- source/libvpx/vp9/encoder/vp9_rd.c (revision 284462)
+++ source/libvpx/vp9/encoder/vp9_rd.c (working copy)
@@ -92,13 +92,6 @@
}
}
-static const uint8_t rd_iifactor[32] = {
- 4, 4, 3, 2, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
// Values are now correlated to quantizer.
static int sad_per_bit16lut[QINDEX_RANGE];
static int sad_per_bit4lut[QINDEX_RANGE];
@@ -116,15 +109,25 @@
}
}
+static const int rd_boost_factor[16] = {
+ 64, 32, 32, 32, 24, 16, 12, 12,
+ 8, 8, 4, 4, 2, 2, 1, 0
+};
+static const int rd_frame_type_factor[FRAME_UPDATE_TYPES] = {
+128, 144, 128, 128, 144
+};
+
int vp9_compute_rd_mult(const VP9_COMP *cpi, int qindex) {
const int q = vp9_dc_quant(qindex, 0);
- // TODO(debargha): Adjust the function below.
- int rdmult = 88 * q * q / 25;
+ int rdmult = 88 * q * q / 24;
+
if (cpi->pass == 2 && (cpi->common.frame_type != KEY_FRAME)) {
- if (cpi->twopass.next_iiratio > 31)
- rdmult += (rdmult * rd_iifactor[31]) >> 4;
- else
- rdmult += (rdmult * rd_iifactor[cpi->twopass.next_iiratio]) >> 4;
+ const GF_GROUP *const gf_group = &cpi->twopass.gf_group;
+ const FRAME_UPDATE_TYPE frame_type = gf_group->update_type[gf_group->index];
+ const int boost_index = MIN(15, (cpi->rc.gfu_boost / 100));
+
+ rdmult = (rdmult * rd_frame_type_factor[frame_type]) >> 7;
+ rdmult += ((rdmult * rd_boost_factor[boost_index]) >> 7);
}
return rdmult;
}
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_ratectrl.c ('k') | source/libvpx/vp9/encoder/vp9_speed_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698