Lines Matching refs:ratio
270 static unsigned int get_compensation(int ratio) in get_compensation() argument
275 if (ratio == 1 && in get_compensation()
276 cal_data[ratio].confidence >= CONFIDENCE_OK && in get_compensation()
277 cal_data[ratio + 1].confidence >= CONFIDENCE_OK && in get_compensation()
278 cal_data[ratio + 2].confidence >= CONFIDENCE_OK) { in get_compensation()
279 comp = (cal_data[ratio].steady_comp + in get_compensation()
280 cal_data[ratio + 1].steady_comp + in get_compensation()
281 cal_data[ratio + 2].steady_comp) / 3; in get_compensation()
282 } else if (ratio == MAX_TARGET_RATIO - 1 && in get_compensation()
283 cal_data[ratio].confidence >= CONFIDENCE_OK && in get_compensation()
284 cal_data[ratio - 1].confidence >= CONFIDENCE_OK && in get_compensation()
285 cal_data[ratio - 2].confidence >= CONFIDENCE_OK) { in get_compensation()
286 comp = (cal_data[ratio].steady_comp + in get_compensation()
287 cal_data[ratio - 1].steady_comp + in get_compensation()
288 cal_data[ratio - 2].steady_comp) / 3; in get_compensation()
289 } else if (cal_data[ratio].confidence >= CONFIDENCE_OK && in get_compensation()
290 cal_data[ratio - 1].confidence >= CONFIDENCE_OK && in get_compensation()
291 cal_data[ratio + 1].confidence >= CONFIDENCE_OK) { in get_compensation()
292 comp = (cal_data[ratio].steady_comp + in get_compensation()
293 cal_data[ratio - 1].steady_comp + in get_compensation()
294 cal_data[ratio + 1].steady_comp) / 3; in get_compensation()
299 comp = ratio; in get_compensation()
301 if (comp + ratio >= MAX_TARGET_RATIO) in get_compensation()
302 comp = MAX_TARGET_RATIO - ratio - 1; in get_compensation()