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

Unified Diff: source/libvpx/vp8/encoder/pickinter.c

Issue 1302353004: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 4 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/vp8/encoder/onyx_int.h ('k') | source/libvpx/vp8/encoder/picklpf.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp8/encoder/pickinter.c
diff --git a/source/libvpx/vp8/encoder/pickinter.c b/source/libvpx/vp8/encoder/pickinter.c
index f3443dbccdc85e250fce599d1c335f072ba51e3d..c41005a3bacfb377b72aaf107082a4963108ec61 100644
--- a/source/libvpx/vp8/encoder/pickinter.c
+++ b/source/libvpx/vp8/encoder/pickinter.c
@@ -72,7 +72,7 @@ static int macroblock_corner_grad(unsigned char* signal, int stride,
int y2 = signal[offsetx * stride + offsety + sgny];
int y3 = signal[(offsetx + sgnx) * stride + offsety];
int y4 = signal[(offsetx + sgnx) * stride + offsety + sgny];
- return MAX(MAX(abs(y1 - y2), abs(y1 - y3)), abs(y1 - y4));
+ return VPXMAX(VPXMAX(abs(y1 - y2), abs(y1 - y3)), abs(y1 - y4));
}
static int check_dot_artifact_candidate(VP8_COMP *cpi,
@@ -1136,8 +1136,9 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
#if CONFIG_MULTI_RES_ENCODING
if (parent_ref_valid && (parent_ref_frame == this_ref_frame) &&
dissim <= 2 &&
- MAX(abs(best_ref_mv.as_mv.row - parent_ref_mv.as_mv.row),
- abs(best_ref_mv.as_mv.col - parent_ref_mv.as_mv.col)) <= 4)
+ VPXMAX(abs(best_ref_mv.as_mv.row - parent_ref_mv.as_mv.row),
+ abs(best_ref_mv.as_mv.col - parent_ref_mv.as_mv.col)) <=
+ 4)
{
d->bmi.mv.as_int = mvp_full.as_int;
mode_mv[NEWMV].as_int = mvp_full.as_int;
@@ -1240,7 +1241,10 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
}
mode_mv[NEWMV].as_int = d->bmi.mv.as_int;
-
+ // The clamp below is not necessary from the perspective
+ // of VP8 bitstream, but is added to improve ChromeCast
+ // mirroring's robustness. Please do not remove.
+ vp8_clamp_mv2(&mode_mv[this_mode], xd);
/* mv cost; */
rate2 += vp8_mv_bit_cost(&mode_mv[NEWMV], &best_ref_mv,
cpi->mb.mvcost, 128);
@@ -1248,7 +1252,6 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
case NEARESTMV:
case NEARMV:
-
if (mode_mv[this_mode].as_int == 0)
continue;
« no previous file with comments | « source/libvpx/vp8/encoder/onyx_int.h ('k') | source/libvpx/vp8/encoder/picklpf.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698