Code review and speedup for Amaze Demosaic
This commit is contained in:
@@ -78,5 +78,15 @@ inline const _Tp& max(const _Tp& a, const _Tp& b, const _Tp& c, const _Tp& d)
|
||||
{
|
||||
return std::max(d, std::max(c, std::max(a, b)));
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline const _Tp intp(const _Tp a, const _Tp b, const _Tp c) {
|
||||
// calculate a * b + (1 - a) * c
|
||||
// following is valid:
|
||||
// intp(a, b+x, c+x) = vintpf(a, b, c) + x
|
||||
// intp(a, b*x, c*x) = vintpf(a, b, c) * x
|
||||
return a * (b-c) + c;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user