Lines Matching defs:val
30 const struct minmax_sample *val)
32 u32 dt = val->t - m->s[0].t;
36 * Passed entire window without a new val so make 2nd
37 * choice the new val & 3rd choice the new 2nd choice.
44 m->s[2] = *val;
45 if (unlikely(val->t - m->s[0].t > win)) {
48 m->s[2] = *val;
52 * We've passed a quarter of the window without a new val
55 m->s[2] = m->s[1] = *val;
58 * We've passed half the window without finding a new val
61 m->s[2] = *val;
69 struct minmax_sample val = { .t = t, .v = meas };
71 if (unlikely(val.v >= m->s[0].v) || /* found new max? */
72 unlikely(val.t - m->s[2].t > win)) /* nothing left in window? */
75 if (unlikely(val.v >= m->s[1].v))
76 m->s[2] = m->s[1] = val;
77 else if (unlikely(val.v >= m->s[2].v))
78 m->s[2] = val;
80 return minmax_subwin_update(m, win, &val);
87 struct minmax_sample val = { .t = t, .v = meas };
89 if (unlikely(val.v <= m->s[0].v) || /* found new min? */
90 unlikely(val.t - m->s[2].t > win)) /* nothing left in window? */
93 if (unlikely(val.v <= m->s[1].v))
94 m->s[2] = m->s[1] = val;
95 else if (unlikely(val.v <= m->s[2].v))
96 m->s[2] = val;
98 return minmax_subwin_update(m, win, &val);