I'm trying to understand the following function in libvpx (vp8/common/reconinter.c
):
void vp8_copy_mem16x16_c(unsigned char *src, int src_stride, unsigned char *dst,
int dst_stride) {
int r;
for (r = 0; r < 16; ++r) {
memcpy(dst, src, 16);
src += src_stride;
dst += dst_stride;
}
}
(8x8 and 8x4 versions also exist in the same source file.)
It is copying 16 bytes from the src
to the dst
16 times, but at the same time, it is adding a custom stride
to both src
and dst
. Without prior knowledge on computer graphics and DSP, I feel very confused of these functions: What's the point of supporting custom stride
s in src
and dst
? What are some examples or benefits of using such functions rather than just copying the whole 16 x 16 bytes all together?
Thank you very much!
Update: to make it clear, vp8_copy_mem16x16_c
is re-defined as vp8_copy_mem16x16
during build stage when an vector-optimized version is not available on the target platform.