added some common arithmetic functions

Change-Id: I6fb164670571b79050fdfccc919ee256e194a396
rework YUV to make it easier to pipeline

Change-Id: Ic8b2a9dd5fded5ce7d3f5833565cea08ca06a1a8