summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2015-06-29 22:43:50 +0300
committerMarco Nelissen <marcone@google.com>2015-07-31 18:50:26 +0000
commiteddf6a33fe731e0dbba56092d5020cc8edc14ca5 (patch)
tree93784f25faae3d7cc7df2049c206ffe49f63d3d0
parent6fb90f8feccf128b2503f50b7369cbc12afe489e (diff)
downloadandroid_external_libavc-eddf6a33fe731e0dbba56092d5020cc8edc14ca5.tar.gz
android_external_libavc-eddf6a33fe731e0dbba56092d5020cc8edc14ca5.tar.bz2
android_external_libavc-eddf6a33fe731e0dbba56092d5020cc8edc14ca5.zip
Use INT_MAX as i4_max_sad in ih264e_evaluate_bipred
The stored i4_mb_distortion that was used as i4_max_sad previously might come from a different coding mode - even if pf_ime_compute_sad_16x16 returns early when i4_mb_distortion is larger than ps_mb_ctxt_bi->i4_mb_distortion, the calculated i4_mb_cost can still end up smaller than ps_mb_ctxt_bi->i4_mb_cost. Therefore, set i4_max_sad to INT_MAX to avoid the early exit in pf_ime_compute_sad_16x16 here, since it can't be used reliably (and returning early can end up choosing a suboptimal mode). This makes sure that the encoded output is identical when the SIMD optimized routines are disabled, when using B-frames. Bug: 22860270 Change-Id: I9b8d524f88020e557541700133c7a0b48fe6a3b8
-rw-r--r--encoder/ih264e_me.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/encoder/ih264e_me.c b/encoder/ih264e_me.c
index a97df3d..3d12a1b 100644
--- a/encoder/ih264e_me.c
+++ b/encoder/ih264e_me.c
@@ -1733,7 +1733,7 @@ void ih264e_evaluate_bipred(me_ctxt_t *ps_me_ctxt,
ps_me_ctxt->pf_ime_compute_sad_16x16[u4_fast_sad](
ps_me_ctxt->pu1_src_buf_luma, pu1_dst_buf,
ps_me_ctxt->i4_src_strd, ps_me_ctxt->u4_subpel_buf_strd,
- ps_mb_ctxt_bi->i4_mb_distortion, &i4_mb_distortion);
+ INT_MAX, &i4_mb_distortion);
/* compute cost */
i4_mb_cost = ps_me_ctxt->pu1_mv_bits[( s_l0_mv.i2_mvy << 2 ) - ps_l0_pred_mv->i2_mvx];