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

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

Issue 23440041: Libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 3 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_block.h ('k') | source/libvpx/vp9/encoder/vp9_onyx_if.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/encoder/vp9_encodeframe.c
===================================================================
--- source/libvpx/vp9/encoder/vp9_encodeframe.c (revision 223160)
+++ source/libvpx/vp9/encoder/vp9_encodeframe.c (working copy)
@@ -1316,7 +1316,6 @@
save_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
x->fast_ms = 0;
- x->pred_mv.as_int = 0;
x->subblock_ref = 0;
if (cpi->sf.adjust_partitioning_from_last_frame) {
@@ -1710,10 +1709,6 @@
// Set fast motion search level.
x->fast_ms = 1;
- // Calculate prediction MV.
- x->pred_mv.as_mv.row = (mvr0 + mvr1 + mvr2 + mvr3) >> 2;
- x->pred_mv.as_mv.col = (mvc0 + mvc1 + mvc2 + mvc3) >> 2;
-
if (ref0 == ref1 && ref1 == ref2 && ref2 == ref3 &&
d01 < 2 && d23 < 2 && d02 < 2 && d13 < 2) {
// Set fast motion search level.
@@ -1729,6 +1724,14 @@
}
}
+static INLINE void store_pred_mv(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx) {
+ vpx_memcpy(ctx->pred_mv, x->pred_mv, sizeof(x->pred_mv));
+}
+
+static INLINE void load_pred_mv(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx) {
+ vpx_memcpy(x->pred_mv, ctx->pred_mv, sizeof(x->pred_mv));
+}
+
// TODO(jingning,jimbankoski,rbultje): properly skip partition types that are
// unlikely to be selected depending on previous rate-distortion optimization
// results, for encoding speed-up.
@@ -1837,6 +1840,10 @@
restore_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
}
+ // store estimated motion vector
+ if (cpi->sf.adaptive_motion_search)
+ store_pred_mv(x, get_block_context(x, bsize));
+
// PARTITION_SPLIT
sum_rd = 0;
// TODO(jingning): use the motion vectors given by the above search as
@@ -1851,7 +1858,8 @@
continue;
*get_sb_index(xd, subsize) = i;
-
+ if (cpi->sf.adaptive_motion_search)
+ load_pred_mv(x, get_block_context(x, bsize));
rd_pick_partition(cpi, tp, mi_row + y_idx, mi_col + x_idx, subsize,
&this_rate, &this_dist, i != 3, best_rd - sum_rd);
@@ -1885,7 +1893,6 @@
}
x->fast_ms = 0;
- x->pred_mv.as_int = 0;
x->subblock_ref = 0;
if (partition_split_done &&
@@ -1897,6 +1904,8 @@
if (partition_horz_allowed && do_rect) {
subsize = get_subsize(bsize, PARTITION_HORZ);
*get_sb_index(xd, subsize) = 0;
+ if (cpi->sf.adaptive_motion_search)
+ load_pred_mv(x, get_block_context(x, bsize));
pick_sb_modes(cpi, mi_row, mi_col, &sum_rate, &sum_dist, subsize,
get_block_context(x, subsize), best_rd);
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
@@ -1906,6 +1915,8 @@
encode_superblock(cpi, tp, 0, mi_row, mi_col, subsize);
*get_sb_index(xd, subsize) = 1;
+ if (cpi->sf.adaptive_motion_search)
+ load_pred_mv(x, get_block_context(x, bsize));
pick_sb_modes(cpi, mi_row + ms, mi_col, &this_rate,
&this_dist, subsize, get_block_context(x, subsize),
best_rd - sum_rd);
@@ -1937,6 +1948,8 @@
subsize = get_subsize(bsize, PARTITION_VERT);
*get_sb_index(xd, subsize) = 0;
+ if (cpi->sf.adaptive_motion_search)
+ load_pred_mv(x, get_block_context(x, bsize));
pick_sb_modes(cpi, mi_row, mi_col, &sum_rate, &sum_dist, subsize,
get_block_context(x, subsize), best_rd);
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
@@ -1945,6 +1958,8 @@
encode_superblock(cpi, tp, 0, mi_row, mi_col, subsize);
*get_sb_index(xd, subsize) = 1;
+ if (cpi->sf.adaptive_motion_search)
+ load_pred_mv(x, get_block_context(x, bsize));
pick_sb_modes(cpi, mi_row, mi_col + ms, &this_rate,
&this_dist, subsize, get_block_context(x, subsize),
best_rd - sum_rd);
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_block.h ('k') | source/libvpx/vp9/encoder/vp9_onyx_if.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698