/* R1 (8bit) = R1 R2 (8bit) = R2 R (temp) = min((R1 + R2)/2, 255) DCT (16bit)= C - R C (8bit) = R  */
void transfer_8to16sub2_c(int16_t *const dct, uint8_t *const cur, const uint8_t *ref1, const uint8_t *ref2, const uint32_t stride)
/* R1 (8bit) = R1 R2 (8bit) = R2 R (temp) = min((R1 + R2)/2, 255) DCT (16bit)= C - R C (8bit) = R  */
void transfer_8to16sub2_c(int16_t *const dct, uint8_t *const cur, const uint8_t *ref1, const uint8_t *ref2, const uint32_t stride)
{
	uint32_t i, j;
	for (j = 0; j < 8; j++) {
		for (i = 0; i < 8; i++) {
			const uint8_t c = cur[j * stride + i];
			const uint8_t r = (ref1[j * stride + i] + ref2[j * stride + i] + 1) >> 1;
			cur[j * stride + i] = r;
			dct[j * 8 + i] = (int16_t) c - (int16_t) r;
		}
	}
}