Index: source/libvpx/vp9/encoder/vp9_mcomp.c |
diff --git a/source/libvpx/vp9/encoder/vp9_mcomp.c b/source/libvpx/vp9/encoder/vp9_mcomp.c |
index 159e0fc0c712b378c2826ba79a2c85fb91a515fb..a428f1a2d3228836accb9b811725ccaeba4dcc63 100644 |
--- a/source/libvpx/vp9/encoder/vp9_mcomp.c |
+++ b/source/libvpx/vp9/encoder/vp9_mcomp.c |
@@ -90,10 +90,13 @@ static int mv_err_cost(const MV *mv, const MV *ref, |
static int mvsad_err_cost(const MACROBLOCK *x, const MV *mv, const MV *ref, |
int error_per_bit) { |
- const MV diff = { mv->row - ref->row, |
- mv->col - ref->col }; |
- return ROUND_POWER_OF_TWO(mv_cost(&diff, x->nmvjointsadcost, |
- x->nmvsadcost) * error_per_bit, 8); |
+ if (x->nmvsadcost) { |
+ const MV diff = { mv->row - ref->row, |
+ mv->col - ref->col }; |
+ return ROUND_POWER_OF_TWO(mv_cost(&diff, x->nmvjointsadcost, |
+ x->nmvsadcost) * error_per_bit, 8); |
+ } |
+ return 0; |
} |
void vp9_init_dsmotion_compensation(search_site_config *cfg, int stride) { |