File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -220,8 +220,9 @@ static bool check_mv_cost(inter_search_info_t *info,
220
220
info -> height ,
221
221
info -> optimized_sad
222
222
);
223
-
224
- if (cost >= * best_cost ) return false;
223
+ // On some platforms comparing two doubles give weird results, so add an offset
224
+ #define KVZ_TEMP_DOUBLE_PRECISION 0.001
225
+ if (cost + KVZ_TEMP_DOUBLE_PRECISION >= * best_cost ) return false;
225
226
226
227
cost += info -> mvd_cost_func (
227
228
info -> state ,
@@ -233,7 +234,8 @@ static bool check_mv_cost(inter_search_info_t *info,
233
234
& bitcost
234
235
);
235
236
236
- if (cost >= * best_cost ) return false;
237
+ if (cost + KVZ_TEMP_DOUBLE_PRECISION >= * best_cost ) return false;
238
+ #undef KVZ_TEMP_DOUBLE_PRECISION
237
239
238
240
// Set to motion vector in quarter pixel precision.
239
241
best_mv -> x = x * 4 ;
You can’t perform that action at this time.
0 commit comments