This lets the compiler unroll ever so slightly better (at least in the 16x16 case for RISC-V GCC).
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -30,7 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | // FIXME see whether we can merge parts of this (perhaps at least 4x4 and 8x8) |
| 31 | 31 | // back with h264pred.[ch] |
| 32 | 32 | |
| 33 | −static void vert_4x4_c(uint8_t *_dst, ptrdiff_t stride, | |
| 33 | +static void vert_4x4_c(uint8_t *restrict _dst, ptrdiff_t stride, | |
| 34 | 34 | const uint8_t *left, const uint8_t *_top) |
| 35 | 35 | { |
| 36 | 36 | pixel *dst = (pixel *) _dst; |
| @@ -44,7 +44,7 @@ static void vert_4x4_c(uint8_t *_dst, ptrdiff_t stride, · 7 unmodified lines | ||
| 44 | 44 | AV_WN4PA(dst + stride * 3, p4); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | −static void vert_8x8_c(uint8_t *_dst, ptrdiff_t stride, | |
| 47 | +static void vert_8x8_c(uint8_t *restrict _dst, ptrdiff_t stride, | |
| 48 | 48 | const uint8_t *left, const uint8_t *_top) |
| 49 | 49 | { |
| 50 | 50 | pixel *dst = (pixel *) _dst; |
| @@ -61,7 +61,7 @@ static void vert_8x8_c(uint8_t *_dst, ptrdiff_t stride, · 10 unmodified lines | ||
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | −static void vert_16x16_c(uint8_t *_dst, ptrdiff_t stride, | |
| 64 | +static void vert_16x16_c(uint8_t *restrict _dst, ptrdiff_t stride, | |
| 65 | 65 | const uint8_t *left, const uint8_t *_top) |
| 66 | 66 | { |
| 67 | 67 | pixel *dst = (pixel *) _dst; |
| @@ -82,7 +82,7 @@ static void vert_16x16_c(uint8_t *_dst, ptrdiff_t stride, · 14 unmodified lines | ||
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | −static void vert_32x32_c(uint8_t *_dst, ptrdiff_t stride, | |
| 85 | +static void vert_32x32_c(uint8_t *restrict _dst, ptrdiff_t stride, | |
| 86 | 86 | const uint8_t *left, const uint8_t *_top) |
| 87 | 87 | { |
| 88 | 88 | pixel *dst = (pixel *) _dst; |