/* See chapter  "Capture Filter Control Register (CFLCR)" in SH7722 Hardware Manual  */
static unsigned int size_dst(unsigned int src, unsigned int scale)
/* See chapter  "Capture Filter Control Register (CFLCR)" in SH7722 Hardware Manual  */
static unsigned int size_dst(unsigned int src, unsigned int scale)
{
	unsigned int mant_pre = scale >> 12;
	if (!src || !scale)
		return src;
	return ((mant_pre + 2 * (src - 1)) / (2 * mant_pre) - 1) *
		mant_pre * 4096 / scale + 1;
}