Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Vignali <martin.vignali@gmail.com>2018-03-24 22:17:32 +0300
committerMartin Vignali <martin.vignali@gmail.com>2018-03-24 22:22:02 +0300
commitd4f6640855faf57da1ccc3cade356975fcb00207 (patch)
tree73b0bc1e31a73e62634604b0d64ad0875262b730 /libswscale/rgb2rgb_template.c
parent923a324174c2d943b8d21d0b77fc0d0c847abca0 (diff)
swscale/rgb : move shuffle func shuffle_bytes_1230, shuffle_bytes_3012, shuffle_bytes_3210 in order to add SIMD
Diffstat (limited to 'libswscale/rgb2rgb_template.c')
-rw-r--r--libswscale/rgb2rgb_template.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c
index 499d25b26d..fb7d663ccc 100644
--- a/libswscale/rgb2rgb_template.c
+++ b/libswscale/rgb2rgb_template.c
@@ -342,6 +342,24 @@ static inline void shuffle_bytes_0321_c(const uint8_t *src, uint8_t *dst,
}
}
+#define DEFINE_SHUFFLE_BYTES(name, a, b, c, d) \
+static void shuffle_bytes_##name (const uint8_t *src, \
+ uint8_t *dst, int src_size) \
+{ \
+ int i; \
+ \
+ for (i = 0; i < src_size; i += 4) { \
+ dst[i + 0] = src[i + a]; \
+ dst[i + 1] = src[i + b]; \
+ dst[i + 2] = src[i + c]; \
+ dst[i + 3] = src[i + d]; \
+ } \
+}
+
+DEFINE_SHUFFLE_BYTES(1230_c, 1, 2, 3, 0)
+DEFINE_SHUFFLE_BYTES(3012_c, 3, 0, 1, 2)
+DEFINE_SHUFFLE_BYTES(3210_c, 3, 2, 1, 0)
+
static inline void rgb24tobgr24_c(const uint8_t *src, uint8_t *dst, int src_size)
{
unsigned i;
@@ -949,6 +967,9 @@ static av_cold void rgb2rgb_init_c(void)
#else
shuffle_bytes_0321 = shuffle_bytes_0321_c;
shuffle_bytes_2103 = shuffle_bytes_2103_c;
+ shuffle_bytes_1230 = shuffle_bytes_1230_c;
+ shuffle_bytes_3012 = shuffle_bytes_3012_c;
+ shuffle_bytes_3210 = shuffle_bytes_3210_c;
#endif
rgb32tobgr16 = rgb32tobgr16_c;
rgb32tobgr15 = rgb32tobgr15_c;