summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-04-21 22:31:36 +0200
committerClément Bœsch <ubitux@gmail.com>2013-05-07 15:23:27 +0200
commitc3dcd3a255a0018105cd6731a1bcbf522f5a2719 (patch)
treefc79956ac6475a0f91cb7289ad3cc55a19e5055d /libswscale
parent144baf427a6b786f1167f89597335e2eb512929c (diff)
downloadffmpeg-c3dcd3a255a0018105cd6731a1bcbf522f5a2719.tar.gz
sws: factorize rgb 9+ planar funcs declarations.
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/input.c130
1 files changed, 21 insertions, 109 deletions
diff --git a/libswscale/input.c b/libswscale/input.c
index 5259603fb4..21dfeca573 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -755,56 +755,6 @@ static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t *_sr
}
}
-static void planar_rgb9le_to_y(uint8_t *dst, const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_y(dst, src, w, 9, 0, rgb2yuv);
-}
-
-static void planar_rgb9be_to_y(uint8_t *dst, const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_y(dst, src, w, 9, 1, rgb2yuv);
-}
-
-static void planar_rgb10le_to_y(uint8_t *dst, const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_y(dst, src, w, 10, 0, rgb2yuv);
-}
-
-static void planar_rgb10be_to_y(uint8_t *dst, const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_y(dst, src, w, 10, 1, rgb2yuv);
-}
-
-static void planar_rgb12le_to_y(uint8_t *dst, const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_y(dst, src, w, 12, 0, rgb2yuv);
-}
-
-static void planar_rgb12be_to_y(uint8_t *dst, const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_y(dst, src, w, 12, 1, rgb2yuv);
-}
-
-static void planar_rgb14le_to_y(uint8_t *dst, const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_y(dst, src, w, 14, 0, rgb2yuv);
-}
-
-static void planar_rgb14be_to_y(uint8_t *dst, const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_y(dst, src, w, 14, 1, rgb2yuv);
-}
-
-static void planar_rgb16le_to_y(uint8_t *dst, const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_y(dst, src, w, 16, 0, rgb2yuv);
-}
-
-static void planar_rgb16be_to_y(uint8_t *dst, const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_y(dst, src, w, 16, 1, rgb2yuv);
-}
-
static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV,
const uint8_t *_src[4], int width,
int bpc, int is_be, int32_t *rgb2yuv)
@@ -826,65 +776,27 @@ static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV,
}
#undef rdpx
-static void planar_rgb9le_to_uv(uint8_t *dstU, uint8_t *dstV,
- const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_uv(dstU, dstV, src, w, 9, 0, rgb2yuv);
-}
-
-static void planar_rgb9be_to_uv(uint8_t *dstU, uint8_t *dstV,
- const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_uv(dstU, dstV, src, w, 9, 1, rgb2yuv);
-}
-
-static void planar_rgb10le_to_uv(uint8_t *dstU, uint8_t *dstV,
- const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_uv(dstU, dstV, src, w, 10, 0, rgb2yuv);
-}
-
-static void planar_rgb10be_to_uv(uint8_t *dstU, uint8_t *dstV,
- const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_uv(dstU, dstV, src, w, 10, 1, rgb2yuv);
-}
-
-static void planar_rgb12le_to_uv(uint8_t *dstU, uint8_t *dstV,
- const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_uv(dstU, dstV, src, w, 12, 0, rgb2yuv);
-}
-
-static void planar_rgb12be_to_uv(uint8_t *dstU, uint8_t *dstV,
- const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_uv(dstU, dstV, src, w, 12, 1, rgb2yuv);
-}
-
-static void planar_rgb14le_to_uv(uint8_t *dstU, uint8_t *dstV,
- const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_uv(dstU, dstV, src, w, 14, 0, rgb2yuv);
-}
-
-static void planar_rgb14be_to_uv(uint8_t *dstU, uint8_t *dstV,
- const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_uv(dstU, dstV, src, w, 14, 1, rgb2yuv);
-}
-
-static void planar_rgb16le_to_uv(uint8_t *dstU, uint8_t *dstV,
- const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_uv(dstU, dstV, src, w, 16, 0, rgb2yuv);
-}
-
-static void planar_rgb16be_to_uv(uint8_t *dstU, uint8_t *dstV,
- const uint8_t *src[4], int w, int32_t *rgb2yuv)
-{
- planar_rgb16_to_uv(dstU, dstV, src, w, 16, 1, rgb2yuv);
-}
+#define rgb9plus_planar_funcs_endian(nbits, endian_name, endian) \
+static void planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
+ int w, int32_t *rgb2yuv) \
+{ \
+ planar_rgb16_to_y(dst, src, w, nbits, endian, rgb2yuv); \
+} \
+static void planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
+ const uint8_t *src[4], int w, int32_t *rgb2yuv) \
+{ \
+ planar_rgb16_to_uv(dstU, dstV, src, w, nbits, endian, rgb2yuv); \
+} \
+
+#define rgb9plus_planar_funcs(nbits) \
+ rgb9plus_planar_funcs_endian(nbits, le, 0) \
+ rgb9plus_planar_funcs_endian(nbits, be, 1)
+
+rgb9plus_planar_funcs(9)
+rgb9plus_planar_funcs(10)
+rgb9plus_planar_funcs(12)
+rgb9plus_planar_funcs(14)
+rgb9plus_planar_funcs(16)
av_cold void ff_sws_init_input_funcs(SwsContext *c)
{