From d1a9eacb757f80fbf73b7735ec191c7e9eef6828 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 2 Mar 2015 13:27:23 +0100 Subject: [PATCH] video-format: more fixes for big endian --- gst-libs/gst/video/video-format.c | 22 +- gst-libs/gst/video/video-orc-dist.c | 1462 ++------------------------- gst-libs/gst/video/video-orc-dist.h | 12 +- gst-libs/gst/video/video-orc.orc | 112 +- 4 files changed, 110 insertions(+), 1498 deletions(-) diff --git a/gst-libs/gst/video/video-format.c b/gst-libs/gst/video/video-format.c index 460a581e6a..ac5c09165b 100644 --- a/gst-libs/gst/video/video-format.c +++ b/gst-libs/gst/video/video-format.c @@ -1001,17 +1001,10 @@ unpack_RGB16 (const GstVideoFormatInfo * info, GstVideoPackFlags flags, { const guint16 *restrict s = GET_LINE (y); -#if G_BYTE_ORDER == G_LITTLE_ENDIAN if (flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE) - video_orc_unpack_RGB16_le_trunc (dest, s + x, width); + video_orc_unpack_RGB16_trunc (dest, s + x, width); else - video_orc_unpack_RGB16_le (dest, s + x, width); -#else - if (flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE) - video_orc_unpack_RGB16_be_trunc (dest, s + x, width); - else - video_orc_unpack_RGB16_be (dest, s + x, width); -#endif + video_orc_unpack_RGB16 (dest, s + x, width); } static void @@ -1037,17 +1030,10 @@ unpack_BGR16 (const GstVideoFormatInfo * info, GstVideoPackFlags flags, { const guint16 *restrict s = GET_LINE (y); -#if G_BYTE_ORDER == G_LITTLE_ENDIAN if (flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE) - video_orc_unpack_BGR16_le_trunc (dest, s + x, width); + video_orc_unpack_BGR16_trunc (dest, s + x, width); else - video_orc_unpack_BGR16_le (dest, s + x, width); -#else - if (flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE) - video_orc_unpack_BGR16_be_trunc (dest, s + x, width); - else - video_orc_unpack_BGR16_be (dest, s + x, width); -#endif + video_orc_unpack_BGR16 (dest, s + x, width); } static void diff --git a/gst-libs/gst/video/video-orc-dist.c b/gst-libs/gst/video/video-orc-dist.c index caa53774d0..7824905c14 100644 --- a/gst-libs/gst/video/video-orc-dist.c +++ b/gst-libs/gst/video/video-orc-dist.c @@ -191,25 +191,17 @@ void video_orc_pack_BGR15_le (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n); void video_orc_pack_BGR15_be (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n); -void video_orc_unpack_RGB16_le (guint32 * ORC_RESTRICT d1, +void video_orc_unpack_RGB16 (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_RGB16_be (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_RGB16_le_trunc (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_RGB16_be_trunc (guint32 * ORC_RESTRICT d1, +void video_orc_unpack_RGB16_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); void video_orc_pack_RGB16_le (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n); void video_orc_pack_RGB16_be (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n); -void video_orc_unpack_BGR16_le (guint32 * ORC_RESTRICT d1, +void video_orc_unpack_BGR16 (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_BGR16_be (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_BGR16_le_trunc (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_BGR16_be_trunc (guint32 * ORC_RESTRICT d1, +void video_orc_unpack_BGR16_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); void video_orc_pack_BGR16_le (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n); @@ -8421,11 +8413,11 @@ video_orc_pack_RGB15_be (guint16 * ORC_RESTRICT d1, var48.i = var45.i | var46.i; /* 11: orl */ var49.i = var48.i | var47.i; - /* 12: select0lw */ + /* 12: select1lw */ { orc_union32 _src; _src.i = var49.i; - var40.i = _src.x2[0]; + var40.i = _src.x2[1]; } /* 13: storew */ ptr0[i] = var40; @@ -8496,11 +8488,11 @@ _backup_video_orc_pack_RGB15_be (OrcExecutor * ORC_RESTRICT ex) var48.i = var45.i | var46.i; /* 11: orl */ var49.i = var48.i | var47.i; - /* 12: select0lw */ + /* 12: select1lw */ { orc_union32 _src; _src.i = var49.i; - var40.i = _src.x2[0]; + var40.i = _src.x2[1]; } /* 13: storew */ ptr0[i] = var40; @@ -8531,7 +8523,7 @@ video_orc_pack_RGB15_be (guint16 * ORC_RESTRICT d1, 3, 0, 0, 0, 20, 4, 20, 4, 20, 4, 20, 4, 20, 4, 113, 32, 4, 106, 33, 32, 16, 106, 34, 32, 17, 106, 35, 32, 18, 126, 33, 33, 19, 126, 34, 34, 20, 126, 35, 35, 21, 123, 36, 33, 34, 123, 36, 36, - 35, 190, 0, 36, 2, 0, + 35, 191, 0, 36, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_video_orc_pack_RGB15_be); @@ -8571,7 +8563,7 @@ video_orc_pack_RGB15_be (guint16 * ORC_RESTRICT d1, ORC_VAR_D1); orc_program_append_2 (p, "orl", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1); - orc_program_append_2 (p, "select0lw", 0, ORC_VAR_D1, ORC_VAR_T5, + orc_program_append_2 (p, "select1lw", 0, ORC_VAR_D1, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); #endif @@ -10079,11 +10071,11 @@ video_orc_pack_BGR15_be (guint16 * ORC_RESTRICT d1, var48.i = var47.i | var46.i; /* 11: orl */ var49.i = var48.i | var45.i; - /* 12: select0lw */ + /* 12: select1lw */ { orc_union32 _src; _src.i = var49.i; - var40.i = _src.x2[0]; + var40.i = _src.x2[1]; } /* 13: storew */ ptr0[i] = var40; @@ -10154,11 +10146,11 @@ _backup_video_orc_pack_BGR15_be (OrcExecutor * ORC_RESTRICT ex) var48.i = var47.i | var46.i; /* 11: orl */ var49.i = var48.i | var45.i; - /* 12: select0lw */ + /* 12: select1lw */ { orc_union32 _src; _src.i = var49.i; - var40.i = _src.x2[0]; + var40.i = _src.x2[1]; } /* 13: storew */ ptr0[i] = var40; @@ -10189,7 +10181,7 @@ video_orc_pack_BGR15_be (guint16 * ORC_RESTRICT d1, 19, 0, 0, 0, 20, 4, 20, 4, 20, 4, 20, 4, 20, 4, 113, 32, 4, 106, 33, 32, 16, 106, 34, 32, 17, 106, 35, 32, 18, 124, 35, 35, 19, 126, 34, 34, 20, 126, 33, 33, 21, 123, 36, 33, 34, 123, 36, 36, - 35, 190, 0, 36, 2, 0, + 35, 191, 0, 36, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_video_orc_pack_BGR15_be); @@ -10229,7 +10221,7 @@ video_orc_pack_BGR15_be (guint16 * ORC_RESTRICT d1, ORC_VAR_D1); orc_program_append_2 (p, "orl", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1); - orc_program_append_2 (p, "select0lw", 0, ORC_VAR_D1, ORC_VAR_T5, + orc_program_append_2 (p, "select1lw", 0, ORC_VAR_D1, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); #endif @@ -10253,10 +10245,10 @@ video_orc_pack_BGR15_be (guint16 * ORC_RESTRICT d1, #endif -/* video_orc_unpack_RGB16_le */ +/* video_orc_unpack_RGB16 */ #ifdef DISABLE_ORC void -video_orc_unpack_RGB16_le (guint32 * ORC_RESTRICT d1, +video_orc_unpack_RGB16 (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n) { int i; @@ -10375,7 +10367,7 @@ video_orc_unpack_RGB16_le (guint32 * ORC_RESTRICT d1, #else static void -_backup_video_orc_unpack_RGB16_le (OrcExecutor * ORC_RESTRICT ex) +_backup_video_orc_unpack_RGB16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; @@ -10493,7 +10485,7 @@ _backup_video_orc_unpack_RGB16_le (OrcExecutor * ORC_RESTRICT ex) } void -video_orc_unpack_RGB16_le (guint32 * ORC_RESTRICT d1, +video_orc_unpack_RGB16 (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; @@ -10508,23 +10500,23 @@ video_orc_unpack_RGB16_le (guint32 * ORC_RESTRICT d1, #if 1 static const orc_uint8 bc[] = { - 1, 9, 25, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, - 97, 99, 107, 95, 82, 71, 66, 49, 54, 95, 108, 101, 11, 4, 4, 12, - 2, 2, 14, 2, 0, 248, 0, 0, 14, 2, 224, 7, 0, 0, 14, 2, - 31, 0, 0, 0, 14, 2, 6, 0, 0, 0, 14, 2, 5, 0, 0, 0, - 14, 2, 0, 66, 0, 0, 14, 2, 128, 32, 0, 0, 14, 2, 255, 0, - 0, 0, 20, 2, 20, 2, 20, 2, 20, 2, 20, 4, 20, 4, 20, 8, - 82, 32, 4, 73, 33, 32, 16, 73, 34, 32, 17, 73, 35, 32, 18, 95, - 33, 33, 19, 93, 35, 35, 20, 90, 33, 33, 21, 90, 34, 34, 22, 90, - 35, 35, 21, 195, 36, 23, 33, 195, 37, 34, 35, 194, 38, 36, 37, 21, - 2, 160, 0, 38, 2, 0, + 1, 9, 22, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, + 97, 99, 107, 95, 82, 71, 66, 49, 54, 11, 4, 4, 12, 2, 2, 14, + 2, 0, 248, 0, 0, 14, 2, 224, 7, 0, 0, 14, 2, 31, 0, 0, + 0, 14, 2, 6, 0, 0, 0, 14, 2, 5, 0, 0, 0, 14, 2, 0, + 66, 0, 0, 14, 2, 128, 32, 0, 0, 14, 2, 255, 0, 0, 0, 20, + 2, 20, 2, 20, 2, 20, 2, 20, 4, 20, 4, 20, 8, 82, 32, 4, + 73, 33, 32, 16, 73, 34, 32, 17, 73, 35, 32, 18, 95, 33, 33, 19, + 93, 35, 35, 20, 90, 33, 33, 21, 90, 34, 34, 22, 90, 35, 35, 21, + 195, 36, 23, 33, 195, 37, 34, 35, 194, 38, 36, 37, 21, 2, 160, 0, + 38, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); - orc_program_set_backup_function (p, _backup_video_orc_unpack_RGB16_le); + orc_program_set_backup_function (p, _backup_video_orc_unpack_RGB16); #else p = orc_program_new (); - orc_program_set_name (p, "video_orc_unpack_RGB16_le"); - orc_program_set_backup_function (p, _backup_video_orc_unpack_RGB16_le); + orc_program_set_name (p, "video_orc_unpack_RGB16"); + orc_program_set_backup_function (p, _backup_video_orc_unpack_RGB16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 2, 0x0000f800, "c1"); @@ -10591,348 +10583,10 @@ video_orc_unpack_RGB16_le (guint32 * ORC_RESTRICT d1, #endif -/* video_orc_unpack_RGB16_be */ +/* video_orc_unpack_RGB16_trunc */ #ifdef DISABLE_ORC void -video_orc_unpack_RGB16_be (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n) -{ - int i; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var39; -#else - orc_union16 var39; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var40; -#else - orc_union16 var40; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var41; -#else - orc_union16 var41; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var42; -#else - orc_union16 var42; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var43; -#else - orc_union16 var43; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var44; -#else - orc_union16 var44; -#endif - orc_union32 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union16 var51; - orc_union16 var52; - orc_union16 var53; - orc_union16 var54; - orc_union32 var55; - orc_union32 var56; - orc_union64 var57; - - ptr0 = (orc_union32 *) d1; - ptr4 = (orc_union16 *) s1; - - /* 1: loadpw */ - var39.i = (int) 0x0000f800; /* 63488 or 3.13672e-319f */ - /* 3: loadpw */ - var40.i = (int) 0x000007e0; /* 2016 or 9.96036e-321f */ - /* 5: loadpw */ - var41.i = (int) 0x0000001f; /* 31 or 1.5316e-322f */ - /* 9: loadpw */ - var42.i = (int) 0x00004200; /* 16896 or 8.34773e-320f */ - /* 11: loadpw */ - var43.i = (int) 0x00002080; /* 8320 or 4.11063e-320f */ - /* 14: loadpw */ - var44.i = (int) 0x000000ff; /* 255 or 1.25987e-321f */ - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var46 = ptr4[i]; - /* 2: andw */ - var47.i = var46.i & var39.i; - /* 4: andw */ - var48.i = var46.i & var40.i; - /* 6: andw */ - var49.i = var46.i & var41.i; - /* 7: shruw */ - var50.i = ((orc_uint16) var47.i) >> 6; - /* 8: shlw */ - var51.i = ((orc_uint16) var49.i) << 5; - /* 10: mulhsw */ - var52.i = (var50.i * var42.i) >> 16; - /* 12: mulhsw */ - var53.i = (var48.i * var43.i) >> 16; - /* 13: mulhsw */ - var54.i = (var51.i * var42.i) >> 16; - /* 15: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var52.i; - _dest.x2[1] = var44.i; - var55.i = _dest.i; - } - /* 16: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var54.i; - _dest.x2[1] = var53.i; - var56.i = _dest.i; - } - /* 17: mergelq */ - { - orc_union64 _dest; - _dest.x2[0] = var56.i; - _dest.x2[1] = var55.i; - var57.i = _dest.i; - } - /* 18: convsuswb */ - var45.x4[0] = ORC_CLAMP_UB (var57.x4[0]); - var45.x4[1] = ORC_CLAMP_UB (var57.x4[1]); - var45.x4[2] = ORC_CLAMP_UB (var57.x4[2]); - var45.x4[3] = ORC_CLAMP_UB (var57.x4[3]); - /* 19: storel */ - ptr0[i] = var45; - } - -} - -#else -static void -_backup_video_orc_unpack_RGB16_be (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var39; -#else - orc_union16 var39; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var40; -#else - orc_union16 var40; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var41; -#else - orc_union16 var41; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var42; -#else - orc_union16 var42; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var43; -#else - orc_union16 var43; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var44; -#else - orc_union16 var44; -#endif - orc_union32 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union16 var51; - orc_union16 var52; - orc_union16 var53; - orc_union16 var54; - orc_union32 var55; - orc_union32 var56; - orc_union64 var57; - - ptr0 = (orc_union32 *) ex->arrays[0]; - ptr4 = (orc_union16 *) ex->arrays[4]; - - /* 1: loadpw */ - var39.i = (int) 0x0000f800; /* 63488 or 3.13672e-319f */ - /* 3: loadpw */ - var40.i = (int) 0x000007e0; /* 2016 or 9.96036e-321f */ - /* 5: loadpw */ - var41.i = (int) 0x0000001f; /* 31 or 1.5316e-322f */ - /* 9: loadpw */ - var42.i = (int) 0x00004200; /* 16896 or 8.34773e-320f */ - /* 11: loadpw */ - var43.i = (int) 0x00002080; /* 8320 or 4.11063e-320f */ - /* 14: loadpw */ - var44.i = (int) 0x000000ff; /* 255 or 1.25987e-321f */ - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var46 = ptr4[i]; - /* 2: andw */ - var47.i = var46.i & var39.i; - /* 4: andw */ - var48.i = var46.i & var40.i; - /* 6: andw */ - var49.i = var46.i & var41.i; - /* 7: shruw */ - var50.i = ((orc_uint16) var47.i) >> 6; - /* 8: shlw */ - var51.i = ((orc_uint16) var49.i) << 5; - /* 10: mulhsw */ - var52.i = (var50.i * var42.i) >> 16; - /* 12: mulhsw */ - var53.i = (var48.i * var43.i) >> 16; - /* 13: mulhsw */ - var54.i = (var51.i * var42.i) >> 16; - /* 15: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var52.i; - _dest.x2[1] = var44.i; - var55.i = _dest.i; - } - /* 16: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var54.i; - _dest.x2[1] = var53.i; - var56.i = _dest.i; - } - /* 17: mergelq */ - { - orc_union64 _dest; - _dest.x2[0] = var56.i; - _dest.x2[1] = var55.i; - var57.i = _dest.i; - } - /* 18: convsuswb */ - var45.x4[0] = ORC_CLAMP_UB (var57.x4[0]); - var45.x4[1] = ORC_CLAMP_UB (var57.x4[1]); - var45.x4[2] = ORC_CLAMP_UB (var57.x4[2]); - var45.x4[3] = ORC_CLAMP_UB (var57.x4[3]); - /* 19: storel */ - ptr0[i] = var45; - } - -} - -void -video_orc_unpack_RGB16_be (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcCode *c = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - OrcProgram *p; - -#if 1 - static const orc_uint8 bc[] = { - 1, 9, 25, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, - 97, 99, 107, 95, 82, 71, 66, 49, 54, 95, 98, 101, 11, 4, 4, 12, - 2, 2, 14, 2, 0, 248, 0, 0, 14, 2, 224, 7, 0, 0, 14, 2, - 31, 0, 0, 0, 14, 2, 6, 0, 0, 0, 14, 2, 5, 0, 0, 0, - 14, 2, 0, 66, 0, 0, 14, 2, 128, 32, 0, 0, 14, 2, 255, 0, - 0, 0, 20, 2, 20, 2, 20, 2, 20, 2, 20, 4, 20, 4, 20, 8, - 82, 32, 4, 73, 33, 32, 16, 73, 34, 32, 17, 73, 35, 32, 18, 95, - 33, 33, 19, 93, 35, 35, 20, 90, 33, 33, 21, 90, 34, 34, 22, 90, - 35, 35, 21, 195, 36, 33, 23, 195, 37, 35, 34, 194, 38, 37, 36, 21, - 2, 160, 0, 38, 2, 0, - }; - p = orc_program_new_from_static_bytecode (bc); - orc_program_set_backup_function (p, _backup_video_orc_unpack_RGB16_be); -#else - p = orc_program_new (); - orc_program_set_name (p, "video_orc_unpack_RGB16_be"); - orc_program_set_backup_function (p, _backup_video_orc_unpack_RGB16_be); - orc_program_add_destination (p, 4, "d1"); - orc_program_add_source (p, 2, "s1"); - orc_program_add_constant (p, 2, 0x0000f800, "c1"); - orc_program_add_constant (p, 2, 0x000007e0, "c2"); - orc_program_add_constant (p, 2, 0x0000001f, "c3"); - orc_program_add_constant (p, 2, 0x00000006, "c4"); - orc_program_add_constant (p, 2, 0x00000005, "c5"); - orc_program_add_constant (p, 2, 0x00004200, "c6"); - orc_program_add_constant (p, 2, 0x00002080, "c7"); - orc_program_add_constant (p, 2, 0x000000ff, "c8"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - orc_program_add_temporary (p, 2, "t3"); - orc_program_add_temporary (p, 2, "t4"); - orc_program_add_temporary (p, 4, "t5"); - orc_program_add_temporary (p, 4, "t6"); - orc_program_add_temporary (p, 8, "t7"); - - orc_program_append_2 (p, "loadw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_C3, - ORC_VAR_D1); - orc_program_append_2 (p, "shruw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C4, - ORC_VAR_D1); - orc_program_append_2 (p, "shlw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C5, - ORC_VAR_D1); - orc_program_append_2 (p, "mulhsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C6, - ORC_VAR_D1); - orc_program_append_2 (p, "mulhsw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C7, - ORC_VAR_D1); - orc_program_append_2 (p, "mulhsw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C6, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_T5, ORC_VAR_T2, ORC_VAR_C8, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_T6, ORC_VAR_T4, ORC_VAR_T3, - ORC_VAR_D1); - orc_program_append_2 (p, "mergelq", 0, ORC_VAR_T7, ORC_VAR_T6, ORC_VAR_T5, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 2, ORC_VAR_D1, ORC_VAR_T7, - ORC_VAR_D1, ORC_VAR_D1); -#endif - - orc_program_compile (p); - c = orc_program_take_code (p); - orc_program_free (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->arrays[ORC_VAR_A2] = c; - ex->program = 0; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = c->exec; - func (ex); -} -#endif - - -/* video_orc_unpack_RGB16_le_trunc */ -#ifdef DISABLE_ORC -void -video_orc_unpack_RGB16_le_trunc (guint32 * ORC_RESTRICT d1, +video_orc_unpack_RGB16_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n) { int i; @@ -11031,7 +10685,7 @@ video_orc_unpack_RGB16_le_trunc (guint32 * ORC_RESTRICT d1, #else static void -_backup_video_orc_unpack_RGB16_le_trunc (OrcExecutor * ORC_RESTRICT ex) +_backup_video_orc_unpack_RGB16_trunc (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; @@ -11129,7 +10783,7 @@ _backup_video_orc_unpack_RGB16_le_trunc (OrcExecutor * ORC_RESTRICT ex) } void -video_orc_unpack_RGB16_le_trunc (guint32 * ORC_RESTRICT d1, +video_orc_unpack_RGB16_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; @@ -11144,24 +10798,22 @@ video_orc_unpack_RGB16_le_trunc (guint32 * ORC_RESTRICT d1, #if 1 static const orc_uint8 bc[] = { - 1, 9, 31, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, - 97, 99, 107, 95, 82, 71, 66, 49, 54, 95, 108, 101, 95, 116, 114, 117, - 110, 99, 11, 4, 4, 12, 2, 2, 14, 2, 0, 248, 0, 0, 14, 2, - 224, 7, 0, 0, 14, 2, 31, 0, 0, 0, 14, 2, 8, 0, 0, 0, - 14, 2, 3, 0, 0, 0, 14, 2, 255, 0, 0, 0, 20, 2, 20, 2, - 20, 2, 20, 2, 20, 4, 20, 4, 20, 8, 82, 32, 4, 73, 33, 32, - 16, 73, 34, 32, 17, 73, 35, 32, 18, 95, 33, 33, 19, 95, 34, 34, - 20, 93, 35, 35, 20, 195, 36, 21, 33, 195, 37, 34, 35, 194, 38, 36, - 37, 21, 2, 160, 0, 38, 2, 0, + 1, 9, 28, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, + 97, 99, 107, 95, 82, 71, 66, 49, 54, 95, 116, 114, 117, 110, 99, 11, + 4, 4, 12, 2, 2, 14, 2, 0, 248, 0, 0, 14, 2, 224, 7, 0, + 0, 14, 2, 31, 0, 0, 0, 14, 2, 8, 0, 0, 0, 14, 2, 3, + 0, 0, 0, 14, 2, 255, 0, 0, 0, 20, 2, 20, 2, 20, 2, 20, + 2, 20, 4, 20, 4, 20, 8, 82, 32, 4, 73, 33, 32, 16, 73, 34, + 32, 17, 73, 35, 32, 18, 95, 33, 33, 19, 95, 34, 34, 20, 93, 35, + 35, 20, 195, 36, 21, 33, 195, 37, 34, 35, 194, 38, 36, 37, 21, 2, + 160, 0, 38, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); - orc_program_set_backup_function (p, - _backup_video_orc_unpack_RGB16_le_trunc); + orc_program_set_backup_function (p, _backup_video_orc_unpack_RGB16_trunc); #else p = orc_program_new (); - orc_program_set_name (p, "video_orc_unpack_RGB16_le_trunc"); - orc_program_set_backup_function (p, - _backup_video_orc_unpack_RGB16_le_trunc); + orc_program_set_name (p, "video_orc_unpack_RGB16_trunc"); + orc_program_set_backup_function (p, _backup_video_orc_unpack_RGB16_trunc); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 2, 0x0000f800, "c1"); @@ -11222,299 +10874,6 @@ video_orc_unpack_RGB16_le_trunc (guint32 * ORC_RESTRICT d1, #endif -/* video_orc_unpack_RGB16_be_trunc */ -#ifdef DISABLE_ORC -void -video_orc_unpack_RGB16_be_trunc (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n) -{ - int i; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var39; -#else - orc_union16 var39; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var40; -#else - orc_union16 var40; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var41; -#else - orc_union16 var41; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var42; -#else - orc_union16 var42; -#endif - orc_union32 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union32 var51; - orc_union32 var52; - orc_union64 var53; - - ptr0 = (orc_union32 *) d1; - ptr4 = (orc_union16 *) s1; - - /* 1: loadpw */ - var39.i = (int) 0x0000f800; /* 63488 or 3.13672e-319f */ - /* 3: loadpw */ - var40.i = (int) 0x000007e0; /* 2016 or 9.96036e-321f */ - /* 5: loadpw */ - var41.i = (int) 0x0000001f; /* 31 or 1.5316e-322f */ - /* 10: loadpw */ - var42.i = (int) 0x000000ff; /* 255 or 1.25987e-321f */ - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var44 = ptr4[i]; - /* 2: andw */ - var45.i = var44.i & var39.i; - /* 4: andw */ - var46.i = var44.i & var40.i; - /* 6: andw */ - var47.i = var44.i & var41.i; - /* 7: shruw */ - var48.i = ((orc_uint16) var45.i) >> 8; - /* 8: shruw */ - var49.i = ((orc_uint16) var46.i) >> 3; - /* 9: shlw */ - var50.i = ((orc_uint16) var47.i) << 3; - /* 11: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var48.i; - _dest.x2[1] = var42.i; - var51.i = _dest.i; - } - /* 12: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var50.i; - _dest.x2[1] = var49.i; - var52.i = _dest.i; - } - /* 13: mergelq */ - { - orc_union64 _dest; - _dest.x2[0] = var52.i; - _dest.x2[1] = var51.i; - var53.i = _dest.i; - } - /* 14: convsuswb */ - var43.x4[0] = ORC_CLAMP_UB (var53.x4[0]); - var43.x4[1] = ORC_CLAMP_UB (var53.x4[1]); - var43.x4[2] = ORC_CLAMP_UB (var53.x4[2]); - var43.x4[3] = ORC_CLAMP_UB (var53.x4[3]); - /* 15: storel */ - ptr0[i] = var43; - } - -} - -#else -static void -_backup_video_orc_unpack_RGB16_be_trunc (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var39; -#else - orc_union16 var39; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var40; -#else - orc_union16 var40; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var41; -#else - orc_union16 var41; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var42; -#else - orc_union16 var42; -#endif - orc_union32 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union32 var51; - orc_union32 var52; - orc_union64 var53; - - ptr0 = (orc_union32 *) ex->arrays[0]; - ptr4 = (orc_union16 *) ex->arrays[4]; - - /* 1: loadpw */ - var39.i = (int) 0x0000f800; /* 63488 or 3.13672e-319f */ - /* 3: loadpw */ - var40.i = (int) 0x000007e0; /* 2016 or 9.96036e-321f */ - /* 5: loadpw */ - var41.i = (int) 0x0000001f; /* 31 or 1.5316e-322f */ - /* 10: loadpw */ - var42.i = (int) 0x000000ff; /* 255 or 1.25987e-321f */ - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var44 = ptr4[i]; - /* 2: andw */ - var45.i = var44.i & var39.i; - /* 4: andw */ - var46.i = var44.i & var40.i; - /* 6: andw */ - var47.i = var44.i & var41.i; - /* 7: shruw */ - var48.i = ((orc_uint16) var45.i) >> 8; - /* 8: shruw */ - var49.i = ((orc_uint16) var46.i) >> 3; - /* 9: shlw */ - var50.i = ((orc_uint16) var47.i) << 3; - /* 11: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var48.i; - _dest.x2[1] = var42.i; - var51.i = _dest.i; - } - /* 12: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var50.i; - _dest.x2[1] = var49.i; - var52.i = _dest.i; - } - /* 13: mergelq */ - { - orc_union64 _dest; - _dest.x2[0] = var52.i; - _dest.x2[1] = var51.i; - var53.i = _dest.i; - } - /* 14: convsuswb */ - var43.x4[0] = ORC_CLAMP_UB (var53.x4[0]); - var43.x4[1] = ORC_CLAMP_UB (var53.x4[1]); - var43.x4[2] = ORC_CLAMP_UB (var53.x4[2]); - var43.x4[3] = ORC_CLAMP_UB (var53.x4[3]); - /* 15: storel */ - ptr0[i] = var43; - } - -} - -void -video_orc_unpack_RGB16_be_trunc (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcCode *c = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - OrcProgram *p; - -#if 1 - static const orc_uint8 bc[] = { - 1, 9, 31, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, - 97, 99, 107, 95, 82, 71, 66, 49, 54, 95, 98, 101, 95, 116, 114, 117, - 110, 99, 11, 4, 4, 12, 2, 2, 14, 2, 0, 248, 0, 0, 14, 2, - 224, 7, 0, 0, 14, 2, 31, 0, 0, 0, 14, 2, 8, 0, 0, 0, - 14, 2, 3, 0, 0, 0, 14, 2, 255, 0, 0, 0, 20, 2, 20, 2, - 20, 2, 20, 2, 20, 4, 20, 4, 20, 8, 82, 32, 4, 73, 33, 32, - 16, 73, 34, 32, 17, 73, 35, 32, 18, 95, 33, 33, 19, 95, 34, 34, - 20, 93, 35, 35, 20, 195, 36, 33, 21, 195, 37, 35, 34, 194, 38, 37, - 36, 21, 2, 160, 0, 38, 2, 0, - }; - p = orc_program_new_from_static_bytecode (bc); - orc_program_set_backup_function (p, - _backup_video_orc_unpack_RGB16_be_trunc); -#else - p = orc_program_new (); - orc_program_set_name (p, "video_orc_unpack_RGB16_be_trunc"); - orc_program_set_backup_function (p, - _backup_video_orc_unpack_RGB16_be_trunc); - orc_program_add_destination (p, 4, "d1"); - orc_program_add_source (p, 2, "s1"); - orc_program_add_constant (p, 2, 0x0000f800, "c1"); - orc_program_add_constant (p, 2, 0x000007e0, "c2"); - orc_program_add_constant (p, 2, 0x0000001f, "c3"); - orc_program_add_constant (p, 2, 0x00000008, "c4"); - orc_program_add_constant (p, 2, 0x00000003, "c5"); - orc_program_add_constant (p, 2, 0x000000ff, "c6"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - orc_program_add_temporary (p, 2, "t3"); - orc_program_add_temporary (p, 2, "t4"); - orc_program_add_temporary (p, 4, "t5"); - orc_program_add_temporary (p, 4, "t6"); - orc_program_add_temporary (p, 8, "t7"); - - orc_program_append_2 (p, "loadw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_C3, - ORC_VAR_D1); - orc_program_append_2 (p, "shruw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C4, - ORC_VAR_D1); - orc_program_append_2 (p, "shruw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C5, - ORC_VAR_D1); - orc_program_append_2 (p, "shlw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C5, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_T5, ORC_VAR_T2, ORC_VAR_C6, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_T6, ORC_VAR_T4, ORC_VAR_T3, - ORC_VAR_D1); - orc_program_append_2 (p, "mergelq", 0, ORC_VAR_T7, ORC_VAR_T6, ORC_VAR_T5, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 2, ORC_VAR_D1, ORC_VAR_T7, - ORC_VAR_D1, ORC_VAR_D1); -#endif - - orc_program_compile (p); - c = orc_program_take_code (p); - orc_program_free (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->arrays[ORC_VAR_A2] = c; - ex->program = 0; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = c->exec; - func (ex); -} -#endif - - /* video_orc_pack_RGB16_le */ #ifdef DISABLE_ORC void @@ -11807,11 +11166,11 @@ video_orc_pack_RGB16_be (guint16 * ORC_RESTRICT d1, var48.i = var45.i | var46.i; /* 11: orl */ var49.i = var48.i | var47.i; - /* 12: select0lw */ + /* 12: select1lw */ { orc_union32 _src; _src.i = var49.i; - var40.i = _src.x2[0]; + var40.i = _src.x2[1]; } /* 13: storew */ ptr0[i] = var40; @@ -11882,11 +11241,11 @@ _backup_video_orc_pack_RGB16_be (OrcExecutor * ORC_RESTRICT ex) var48.i = var45.i | var46.i; /* 11: orl */ var49.i = var48.i | var47.i; - /* 12: select0lw */ + /* 12: select1lw */ { orc_union32 _src; _src.i = var49.i; - var40.i = _src.x2[0]; + var40.i = _src.x2[1]; } /* 13: storew */ ptr0[i] = var40; @@ -11917,7 +11276,7 @@ video_orc_pack_RGB16_be (guint16 * ORC_RESTRICT d1, 3, 0, 0, 0, 20, 4, 20, 4, 20, 4, 20, 4, 20, 4, 113, 32, 4, 106, 33, 32, 16, 106, 34, 32, 17, 106, 35, 32, 18, 126, 33, 33, 19, 126, 34, 34, 20, 126, 35, 35, 21, 123, 36, 33, 34, 123, 36, 36, - 35, 190, 0, 36, 2, 0, + 35, 191, 0, 36, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_video_orc_pack_RGB16_be); @@ -11957,7 +11316,7 @@ video_orc_pack_RGB16_be (guint16 * ORC_RESTRICT d1, ORC_VAR_D1); orc_program_append_2 (p, "orl", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1); - orc_program_append_2 (p, "select0lw", 0, ORC_VAR_D1, ORC_VAR_T5, + orc_program_append_2 (p, "select1lw", 0, ORC_VAR_D1, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); #endif @@ -11981,10 +11340,10 @@ video_orc_pack_RGB16_be (guint16 * ORC_RESTRICT d1, #endif -/* video_orc_unpack_BGR16_le */ +/* video_orc_unpack_BGR16 */ #ifdef DISABLE_ORC void -video_orc_unpack_BGR16_le (guint32 * ORC_RESTRICT d1, +video_orc_unpack_BGR16 (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n) { int i; @@ -12103,7 +11462,7 @@ video_orc_unpack_BGR16_le (guint32 * ORC_RESTRICT d1, #else static void -_backup_video_orc_unpack_BGR16_le (OrcExecutor * ORC_RESTRICT ex) +_backup_video_orc_unpack_BGR16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; @@ -12221,7 +11580,7 @@ _backup_video_orc_unpack_BGR16_le (OrcExecutor * ORC_RESTRICT ex) } void -video_orc_unpack_BGR16_le (guint32 * ORC_RESTRICT d1, +video_orc_unpack_BGR16 (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; @@ -12236,23 +11595,23 @@ video_orc_unpack_BGR16_le (guint32 * ORC_RESTRICT d1, #if 1 static const orc_uint8 bc[] = { - 1, 9, 25, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, - 97, 99, 107, 95, 66, 71, 82, 49, 54, 95, 108, 101, 11, 4, 4, 12, - 2, 2, 14, 2, 0, 248, 0, 0, 14, 2, 224, 7, 0, 0, 14, 2, - 31, 0, 0, 0, 14, 2, 6, 0, 0, 0, 14, 2, 5, 0, 0, 0, - 14, 2, 0, 66, 0, 0, 14, 2, 128, 32, 0, 0, 14, 2, 255, 0, - 0, 0, 20, 2, 20, 2, 20, 2, 20, 2, 20, 4, 20, 4, 20, 8, - 82, 32, 4, 73, 35, 32, 16, 73, 34, 32, 17, 73, 33, 32, 18, 95, - 35, 35, 19, 93, 33, 33, 20, 90, 35, 35, 21, 90, 34, 34, 22, 90, - 33, 33, 21, 195, 36, 23, 33, 195, 37, 34, 35, 194, 38, 36, 37, 21, - 2, 160, 0, 38, 2, 0, + 1, 9, 22, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, + 97, 99, 107, 95, 66, 71, 82, 49, 54, 11, 4, 4, 12, 2, 2, 14, + 2, 0, 248, 0, 0, 14, 2, 224, 7, 0, 0, 14, 2, 31, 0, 0, + 0, 14, 2, 6, 0, 0, 0, 14, 2, 5, 0, 0, 0, 14, 2, 0, + 66, 0, 0, 14, 2, 128, 32, 0, 0, 14, 2, 255, 0, 0, 0, 20, + 2, 20, 2, 20, 2, 20, 2, 20, 4, 20, 4, 20, 8, 82, 32, 4, + 73, 35, 32, 16, 73, 34, 32, 17, 73, 33, 32, 18, 95, 35, 35, 19, + 93, 33, 33, 20, 90, 35, 35, 21, 90, 34, 34, 22, 90, 33, 33, 21, + 195, 36, 23, 33, 195, 37, 34, 35, 194, 38, 36, 37, 21, 2, 160, 0, + 38, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); - orc_program_set_backup_function (p, _backup_video_orc_unpack_BGR16_le); + orc_program_set_backup_function (p, _backup_video_orc_unpack_BGR16); #else p = orc_program_new (); - orc_program_set_name (p, "video_orc_unpack_BGR16_le"); - orc_program_set_backup_function (p, _backup_video_orc_unpack_BGR16_le); + orc_program_set_name (p, "video_orc_unpack_BGR16"); + orc_program_set_backup_function (p, _backup_video_orc_unpack_BGR16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 2, 0x0000f800, "c1"); @@ -12319,348 +11678,10 @@ video_orc_unpack_BGR16_le (guint32 * ORC_RESTRICT d1, #endif -/* video_orc_unpack_BGR16_be */ +/* video_orc_unpack_BGR16_trunc */ #ifdef DISABLE_ORC void -video_orc_unpack_BGR16_be (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n) -{ - int i; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var39; -#else - orc_union16 var39; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var40; -#else - orc_union16 var40; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var41; -#else - orc_union16 var41; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var42; -#else - orc_union16 var42; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var43; -#else - orc_union16 var43; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var44; -#else - orc_union16 var44; -#endif - orc_union32 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union16 var51; - orc_union16 var52; - orc_union16 var53; - orc_union16 var54; - orc_union32 var55; - orc_union32 var56; - orc_union64 var57; - - ptr0 = (orc_union32 *) d1; - ptr4 = (orc_union16 *) s1; - - /* 1: loadpw */ - var39.i = (int) 0x0000f800; /* 63488 or 3.13672e-319f */ - /* 3: loadpw */ - var40.i = (int) 0x000007e0; /* 2016 or 9.96036e-321f */ - /* 5: loadpw */ - var41.i = (int) 0x0000001f; /* 31 or 1.5316e-322f */ - /* 9: loadpw */ - var42.i = (int) 0x00004200; /* 16896 or 8.34773e-320f */ - /* 11: loadpw */ - var43.i = (int) 0x00002080; /* 8320 or 4.11063e-320f */ - /* 14: loadpw */ - var44.i = (int) 0x000000ff; /* 255 or 1.25987e-321f */ - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var46 = ptr4[i]; - /* 2: andw */ - var47.i = var46.i & var39.i; - /* 4: andw */ - var48.i = var46.i & var40.i; - /* 6: andw */ - var49.i = var46.i & var41.i; - /* 7: shruw */ - var50.i = ((orc_uint16) var47.i) >> 6; - /* 8: shlw */ - var51.i = ((orc_uint16) var49.i) << 5; - /* 10: mulhsw */ - var52.i = (var50.i * var42.i) >> 16; - /* 12: mulhsw */ - var53.i = (var48.i * var43.i) >> 16; - /* 13: mulhsw */ - var54.i = (var51.i * var42.i) >> 16; - /* 15: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var54.i; - _dest.x2[1] = var44.i; - var55.i = _dest.i; - } - /* 16: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var52.i; - _dest.x2[1] = var53.i; - var56.i = _dest.i; - } - /* 17: mergelq */ - { - orc_union64 _dest; - _dest.x2[0] = var56.i; - _dest.x2[1] = var55.i; - var57.i = _dest.i; - } - /* 18: convsuswb */ - var45.x4[0] = ORC_CLAMP_UB (var57.x4[0]); - var45.x4[1] = ORC_CLAMP_UB (var57.x4[1]); - var45.x4[2] = ORC_CLAMP_UB (var57.x4[2]); - var45.x4[3] = ORC_CLAMP_UB (var57.x4[3]); - /* 19: storel */ - ptr0[i] = var45; - } - -} - -#else -static void -_backup_video_orc_unpack_BGR16_be (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var39; -#else - orc_union16 var39; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var40; -#else - orc_union16 var40; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var41; -#else - orc_union16 var41; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var42; -#else - orc_union16 var42; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var43; -#else - orc_union16 var43; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var44; -#else - orc_union16 var44; -#endif - orc_union32 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union16 var51; - orc_union16 var52; - orc_union16 var53; - orc_union16 var54; - orc_union32 var55; - orc_union32 var56; - orc_union64 var57; - - ptr0 = (orc_union32 *) ex->arrays[0]; - ptr4 = (orc_union16 *) ex->arrays[4]; - - /* 1: loadpw */ - var39.i = (int) 0x0000f800; /* 63488 or 3.13672e-319f */ - /* 3: loadpw */ - var40.i = (int) 0x000007e0; /* 2016 or 9.96036e-321f */ - /* 5: loadpw */ - var41.i = (int) 0x0000001f; /* 31 or 1.5316e-322f */ - /* 9: loadpw */ - var42.i = (int) 0x00004200; /* 16896 or 8.34773e-320f */ - /* 11: loadpw */ - var43.i = (int) 0x00002080; /* 8320 or 4.11063e-320f */ - /* 14: loadpw */ - var44.i = (int) 0x000000ff; /* 255 or 1.25987e-321f */ - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var46 = ptr4[i]; - /* 2: andw */ - var47.i = var46.i & var39.i; - /* 4: andw */ - var48.i = var46.i & var40.i; - /* 6: andw */ - var49.i = var46.i & var41.i; - /* 7: shruw */ - var50.i = ((orc_uint16) var47.i) >> 6; - /* 8: shlw */ - var51.i = ((orc_uint16) var49.i) << 5; - /* 10: mulhsw */ - var52.i = (var50.i * var42.i) >> 16; - /* 12: mulhsw */ - var53.i = (var48.i * var43.i) >> 16; - /* 13: mulhsw */ - var54.i = (var51.i * var42.i) >> 16; - /* 15: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var54.i; - _dest.x2[1] = var44.i; - var55.i = _dest.i; - } - /* 16: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var52.i; - _dest.x2[1] = var53.i; - var56.i = _dest.i; - } - /* 17: mergelq */ - { - orc_union64 _dest; - _dest.x2[0] = var56.i; - _dest.x2[1] = var55.i; - var57.i = _dest.i; - } - /* 18: convsuswb */ - var45.x4[0] = ORC_CLAMP_UB (var57.x4[0]); - var45.x4[1] = ORC_CLAMP_UB (var57.x4[1]); - var45.x4[2] = ORC_CLAMP_UB (var57.x4[2]); - var45.x4[3] = ORC_CLAMP_UB (var57.x4[3]); - /* 19: storel */ - ptr0[i] = var45; - } - -} - -void -video_orc_unpack_BGR16_be (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcCode *c = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - OrcProgram *p; - -#if 1 - static const orc_uint8 bc[] = { - 1, 9, 25, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, - 97, 99, 107, 95, 66, 71, 82, 49, 54, 95, 98, 101, 11, 4, 4, 12, - 2, 2, 14, 2, 0, 248, 0, 0, 14, 2, 224, 7, 0, 0, 14, 2, - 31, 0, 0, 0, 14, 2, 6, 0, 0, 0, 14, 2, 5, 0, 0, 0, - 14, 2, 0, 66, 0, 0, 14, 2, 128, 32, 0, 0, 14, 2, 255, 0, - 0, 0, 20, 2, 20, 2, 20, 2, 20, 2, 20, 4, 20, 4, 20, 8, - 82, 32, 4, 73, 35, 32, 16, 73, 34, 32, 17, 73, 33, 32, 18, 95, - 35, 35, 19, 93, 33, 33, 20, 90, 35, 35, 21, 90, 34, 34, 22, 90, - 33, 33, 21, 195, 36, 33, 23, 195, 37, 35, 34, 194, 38, 37, 36, 21, - 2, 160, 0, 38, 2, 0, - }; - p = orc_program_new_from_static_bytecode (bc); - orc_program_set_backup_function (p, _backup_video_orc_unpack_BGR16_be); -#else - p = orc_program_new (); - orc_program_set_name (p, "video_orc_unpack_BGR16_be"); - orc_program_set_backup_function (p, _backup_video_orc_unpack_BGR16_be); - orc_program_add_destination (p, 4, "d1"); - orc_program_add_source (p, 2, "s1"); - orc_program_add_constant (p, 2, 0x0000f800, "c1"); - orc_program_add_constant (p, 2, 0x000007e0, "c2"); - orc_program_add_constant (p, 2, 0x0000001f, "c3"); - orc_program_add_constant (p, 2, 0x00000006, "c4"); - orc_program_add_constant (p, 2, 0x00000005, "c5"); - orc_program_add_constant (p, 2, 0x00004200, "c6"); - orc_program_add_constant (p, 2, 0x00002080, "c7"); - orc_program_add_constant (p, 2, 0x000000ff, "c8"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - orc_program_add_temporary (p, 2, "t3"); - orc_program_add_temporary (p, 2, "t4"); - orc_program_add_temporary (p, 4, "t5"); - orc_program_add_temporary (p, 4, "t6"); - orc_program_add_temporary (p, 8, "t7"); - - orc_program_append_2 (p, "loadw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_C3, - ORC_VAR_D1); - orc_program_append_2 (p, "shruw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C4, - ORC_VAR_D1); - orc_program_append_2 (p, "shlw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C5, - ORC_VAR_D1); - orc_program_append_2 (p, "mulhsw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C6, - ORC_VAR_D1); - orc_program_append_2 (p, "mulhsw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C7, - ORC_VAR_D1); - orc_program_append_2 (p, "mulhsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C6, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_T5, ORC_VAR_T2, ORC_VAR_C8, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_T6, ORC_VAR_T4, ORC_VAR_T3, - ORC_VAR_D1); - orc_program_append_2 (p, "mergelq", 0, ORC_VAR_T7, ORC_VAR_T6, ORC_VAR_T5, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 2, ORC_VAR_D1, ORC_VAR_T7, - ORC_VAR_D1, ORC_VAR_D1); -#endif - - orc_program_compile (p); - c = orc_program_take_code (p); - orc_program_free (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->arrays[ORC_VAR_A2] = c; - ex->program = 0; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = c->exec; - func (ex); -} -#endif - - -/* video_orc_unpack_BGR16_le_trunc */ -#ifdef DISABLE_ORC -void -video_orc_unpack_BGR16_le_trunc (guint32 * ORC_RESTRICT d1, +video_orc_unpack_BGR16_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n) { int i; @@ -12759,7 +11780,7 @@ video_orc_unpack_BGR16_le_trunc (guint32 * ORC_RESTRICT d1, #else static void -_backup_video_orc_unpack_BGR16_le_trunc (OrcExecutor * ORC_RESTRICT ex) +_backup_video_orc_unpack_BGR16_trunc (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; @@ -12857,7 +11878,7 @@ _backup_video_orc_unpack_BGR16_le_trunc (OrcExecutor * ORC_RESTRICT ex) } void -video_orc_unpack_BGR16_le_trunc (guint32 * ORC_RESTRICT d1, +video_orc_unpack_BGR16_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; @@ -12872,24 +11893,22 @@ video_orc_unpack_BGR16_le_trunc (guint32 * ORC_RESTRICT d1, #if 1 static const orc_uint8 bc[] = { - 1, 9, 31, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, - 97, 99, 107, 95, 66, 71, 82, 49, 54, 95, 108, 101, 95, 116, 114, 117, - 110, 99, 11, 4, 4, 12, 2, 2, 14, 2, 0, 248, 0, 0, 14, 2, - 224, 7, 0, 0, 14, 2, 31, 0, 0, 0, 14, 2, 8, 0, 0, 0, - 14, 2, 3, 0, 0, 0, 14, 2, 255, 0, 0, 0, 20, 2, 20, 2, - 20, 2, 20, 2, 20, 4, 20, 4, 20, 8, 82, 32, 4, 73, 35, 32, - 16, 73, 34, 32, 17, 73, 33, 32, 18, 95, 35, 35, 19, 95, 34, 34, - 20, 93, 33, 33, 20, 195, 36, 21, 33, 195, 37, 34, 35, 194, 38, 36, - 37, 21, 2, 160, 0, 38, 2, 0, + 1, 9, 28, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, + 97, 99, 107, 95, 66, 71, 82, 49, 54, 95, 116, 114, 117, 110, 99, 11, + 4, 4, 12, 2, 2, 14, 2, 0, 248, 0, 0, 14, 2, 224, 7, 0, + 0, 14, 2, 31, 0, 0, 0, 14, 2, 8, 0, 0, 0, 14, 2, 3, + 0, 0, 0, 14, 2, 255, 0, 0, 0, 20, 2, 20, 2, 20, 2, 20, + 2, 20, 4, 20, 4, 20, 8, 82, 32, 4, 73, 35, 32, 16, 73, 34, + 32, 17, 73, 33, 32, 18, 95, 35, 35, 19, 95, 34, 34, 20, 93, 33, + 33, 20, 195, 36, 21, 33, 195, 37, 34, 35, 194, 38, 36, 37, 21, 2, + 160, 0, 38, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); - orc_program_set_backup_function (p, - _backup_video_orc_unpack_BGR16_le_trunc); + orc_program_set_backup_function (p, _backup_video_orc_unpack_BGR16_trunc); #else p = orc_program_new (); - orc_program_set_name (p, "video_orc_unpack_BGR16_le_trunc"); - orc_program_set_backup_function (p, - _backup_video_orc_unpack_BGR16_le_trunc); + orc_program_set_name (p, "video_orc_unpack_BGR16_trunc"); + orc_program_set_backup_function (p, _backup_video_orc_unpack_BGR16_trunc); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 2, 0x0000f800, "c1"); @@ -12950,299 +11969,6 @@ video_orc_unpack_BGR16_le_trunc (guint32 * ORC_RESTRICT d1, #endif -/* video_orc_unpack_BGR16_be_trunc */ -#ifdef DISABLE_ORC -void -video_orc_unpack_BGR16_be_trunc (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n) -{ - int i; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var39; -#else - orc_union16 var39; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var40; -#else - orc_union16 var40; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var41; -#else - orc_union16 var41; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var42; -#else - orc_union16 var42; -#endif - orc_union32 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union32 var51; - orc_union32 var52; - orc_union64 var53; - - ptr0 = (orc_union32 *) d1; - ptr4 = (orc_union16 *) s1; - - /* 1: loadpw */ - var39.i = (int) 0x0000f800; /* 63488 or 3.13672e-319f */ - /* 3: loadpw */ - var40.i = (int) 0x000007e0; /* 2016 or 9.96036e-321f */ - /* 5: loadpw */ - var41.i = (int) 0x0000001f; /* 31 or 1.5316e-322f */ - /* 10: loadpw */ - var42.i = (int) 0x000000ff; /* 255 or 1.25987e-321f */ - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var44 = ptr4[i]; - /* 2: andw */ - var45.i = var44.i & var39.i; - /* 4: andw */ - var46.i = var44.i & var40.i; - /* 6: andw */ - var47.i = var44.i & var41.i; - /* 7: shruw */ - var48.i = ((orc_uint16) var45.i) >> 8; - /* 8: shruw */ - var49.i = ((orc_uint16) var46.i) >> 3; - /* 9: shlw */ - var50.i = ((orc_uint16) var47.i) << 3; - /* 11: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var50.i; - _dest.x2[1] = var42.i; - var51.i = _dest.i; - } - /* 12: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var48.i; - _dest.x2[1] = var49.i; - var52.i = _dest.i; - } - /* 13: mergelq */ - { - orc_union64 _dest; - _dest.x2[0] = var52.i; - _dest.x2[1] = var51.i; - var53.i = _dest.i; - } - /* 14: convsuswb */ - var43.x4[0] = ORC_CLAMP_UB (var53.x4[0]); - var43.x4[1] = ORC_CLAMP_UB (var53.x4[1]); - var43.x4[2] = ORC_CLAMP_UB (var53.x4[2]); - var43.x4[3] = ORC_CLAMP_UB (var53.x4[3]); - /* 15: storel */ - ptr0[i] = var43; - } - -} - -#else -static void -_backup_video_orc_unpack_BGR16_be_trunc (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var39; -#else - orc_union16 var39; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var40; -#else - orc_union16 var40; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var41; -#else - orc_union16 var41; -#endif -#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) - volatile orc_union16 var42; -#else - orc_union16 var42; -#endif - orc_union32 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union32 var51; - orc_union32 var52; - orc_union64 var53; - - ptr0 = (orc_union32 *) ex->arrays[0]; - ptr4 = (orc_union16 *) ex->arrays[4]; - - /* 1: loadpw */ - var39.i = (int) 0x0000f800; /* 63488 or 3.13672e-319f */ - /* 3: loadpw */ - var40.i = (int) 0x000007e0; /* 2016 or 9.96036e-321f */ - /* 5: loadpw */ - var41.i = (int) 0x0000001f; /* 31 or 1.5316e-322f */ - /* 10: loadpw */ - var42.i = (int) 0x000000ff; /* 255 or 1.25987e-321f */ - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var44 = ptr4[i]; - /* 2: andw */ - var45.i = var44.i & var39.i; - /* 4: andw */ - var46.i = var44.i & var40.i; - /* 6: andw */ - var47.i = var44.i & var41.i; - /* 7: shruw */ - var48.i = ((orc_uint16) var45.i) >> 8; - /* 8: shruw */ - var49.i = ((orc_uint16) var46.i) >> 3; - /* 9: shlw */ - var50.i = ((orc_uint16) var47.i) << 3; - /* 11: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var50.i; - _dest.x2[1] = var42.i; - var51.i = _dest.i; - } - /* 12: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var48.i; - _dest.x2[1] = var49.i; - var52.i = _dest.i; - } - /* 13: mergelq */ - { - orc_union64 _dest; - _dest.x2[0] = var52.i; - _dest.x2[1] = var51.i; - var53.i = _dest.i; - } - /* 14: convsuswb */ - var43.x4[0] = ORC_CLAMP_UB (var53.x4[0]); - var43.x4[1] = ORC_CLAMP_UB (var53.x4[1]); - var43.x4[2] = ORC_CLAMP_UB (var53.x4[2]); - var43.x4[3] = ORC_CLAMP_UB (var53.x4[3]); - /* 15: storel */ - ptr0[i] = var43; - } - -} - -void -video_orc_unpack_BGR16_be_trunc (guint32 * ORC_RESTRICT d1, - const guint16 * ORC_RESTRICT s1, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcCode *c = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - OrcProgram *p; - -#if 1 - static const orc_uint8 bc[] = { - 1, 9, 31, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112, - 97, 99, 107, 95, 66, 71, 82, 49, 54, 95, 98, 101, 95, 116, 114, 117, - 110, 99, 11, 4, 4, 12, 2, 2, 14, 2, 0, 248, 0, 0, 14, 2, - 224, 7, 0, 0, 14, 2, 31, 0, 0, 0, 14, 2, 8, 0, 0, 0, - 14, 2, 3, 0, 0, 0, 14, 2, 255, 0, 0, 0, 20, 2, 20, 2, - 20, 2, 20, 2, 20, 4, 20, 4, 20, 8, 82, 32, 4, 73, 35, 32, - 16, 73, 34, 32, 17, 73, 33, 32, 18, 95, 35, 35, 19, 95, 34, 34, - 20, 93, 33, 33, 20, 195, 36, 33, 21, 195, 37, 35, 34, 194, 38, 37, - 36, 21, 2, 160, 0, 38, 2, 0, - }; - p = orc_program_new_from_static_bytecode (bc); - orc_program_set_backup_function (p, - _backup_video_orc_unpack_BGR16_be_trunc); -#else - p = orc_program_new (); - orc_program_set_name (p, "video_orc_unpack_BGR16_be_trunc"); - orc_program_set_backup_function (p, - _backup_video_orc_unpack_BGR16_be_trunc); - orc_program_add_destination (p, 4, "d1"); - orc_program_add_source (p, 2, "s1"); - orc_program_add_constant (p, 2, 0x0000f800, "c1"); - orc_program_add_constant (p, 2, 0x000007e0, "c2"); - orc_program_add_constant (p, 2, 0x0000001f, "c3"); - orc_program_add_constant (p, 2, 0x00000008, "c4"); - orc_program_add_constant (p, 2, 0x00000003, "c5"); - orc_program_add_constant (p, 2, 0x000000ff, "c6"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - orc_program_add_temporary (p, 2, "t3"); - orc_program_add_temporary (p, 2, "t4"); - orc_program_add_temporary (p, 4, "t5"); - orc_program_add_temporary (p, 4, "t6"); - orc_program_add_temporary (p, 8, "t7"); - - orc_program_append_2 (p, "loadw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "andw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_C3, - ORC_VAR_D1); - orc_program_append_2 (p, "shruw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C4, - ORC_VAR_D1); - orc_program_append_2 (p, "shruw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C5, - ORC_VAR_D1); - orc_program_append_2 (p, "shlw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C5, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_T5, ORC_VAR_T2, ORC_VAR_C6, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_T6, ORC_VAR_T4, ORC_VAR_T3, - ORC_VAR_D1); - orc_program_append_2 (p, "mergelq", 0, ORC_VAR_T7, ORC_VAR_T6, ORC_VAR_T5, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 2, ORC_VAR_D1, ORC_VAR_T7, - ORC_VAR_D1, ORC_VAR_D1); -#endif - - orc_program_compile (p); - c = orc_program_take_code (p); - orc_program_free (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->arrays[ORC_VAR_A2] = c; - ex->program = 0; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = c->exec; - func (ex); -} -#endif - - /* video_orc_pack_BGR16_le */ #ifdef DISABLE_ORC void @@ -13545,11 +12271,11 @@ video_orc_pack_BGR16_be (guint16 * ORC_RESTRICT d1, var48.i = var47.i | var46.i; /* 11: orl */ var49.i = var48.i | var45.i; - /* 12: select0lw */ + /* 12: select1lw */ { orc_union32 _src; _src.i = var49.i; - var40.i = _src.x2[0]; + var40.i = _src.x2[1]; } /* 13: storew */ ptr0[i] = var40; @@ -13620,11 +12346,11 @@ _backup_video_orc_pack_BGR16_be (OrcExecutor * ORC_RESTRICT ex) var48.i = var47.i | var46.i; /* 11: orl */ var49.i = var48.i | var45.i; - /* 12: select0lw */ + /* 12: select1lw */ { orc_union32 _src; _src.i = var49.i; - var40.i = _src.x2[0]; + var40.i = _src.x2[1]; } /* 13: storew */ ptr0[i] = var40; @@ -13655,7 +12381,7 @@ video_orc_pack_BGR16_be (guint16 * ORC_RESTRICT d1, 19, 0, 0, 0, 20, 4, 20, 4, 20, 4, 20, 4, 20, 4, 113, 32, 4, 106, 33, 32, 16, 106, 34, 32, 17, 106, 35, 32, 18, 124, 35, 35, 19, 126, 34, 34, 20, 126, 33, 33, 21, 123, 36, 33, 34, 123, 36, 36, - 35, 190, 0, 36, 2, 0, + 35, 191, 0, 36, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_video_orc_pack_BGR16_be); @@ -13695,7 +12421,7 @@ video_orc_pack_BGR16_be (guint16 * ORC_RESTRICT d1, ORC_VAR_D1); orc_program_append_2 (p, "orl", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1); - orc_program_append_2 (p, "select0lw", 0, ORC_VAR_D1, ORC_VAR_T5, + orc_program_append_2 (p, "select1lw", 0, ORC_VAR_D1, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); #endif diff --git a/gst-libs/gst/video/video-orc-dist.h b/gst-libs/gst/video/video-orc-dist.h index 7e18bd725e..fdb0508ada 100644 --- a/gst-libs/gst/video/video-orc-dist.h +++ b/gst-libs/gst/video/video-orc-dist.h @@ -125,16 +125,12 @@ void video_orc_unpack_BGR15_le_trunc (guint32 * ORC_RESTRICT d1, const guint16 * void video_orc_unpack_BGR15_be_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); void video_orc_pack_BGR15_le (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n); void video_orc_pack_BGR15_be (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n); -void video_orc_unpack_RGB16_le (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_RGB16_be (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_RGB16_le_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_RGB16_be_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); +void video_orc_unpack_RGB16 (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); +void video_orc_unpack_RGB16_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); void video_orc_pack_RGB16_le (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n); void video_orc_pack_RGB16_be (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n); -void video_orc_unpack_BGR16_le (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_BGR16_be (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_BGR16_le_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); -void video_orc_unpack_BGR16_be_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); +void video_orc_unpack_BGR16 (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); +void video_orc_unpack_BGR16_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n); void video_orc_pack_BGR16_le (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n); void video_orc_pack_BGR16_be (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n); void video_orc_resample_bilinear_u32 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int p1, int p2, int n); diff --git a/gst-libs/gst/video/video-orc.orc b/gst-libs/gst/video/video-orc.orc index edc91068f8..962b4a5be6 100644 --- a/gst-libs/gst/video/video-orc.orc +++ b/gst-libs/gst/video/video-orc.orc @@ -589,7 +589,7 @@ shrul g, g, 6 shrul b, b, 3 orl t2, r, g orl t2, t2, b -select0lw rgb15, t2 +select1lw rgb15, t2 .function video_orc_unpack_BGR15_le .dest 4 argb guint32 @@ -719,9 +719,9 @@ shrul g, g, 6 shrul r, r, 19 orl t2, r, g orl t2, t2, b -select0lw rgb15, t2 +select1lw rgb15, t2 -.function video_orc_unpack_RGB16_le +.function video_orc_unpack_RGB16 .dest 4 argb guint32 .source 2 rgb16 guint16 .temp 2 t @@ -746,32 +746,7 @@ mergewl gb, g, b mergelq t2, ar, gb x4 convsuswb argb, t2 -.function video_orc_unpack_RGB16_be -.dest 4 argb guint32 -.source 2 rgb16 guint16 -.temp 2 t -.temp 2 r -.temp 2 g -.temp 2 b -.temp 4 ar -.temp 4 gb -.temp 8 t2 - -loadw t, rgb16 -andw r, t, 0xf800 -andw g, t, 0x07e0 -andw b, t, 0x001f -shruw r, r, 6 -shlw b, b, 5 -mulhsw r, r, 0x4200 -mulhsw g, g, 0x2080 -mulhsw b, b, 0x4200 -mergewl ar, r, 0xff -mergewl gb, b, g -mergelq t2, gb, ar -x4 convsuswb argb, t2 - -.function video_orc_unpack_RGB16_le_trunc +.function video_orc_unpack_RGB16_trunc .dest 4 argb guint32 .source 2 rgb16 guint16 .temp 2 t @@ -794,29 +769,6 @@ mergewl gb, g, b mergelq t2, ar, gb x4 convsuswb argb, t2 -.function video_orc_unpack_RGB16_be_trunc -.dest 4 argb guint32 -.source 2 rgb16 guint16 -.temp 2 t -.temp 2 r -.temp 2 g -.temp 2 b -.temp 4 ar -.temp 4 gb -.temp 8 t2 - -loadw t, rgb16 -andw r, t, 0xf800 -andw g, t, 0x07e0 -andw b, t, 0x001f -shruw r, r, 8 -shruw g, g, 3 -shlw b, b, 3 -mergewl ar, r, 0xff -mergewl gb, b, g -mergelq t2, gb, ar -x4 convsuswb argb, t2 - .function video_orc_pack_RGB16_le .dest 2 rgb15 guint16 .source 4 argb guint32 @@ -854,9 +806,9 @@ shrul g, g, 5 shrul b, b, 3 orl t2, r, g orl t2, t2, b -select0lw rgb16, t2 +select1lw rgb16, t2 -.function video_orc_unpack_BGR16_le +.function video_orc_unpack_BGR16 .dest 4 argb guint32 .source 2 bgr16 guint16 .temp 2 t @@ -881,32 +833,7 @@ mergewl gb, g, b mergelq t2, ar, gb x4 convsuswb argb, t2 -.function video_orc_unpack_BGR16_be -.dest 4 argb guint32 -.source 2 bgr16 guint16 -.temp 2 t -.temp 2 r -.temp 2 g -.temp 2 b -.temp 4 ar -.temp 4 gb -.temp 8 t2 - -loadw t, bgr16 -andw b, t, 0xf800 -andw g, t, 0x07e0 -andw r, t, 0x001f -shruw b, b, 6 -shlw r, r, 5 -mulhsw b, b, 0x4200 -mulhsw g, g, 0x2080 -mulhsw r, r, 0x4200 -mergewl ar, r, 0xff -mergewl gb, b, g -mergelq t2, gb, ar -x4 convsuswb argb, t2 - -.function video_orc_unpack_BGR16_le_trunc +.function video_orc_unpack_BGR16_trunc .dest 4 argb guint32 .source 2 bgr16 guint16 .temp 2 t @@ -929,29 +856,6 @@ mergewl gb, g, b mergelq t2, ar, gb x4 convsuswb argb, t2 -.function video_orc_unpack_BGR16_be_trunc -.dest 4 argb guint32 -.source 2 bgr16 guint16 -.temp 2 t -.temp 2 r -.temp 2 g -.temp 2 b -.temp 4 ar -.temp 4 gb -.temp 8 t2 - -loadw t, bgr16 -andw b, t, 0xf800 -andw g, t, 0x07e0 -andw r, t, 0x001f -shruw b, b, 8 -shruw g, g, 3 -shlw r, r, 3 -mergewl ar, r, 0xff -mergewl gb, b, g -mergelq t2, gb, ar -x4 convsuswb argb, t2 - .function video_orc_pack_BGR16_le .dest 2 rgb15 guint16 .source 4 argb guint32 @@ -990,7 +894,7 @@ shrul g, g, 5 shrul r, r, 19 orl t2, r, g orl t2, t2, b -select0lw rgb15, t2 +select1lw rgb15, t2 .function video_orc_resample_bilinear_u32 .dest 4 d1 guint8