Code review and speedup for Amaze Demosaic

This commit is contained in:
heckflosse
2016-01-24 01:44:35 +01:00
parent e5b1abdc3b
commit 2017a0e592
4 changed files with 884 additions and 868 deletions

View File

@@ -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