From f859dcd699ac3e031139f448a003d7c7f7907c5e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 29 May 2012 10:45:23 +0200 Subject: [PATCH] videoconvert: remove unused functions --- gst/videoconvert/gstvideoconvertorc-dist.c | 4771 -------------------- gst/videoconvert/gstvideoconvertorc-dist.h | 27 - gst/videoconvert/gstvideoconvertorc.orc | 464 -- 3 files changed, 5262 deletions(-) diff --git a/gst/videoconvert/gstvideoconvertorc-dist.c b/gst/videoconvert/gstvideoconvertorc-dist.c index 9a9836fc75..b7329b1296 100644 --- a/gst/videoconvert/gstvideoconvertorc-dist.c +++ b/gst/videoconvert/gstvideoconvertorc-dist.c @@ -84,73 +84,6 @@ typedef union #endif void cogorc_memcpy_2d (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int n, int m); -void cogorc_downsample_horiz_cosite_1tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n); -void cogorc_downsample_horiz_cosite_3tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n); -void cogorc_downsample_420_jpeg (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n); -void cogorc_downsample_vert_halfsite_2tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n); -void cogorc_downsample_vert_cosite_3tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, - const guint8 * ORC_RESTRICT s3, int n); -void cogorc_downsample_vert_halfsite_4tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, - const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int n); -void cogorc_upsample_horiz_cosite_1tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n); -void cogorc_upsample_horiz_cosite (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n); -void cogorc_upsample_vert_avgub (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n); -void orc_unpack_yuyv_y (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n); -void orc_unpack_yuyv_u (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n); -void orc_unpack_yuyv_v (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n); -void orc_pack_yuyv (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int n); -void orc_unpack_uyvy_y (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n); -void orc_unpack_uyvy_u (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n); -void orc_unpack_uyvy_v (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n); -void orc_pack_uyvy (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int n); -void orc_matrix2_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, int p1, int p2, int p3, int n); -void orc_matrix2_11_u8 (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int p1, - int p2, int n); -void orc_matrix2_12_u8 (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int p1, - int p2, int n); -void orc_matrix3_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int p2, int p3, int p4, int n); -void orc_matrix3_100_u8 (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, - const guint8 * ORC_RESTRICT s3, int p1, int p2, int p3, int n); -void orc_matrix3_100_offset_u8 (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, - const guint8 * ORC_RESTRICT s3, int p1, int p2, int p3, int p4, int p5, - int n); -void orc_matrix3_000_u8 (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, - const guint8 * ORC_RESTRICT s3, int p1, int p2, int p3, int p4, int p5, - int n); -void orc_pack_123x (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int n); -void orc_pack_x123 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int n); -void cogorc_combine2_u8 (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int p1, - int p2, int n); void cogorc_convert_I420_UYVY (guint8 * ORC_RESTRICT d1, guint8 * ORC_RESTRICT d2, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, @@ -472,4710 +405,6 @@ cogorc_memcpy_2d (guint8 * ORC_RESTRICT d1, int d1_stride, #endif -/* cogorc_downsample_horiz_cosite_1tap */ -#ifdef DISABLE_ORC -void -cogorc_downsample_horiz_cosite_1tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - orc_union16 var32; - orc_int8 var33; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_union16 *) s1; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var32 = ptr4[i]; - /* 1: select0wb */ - { - orc_union16 _src; - _src.i = var32.i; - var33 = _src.x2[0]; - } - /* 2: storeb */ - ptr0[i] = var33; - } - -} - -#else -static void -_backup_cogorc_downsample_horiz_cosite_1tap (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - orc_union16 var32; - orc_int8 var33; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_union16 *) ex->arrays[4]; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var32 = ptr4[i]; - /* 1: select0wb */ - { - orc_union16 _src; - _src.i = var32.i; - var33 = _src.x2[0]; - } - /* 2: storeb */ - ptr0[i] = var33; - } - -} - -void -cogorc_downsample_horiz_cosite_1tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "cogorc_downsample_horiz_cosite_1tap"); - orc_program_set_backup_function (p, - _backup_cogorc_downsample_horiz_cosite_1tap); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 2, "s1"); - - orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_S1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = p->code_exec; - func (ex); -} -#endif - - -/* cogorc_downsample_horiz_cosite_3tap */ -#ifdef DISABLE_ORC -void -cogorc_downsample_horiz_cosite_3tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - const orc_union16 *ORC_RESTRICT ptr5; - orc_union16 var38; - orc_union16 var39; - orc_union16 var40; - orc_union16 var41; - orc_int8 var42; - orc_union16 var43; - orc_int8 var44; - orc_int8 var45; - orc_int8 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; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_union16 *) s1; - ptr5 = (orc_union16 *) s2; - - /* 9: loadpw */ - var40.i = (int) 0x00000002; /* 2 or 9.88131e-324f */ - /* 13: loadpw */ - var41.i = (int) 0x00000002; /* 2 or 9.88131e-324f */ - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var38 = ptr4[i]; - /* 1: copyw */ - var43.i = var38.i; - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var43.i; - var44 = _src.x2[0]; - } - /* 3: select1wb */ - { - orc_union16 _src; - _src.i = var43.i; - var45 = _src.x2[1]; - } - /* 4: loadw */ - var39 = ptr5[i]; - /* 5: select0wb */ - { - orc_union16 _src; - _src.i = var39.i; - var46 = _src.x2[0]; - } - /* 6: convubw */ - var47.i = (orc_uint8) var44; - /* 7: convubw */ - var48.i = (orc_uint8) var45; - /* 8: convubw */ - var49.i = (orc_uint8) var46; - /* 10: mullw */ - var50.i = (var48.i * var40.i) & 0xffff; - /* 11: addw */ - var51.i = var47.i + var49.i; - /* 12: addw */ - var52.i = var51.i + var50.i; - /* 14: addw */ - var53.i = var52.i + var41.i; - /* 15: shrsw */ - var54.i = var53.i >> 2; - /* 16: convsuswb */ - var42 = ORC_CLAMP_UB (var54.i); - /* 17: storeb */ - ptr0[i] = var42; - } - -} - -#else -static void -_backup_cogorc_downsample_horiz_cosite_3tap (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - const orc_union16 *ORC_RESTRICT ptr5; - orc_union16 var38; - orc_union16 var39; - orc_union16 var40; - orc_union16 var41; - orc_int8 var42; - orc_union16 var43; - orc_int8 var44; - orc_int8 var45; - orc_int8 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; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_union16 *) ex->arrays[4]; - ptr5 = (orc_union16 *) ex->arrays[5]; - - /* 9: loadpw */ - var40.i = (int) 0x00000002; /* 2 or 9.88131e-324f */ - /* 13: loadpw */ - var41.i = (int) 0x00000002; /* 2 or 9.88131e-324f */ - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var38 = ptr4[i]; - /* 1: copyw */ - var43.i = var38.i; - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var43.i; - var44 = _src.x2[0]; - } - /* 3: select1wb */ - { - orc_union16 _src; - _src.i = var43.i; - var45 = _src.x2[1]; - } - /* 4: loadw */ - var39 = ptr5[i]; - /* 5: select0wb */ - { - orc_union16 _src; - _src.i = var39.i; - var46 = _src.x2[0]; - } - /* 6: convubw */ - var47.i = (orc_uint8) var44; - /* 7: convubw */ - var48.i = (orc_uint8) var45; - /* 8: convubw */ - var49.i = (orc_uint8) var46; - /* 10: mullw */ - var50.i = (var48.i * var40.i) & 0xffff; - /* 11: addw */ - var51.i = var47.i + var49.i; - /* 12: addw */ - var52.i = var51.i + var50.i; - /* 14: addw */ - var53.i = var52.i + var41.i; - /* 15: shrsw */ - var54.i = var53.i >> 2; - /* 16: convsuswb */ - var42 = ORC_CLAMP_UB (var54.i); - /* 17: storeb */ - ptr0[i] = var42; - } - -} - -void -cogorc_downsample_horiz_cosite_3tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "cogorc_downsample_horiz_cosite_3tap"); - orc_program_set_backup_function (p, - _backup_cogorc_downsample_horiz_cosite_3tap); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 2, "s1"); - orc_program_add_source (p, 2, "s2"); - orc_program_add_constant (p, 4, 0x00000002, "c1"); - orc_program_add_temporary (p, 1, "t1"); - orc_program_add_temporary (p, 1, "t2"); - orc_program_add_temporary (p, 1, "t3"); - orc_program_add_temporary (p, 2, "t4"); - orc_program_add_temporary (p, 2, "t5"); - orc_program_add_temporary (p, 2, "t6"); - - orc_program_append_2 (p, "copyw", 0, ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T1, ORC_VAR_T4, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T2, ORC_VAR_T4, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T3, ORC_VAR_S2, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T5, ORC_VAR_T2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T6, ORC_VAR_T3, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T6, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T4, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - - func = p->code_exec; - func (ex); -} -#endif - - -/* cogorc_downsample_420_jpeg */ -#ifdef DISABLE_ORC -void -cogorc_downsample_420_jpeg (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - const orc_union16 *ORC_RESTRICT ptr5; - orc_union16 var37; - orc_union16 var38; - orc_int8 var39; - orc_union16 var40; - orc_int8 var41; - orc_int8 var42; - orc_int8 var43; - orc_union16 var44; - orc_int8 var45; - orc_int8 var46; - orc_int8 var47; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_union16 *) s1; - ptr5 = (orc_union16 *) s2; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var37 = ptr4[i]; - /* 1: copyw */ - var40.i = var37.i; - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var40.i; - var41 = _src.x2[0]; - } - /* 3: select1wb */ - { - orc_union16 _src; - _src.i = var40.i; - var42 = _src.x2[1]; - } - /* 4: avgub */ - var43 = ((orc_uint8) var41 + (orc_uint8) var42 + 1) >> 1; - /* 5: loadw */ - var38 = ptr5[i]; - /* 6: copyw */ - var44.i = var38.i; - /* 7: select0wb */ - { - orc_union16 _src; - _src.i = var44.i; - var45 = _src.x2[0]; - } - /* 8: select1wb */ - { - orc_union16 _src; - _src.i = var44.i; - var46 = _src.x2[1]; - } - /* 9: avgub */ - var47 = ((orc_uint8) var45 + (orc_uint8) var46 + 1) >> 1; - /* 10: avgub */ - var39 = ((orc_uint8) var43 + (orc_uint8) var47 + 1) >> 1; - /* 11: storeb */ - ptr0[i] = var39; - } - -} - -#else -static void -_backup_cogorc_downsample_420_jpeg (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - const orc_union16 *ORC_RESTRICT ptr5; - orc_union16 var37; - orc_union16 var38; - orc_int8 var39; - orc_union16 var40; - orc_int8 var41; - orc_int8 var42; - orc_int8 var43; - orc_union16 var44; - orc_int8 var45; - orc_int8 var46; - orc_int8 var47; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_union16 *) ex->arrays[4]; - ptr5 = (orc_union16 *) ex->arrays[5]; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var37 = ptr4[i]; - /* 1: copyw */ - var40.i = var37.i; - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var40.i; - var41 = _src.x2[0]; - } - /* 3: select1wb */ - { - orc_union16 _src; - _src.i = var40.i; - var42 = _src.x2[1]; - } - /* 4: avgub */ - var43 = ((orc_uint8) var41 + (orc_uint8) var42 + 1) >> 1; - /* 5: loadw */ - var38 = ptr5[i]; - /* 6: copyw */ - var44.i = var38.i; - /* 7: select0wb */ - { - orc_union16 _src; - _src.i = var44.i; - var45 = _src.x2[0]; - } - /* 8: select1wb */ - { - orc_union16 _src; - _src.i = var44.i; - var46 = _src.x2[1]; - } - /* 9: avgub */ - var47 = ((orc_uint8) var45 + (orc_uint8) var46 + 1) >> 1; - /* 10: avgub */ - var39 = ((orc_uint8) var43 + (orc_uint8) var47 + 1) >> 1; - /* 11: storeb */ - ptr0[i] = var39; - } - -} - -void -cogorc_downsample_420_jpeg (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "cogorc_downsample_420_jpeg"); - orc_program_set_backup_function (p, _backup_cogorc_downsample_420_jpeg); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 2, "s1"); - orc_program_add_source (p, 2, "s2"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 1, "t2"); - orc_program_add_temporary (p, 1, "t3"); - orc_program_add_temporary (p, 1, "t4"); - orc_program_add_temporary (p, 1, "t5"); - - orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T2, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T3, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "avgub", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3, - ORC_VAR_D1); - orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T4, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T5, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "avgub", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, - ORC_VAR_D1); - orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_T4, - ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - - func = p->code_exec; - func (ex); -} -#endif - - -/* cogorc_downsample_vert_halfsite_2tap */ -#ifdef DISABLE_ORC -void -cogorc_downsample_vert_halfsite_2tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var32; - orc_int8 var33; - orc_int8 var34; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var32 = ptr4[i]; - /* 1: loadb */ - var33 = ptr5[i]; - /* 2: avgub */ - var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1; - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -#else -static void -_backup_cogorc_downsample_vert_halfsite_2tap (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var32; - orc_int8 var33; - orc_int8 var34; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var32 = ptr4[i]; - /* 1: loadb */ - var33 = ptr5[i]; - /* 2: avgub */ - var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1; - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -void -cogorc_downsample_vert_halfsite_2tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "cogorc_downsample_vert_halfsite_2tap"); - orc_program_set_backup_function (p, - _backup_cogorc_downsample_vert_halfsite_2tap); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - - orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, - ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - - func = p->code_exec; - func (ex); -} -#endif - - -/* cogorc_downsample_vert_cosite_3tap */ -#ifdef DISABLE_ORC -void -cogorc_downsample_vert_cosite_3tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, - const guint8 * ORC_RESTRICT s3, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var35; - orc_int8 var36; - orc_int8 var37; - orc_union16 var38; - orc_union16 var39; - orc_int8 var40; - orc_union16 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - ptr6 = (orc_int8 *) s3; - - /* 6: loadpw */ - var38.i = (int) 0x00000002; /* 2 or 9.88131e-324f */ - /* 10: loadpw */ - var39.i = (int) 0x00000002; /* 2 or 9.88131e-324f */ - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var35 = ptr4[i]; - /* 1: convubw */ - var41.i = (orc_uint8) var35; - /* 2: loadb */ - var36 = ptr5[i]; - /* 3: convubw */ - var42.i = (orc_uint8) var36; - /* 4: loadb */ - var37 = ptr6[i]; - /* 5: convubw */ - var43.i = (orc_uint8) var37; - /* 7: mullw */ - var44.i = (var42.i * var38.i) & 0xffff; - /* 8: addw */ - var45.i = var41.i + var43.i; - /* 9: addw */ - var46.i = var45.i + var44.i; - /* 11: addw */ - var47.i = var46.i + var39.i; - /* 12: shrsw */ - var48.i = var47.i >> 2; - /* 13: convsuswb */ - var40 = ORC_CLAMP_UB (var48.i); - /* 14: storeb */ - ptr0[i] = var40; - } - -} - -#else -static void -_backup_cogorc_downsample_vert_cosite_3tap (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var35; - orc_int8 var36; - orc_int8 var37; - orc_union16 var38; - orc_union16 var39; - orc_int8 var40; - orc_union16 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - ptr6 = (orc_int8 *) ex->arrays[6]; - - /* 6: loadpw */ - var38.i = (int) 0x00000002; /* 2 or 9.88131e-324f */ - /* 10: loadpw */ - var39.i = (int) 0x00000002; /* 2 or 9.88131e-324f */ - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var35 = ptr4[i]; - /* 1: convubw */ - var41.i = (orc_uint8) var35; - /* 2: loadb */ - var36 = ptr5[i]; - /* 3: convubw */ - var42.i = (orc_uint8) var36; - /* 4: loadb */ - var37 = ptr6[i]; - /* 5: convubw */ - var43.i = (orc_uint8) var37; - /* 7: mullw */ - var44.i = (var42.i * var38.i) & 0xffff; - /* 8: addw */ - var45.i = var41.i + var43.i; - /* 9: addw */ - var46.i = var45.i + var44.i; - /* 11: addw */ - var47.i = var46.i + var39.i; - /* 12: shrsw */ - var48.i = var47.i >> 2; - /* 13: convsuswb */ - var40 = ORC_CLAMP_UB (var48.i); - /* 14: storeb */ - ptr0[i] = var40; - } - -} - -void -cogorc_downsample_vert_cosite_3tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, - const guint8 * ORC_RESTRICT s3, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "cogorc_downsample_vert_cosite_3tap"); - orc_program_set_backup_function (p, - _backup_cogorc_downsample_vert_cosite_3tap); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_source (p, 1, "s3"); - orc_program_add_constant (p, 4, 0x00000002, "c1"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - orc_program_add_temporary (p, 2, "t3"); - - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T3, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->arrays[ORC_VAR_S3] = (void *) s3; - - func = p->code_exec; - func (ex); -} -#endif - - -/* cogorc_downsample_vert_halfsite_4tap */ -#ifdef DISABLE_ORC -void -cogorc_downsample_vert_halfsite_4tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, - const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - const orc_int8 *ORC_RESTRICT ptr7; - orc_int8 var36; - orc_int8 var37; - orc_int8 var38; - orc_int8 var39; - orc_union16 var40; - orc_union16 var41; - orc_union16 var42; - orc_int8 var43; - orc_union16 var44; - orc_union16 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; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - ptr6 = (orc_int8 *) s3; - ptr7 = (orc_int8 *) s4; - - /* 9: loadpw */ - var40.i = (int) 0x0000001a; /* 26 or 1.28457e-322f */ - /* 12: loadpw */ - var41.i = (int) 0x00000006; /* 6 or 2.96439e-323f */ - /* 15: loadpw */ - var42.i = (int) 0x00000020; /* 32 or 1.58101e-322f */ - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var36 = ptr4[i]; - /* 1: convubw */ - var44.i = (orc_uint8) var36; - /* 2: loadb */ - var37 = ptr5[i]; - /* 3: convubw */ - var45.i = (orc_uint8) var37; - /* 4: loadb */ - var38 = ptr6[i]; - /* 5: convubw */ - var46.i = (orc_uint8) var38; - /* 6: loadb */ - var39 = ptr7[i]; - /* 7: convubw */ - var47.i = (orc_uint8) var39; - /* 8: addw */ - var48.i = var45.i + var46.i; - /* 10: mullw */ - var49.i = (var48.i * var40.i) & 0xffff; - /* 11: addw */ - var50.i = var44.i + var47.i; - /* 13: mullw */ - var51.i = (var50.i * var41.i) & 0xffff; - /* 14: addw */ - var52.i = var49.i + var51.i; - /* 16: addw */ - var53.i = var52.i + var42.i; - /* 17: shrsw */ - var54.i = var53.i >> 6; - /* 18: convsuswb */ - var43 = ORC_CLAMP_UB (var54.i); - /* 19: storeb */ - ptr0[i] = var43; - } - -} - -#else -static void -_backup_cogorc_downsample_vert_halfsite_4tap (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - const orc_int8 *ORC_RESTRICT ptr7; - orc_int8 var36; - orc_int8 var37; - orc_int8 var38; - orc_int8 var39; - orc_union16 var40; - orc_union16 var41; - orc_union16 var42; - orc_int8 var43; - orc_union16 var44; - orc_union16 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; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - ptr6 = (orc_int8 *) ex->arrays[6]; - ptr7 = (orc_int8 *) ex->arrays[7]; - - /* 9: loadpw */ - var40.i = (int) 0x0000001a; /* 26 or 1.28457e-322f */ - /* 12: loadpw */ - var41.i = (int) 0x00000006; /* 6 or 2.96439e-323f */ - /* 15: loadpw */ - var42.i = (int) 0x00000020; /* 32 or 1.58101e-322f */ - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var36 = ptr4[i]; - /* 1: convubw */ - var44.i = (orc_uint8) var36; - /* 2: loadb */ - var37 = ptr5[i]; - /* 3: convubw */ - var45.i = (orc_uint8) var37; - /* 4: loadb */ - var38 = ptr6[i]; - /* 5: convubw */ - var46.i = (orc_uint8) var38; - /* 6: loadb */ - var39 = ptr7[i]; - /* 7: convubw */ - var47.i = (orc_uint8) var39; - /* 8: addw */ - var48.i = var45.i + var46.i; - /* 10: mullw */ - var49.i = (var48.i * var40.i) & 0xffff; - /* 11: addw */ - var50.i = var44.i + var47.i; - /* 13: mullw */ - var51.i = (var50.i * var41.i) & 0xffff; - /* 14: addw */ - var52.i = var49.i + var51.i; - /* 16: addw */ - var53.i = var52.i + var42.i; - /* 17: shrsw */ - var54.i = var53.i >> 6; - /* 18: convsuswb */ - var43 = ORC_CLAMP_UB (var54.i); - /* 19: storeb */ - ptr0[i] = var43; - } - -} - -void -cogorc_downsample_vert_halfsite_4tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, - const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "cogorc_downsample_vert_halfsite_4tap"); - orc_program_set_backup_function (p, - _backup_cogorc_downsample_vert_halfsite_4tap); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_source (p, 1, "s3"); - orc_program_add_source (p, 1, "s4"); - orc_program_add_constant (p, 4, 0x0000001a, "c1"); - orc_program_add_constant (p, 4, 0x00000006, "c2"); - orc_program_add_constant (p, 4, 0x00000020, "c3"); - 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_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T4, ORC_VAR_S4, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T4, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C3, - ORC_VAR_D1); - orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->arrays[ORC_VAR_S3] = (void *) s3; - ex->arrays[ORC_VAR_S4] = (void *) s4; - - func = p->code_exec; - func (ex); -} -#endif - - -/* cogorc_upsample_horiz_cosite_1tap */ -#ifdef DISABLE_ORC -void -cogorc_upsample_horiz_cosite_1tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n) -{ - int i; - orc_union16 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - orc_int8 var33; - orc_union16 var34; - orc_int8 var35; - - ptr0 = (orc_union16 *) d1; - ptr4 = (orc_int8 *) s1; - - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var33 = ptr4[i]; - /* 1: copyb */ - var35 = var33; - /* 2: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var35; - _dest.x2[1] = var35; - var34.i = _dest.i; - } - /* 3: storew */ - ptr0[i] = var34; - } - -} - -#else -static void -_backup_cogorc_upsample_horiz_cosite_1tap (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_union16 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - orc_int8 var33; - orc_union16 var34; - orc_int8 var35; - - ptr0 = (orc_union16 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var33 = ptr4[i]; - /* 1: copyb */ - var35 = var33; - /* 2: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var35; - _dest.x2[1] = var35; - var34.i = _dest.i; - } - /* 3: storew */ - ptr0[i] = var34; - } - -} - -void -cogorc_upsample_horiz_cosite_1tap (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "cogorc_upsample_horiz_cosite_1tap"); - orc_program_set_backup_function (p, - _backup_cogorc_upsample_horiz_cosite_1tap); - orc_program_add_destination (p, 2, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_temporary (p, 1, "t1"); - - orc_program_append_2 (p, "copyb", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mergebw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T1, - ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = p->code_exec; - func (ex); -} -#endif - - -/* cogorc_upsample_horiz_cosite */ -#ifdef DISABLE_ORC -void -cogorc_upsample_horiz_cosite (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n) -{ - int i; - orc_union16 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var34; - orc_int8 var35; - orc_union16 var36; - orc_int8 var37; - orc_int8 var38; - - ptr0 = (orc_union16 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: copyb */ - var37 = var34; - /* 2: loadb */ - var35 = ptr5[i]; - /* 3: avgub */ - var38 = ((orc_uint8) var37 + (orc_uint8) var35 + 1) >> 1; - /* 4: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var37; - _dest.x2[1] = var38; - var36.i = _dest.i; - } - /* 5: storew */ - ptr0[i] = var36; - } - -} - -#else -static void -_backup_cogorc_upsample_horiz_cosite (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_union16 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var34; - orc_int8 var35; - orc_union16 var36; - orc_int8 var37; - orc_int8 var38; - - ptr0 = (orc_union16 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: copyb */ - var37 = var34; - /* 2: loadb */ - var35 = ptr5[i]; - /* 3: avgub */ - var38 = ((orc_uint8) var37 + (orc_uint8) var35 + 1) >> 1; - /* 4: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var37; - _dest.x2[1] = var38; - var36.i = _dest.i; - } - /* 5: storew */ - ptr0[i] = var36; - } - -} - -void -cogorc_upsample_horiz_cosite (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "cogorc_upsample_horiz_cosite"); - orc_program_set_backup_function (p, _backup_cogorc_upsample_horiz_cosite); - orc_program_add_destination (p, 2, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_temporary (p, 1, "t1"); - orc_program_add_temporary (p, 1, "t2"); - - orc_program_append_2 (p, "copyb", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "avgub", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_S2, - ORC_VAR_D1); - orc_program_append_2 (p, "mergebw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - - func = p->code_exec; - func (ex); -} -#endif - - -/* cogorc_upsample_vert_avgub */ -#ifdef DISABLE_ORC -void -cogorc_upsample_vert_avgub (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var32; - orc_int8 var33; - orc_int8 var34; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var32 = ptr4[i]; - /* 1: loadb */ - var33 = ptr5[i]; - /* 2: avgub */ - var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1; - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -#else -static void -_backup_cogorc_upsample_vert_avgub (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var32; - orc_int8 var33; - orc_int8 var34; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var32 = ptr4[i]; - /* 1: loadb */ - var33 = ptr5[i]; - /* 2: avgub */ - var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1; - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -void -cogorc_upsample_vert_avgub (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "cogorc_upsample_vert_avgub"); - orc_program_set_backup_function (p, _backup_cogorc_upsample_vert_avgub); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - - orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, - ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_unpack_yuyv_y */ -#ifdef DISABLE_ORC -void -orc_unpack_yuyv_y (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - orc_union16 var32; - orc_int8 var33; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_union16 *) s1; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var32 = ptr4[i]; - /* 1: select0wb */ - { - orc_union16 _src; - _src.i = var32.i; - var33 = _src.x2[0]; - } - /* 2: storeb */ - ptr0[i] = var33; - } - -} - -#else -static void -_backup_orc_unpack_yuyv_y (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - orc_union16 var32; - orc_int8 var33; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_union16 *) ex->arrays[4]; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var32 = ptr4[i]; - /* 1: select0wb */ - { - orc_union16 _src; - _src.i = var32.i; - var33 = _src.x2[0]; - } - /* 2: storeb */ - ptr0[i] = var33; - } - -} - -void -orc_unpack_yuyv_y (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_unpack_yuyv_y"); - orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_y); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 2, "s1"); - - orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_S1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_unpack_yuyv_u */ -#ifdef DISABLE_ORC -void -orc_unpack_yuyv_u (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union32 *ORC_RESTRICT ptr4; - orc_union32 var33; - orc_int8 var34; - orc_union16 var35; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_union32 *) s1; - - - for (i = 0; i < n; i++) { - /* 0: loadl */ - var33 = ptr4[i]; - /* 1: select0lw */ - { - orc_union32 _src; - _src.i = var33.i; - var35.i = _src.x2[0]; - } - /* 2: select1wb */ - { - orc_union16 _src; - _src.i = var35.i; - var34 = _src.x2[1]; - } - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -#else -static void -_backup_orc_unpack_yuyv_u (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union32 *ORC_RESTRICT ptr4; - orc_union32 var33; - orc_int8 var34; - orc_union16 var35; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_union32 *) ex->arrays[4]; - - - for (i = 0; i < n; i++) { - /* 0: loadl */ - var33 = ptr4[i]; - /* 1: select0lw */ - { - orc_union32 _src; - _src.i = var33.i; - var35.i = _src.x2[0]; - } - /* 2: select1wb */ - { - orc_union16 _src; - _src.i = var35.i; - var34 = _src.x2[1]; - } - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -void -orc_unpack_yuyv_u (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_unpack_yuyv_u"); - orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_u); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 4, "s1"); - orc_program_add_temporary (p, 2, "t1"); - - orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_unpack_yuyv_v */ -#ifdef DISABLE_ORC -void -orc_unpack_yuyv_v (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union32 *ORC_RESTRICT ptr4; - orc_union32 var33; - orc_int8 var34; - orc_union16 var35; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_union32 *) s1; - - - for (i = 0; i < n; i++) { - /* 0: loadl */ - var33 = ptr4[i]; - /* 1: select1lw */ - { - orc_union32 _src; - _src.i = var33.i; - var35.i = _src.x2[1]; - } - /* 2: select1wb */ - { - orc_union16 _src; - _src.i = var35.i; - var34 = _src.x2[1]; - } - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -#else -static void -_backup_orc_unpack_yuyv_v (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union32 *ORC_RESTRICT ptr4; - orc_union32 var33; - orc_int8 var34; - orc_union16 var35; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_union32 *) ex->arrays[4]; - - - for (i = 0; i < n; i++) { - /* 0: loadl */ - var33 = ptr4[i]; - /* 1: select1lw */ - { - orc_union32 _src; - _src.i = var33.i; - var35.i = _src.x2[1]; - } - /* 2: select1wb */ - { - orc_union16 _src; - _src.i = var35.i; - var34 = _src.x2[1]; - } - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -void -orc_unpack_yuyv_v (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_unpack_yuyv_v"); - orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_v); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 4, "s1"); - orc_program_add_temporary (p, 2, "t1"); - - orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_pack_yuyv */ -#ifdef DISABLE_ORC -void -orc_pack_yuyv (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int n) -{ - int i; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_union16 var37; - orc_int8 var38; - orc_int8 var39; - orc_union32 var40; - orc_union16 var41; - orc_int8 var42; - orc_int8 var43; - orc_union16 var44; - orc_union16 var45; - - ptr0 = (orc_union32 *) d1; - ptr4 = (orc_union16 *) s1; - ptr5 = (orc_int8 *) s2; - ptr6 = (orc_int8 *) s3; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var37 = ptr4[i]; - /* 1: copyw */ - var41.i = var37.i; - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var41.i; - var42 = _src.x2[0]; - } - /* 3: select1wb */ - { - orc_union16 _src; - _src.i = var41.i; - var43 = _src.x2[1]; - } - /* 4: loadb */ - var38 = ptr5[i]; - /* 5: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var42; - _dest.x2[1] = var38; - var44.i = _dest.i; - } - /* 6: loadb */ - var39 = ptr6[i]; - /* 7: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var43; - _dest.x2[1] = var39; - var45.i = _dest.i; - } - /* 8: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var44.i; - _dest.x2[1] = var45.i; - var40.i = _dest.i; - } - /* 9: storel */ - ptr0[i] = var40; - } - -} - -#else -static void -_backup_orc_pack_yuyv (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_union16 var37; - orc_int8 var38; - orc_int8 var39; - orc_union32 var40; - orc_union16 var41; - orc_int8 var42; - orc_int8 var43; - orc_union16 var44; - orc_union16 var45; - - ptr0 = (orc_union32 *) ex->arrays[0]; - ptr4 = (orc_union16 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - ptr6 = (orc_int8 *) ex->arrays[6]; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var37 = ptr4[i]; - /* 1: copyw */ - var41.i = var37.i; - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var41.i; - var42 = _src.x2[0]; - } - /* 3: select1wb */ - { - orc_union16 _src; - _src.i = var41.i; - var43 = _src.x2[1]; - } - /* 4: loadb */ - var38 = ptr5[i]; - /* 5: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var42; - _dest.x2[1] = var38; - var44.i = _dest.i; - } - /* 6: loadb */ - var39 = ptr6[i]; - /* 7: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var43; - _dest.x2[1] = var39; - var45.i = _dest.i; - } - /* 8: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var44.i; - _dest.x2[1] = var45.i; - var40.i = _dest.i; - } - /* 9: storel */ - ptr0[i] = var40; - } - -} - -void -orc_pack_yuyv (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_pack_yuyv"); - orc_program_set_backup_function (p, _backup_orc_pack_yuyv); - orc_program_add_destination (p, 4, "d1"); - orc_program_add_source (p, 2, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_source (p, 1, "s3"); - orc_program_add_temporary (p, 1, "t1"); - orc_program_add_temporary (p, 1, "t2"); - orc_program_add_temporary (p, 2, "t3"); - orc_program_add_temporary (p, 2, "t4"); - orc_program_add_temporary (p, 2, "t5"); - - orc_program_append_2 (p, "copyw", 0, ORC_VAR_T5, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T1, ORC_VAR_T5, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T2, ORC_VAR_T5, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_S2, - ORC_VAR_D1); - orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_S3, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T4, - ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->arrays[ORC_VAR_S3] = (void *) s3; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_unpack_uyvy_y */ -#ifdef DISABLE_ORC -void -orc_unpack_uyvy_y (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - orc_union16 var32; - orc_int8 var33; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_union16 *) s1; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var32 = ptr4[i]; - /* 1: select1wb */ - { - orc_union16 _src; - _src.i = var32.i; - var33 = _src.x2[1]; - } - /* 2: storeb */ - ptr0[i] = var33; - } - -} - -#else -static void -_backup_orc_unpack_uyvy_y (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - orc_union16 var32; - orc_int8 var33; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_union16 *) ex->arrays[4]; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var32 = ptr4[i]; - /* 1: select1wb */ - { - orc_union16 _src; - _src.i = var32.i; - var33 = _src.x2[1]; - } - /* 2: storeb */ - ptr0[i] = var33; - } - -} - -void -orc_unpack_uyvy_y (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_unpack_uyvy_y"); - orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_y); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 2, "s1"); - - orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_S1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_unpack_uyvy_u */ -#ifdef DISABLE_ORC -void -orc_unpack_uyvy_u (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union32 *ORC_RESTRICT ptr4; - orc_union32 var33; - orc_int8 var34; - orc_union16 var35; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_union32 *) s1; - - - for (i = 0; i < n; i++) { - /* 0: loadl */ - var33 = ptr4[i]; - /* 1: select0lw */ - { - orc_union32 _src; - _src.i = var33.i; - var35.i = _src.x2[0]; - } - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var35.i; - var34 = _src.x2[0]; - } - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -#else -static void -_backup_orc_unpack_uyvy_u (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union32 *ORC_RESTRICT ptr4; - orc_union32 var33; - orc_int8 var34; - orc_union16 var35; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_union32 *) ex->arrays[4]; - - - for (i = 0; i < n; i++) { - /* 0: loadl */ - var33 = ptr4[i]; - /* 1: select0lw */ - { - orc_union32 _src; - _src.i = var33.i; - var35.i = _src.x2[0]; - } - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var35.i; - var34 = _src.x2[0]; - } - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -void -orc_unpack_uyvy_u (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_unpack_uyvy_u"); - orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_u); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 4, "s1"); - orc_program_add_temporary (p, 2, "t1"); - - orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_unpack_uyvy_v */ -#ifdef DISABLE_ORC -void -orc_unpack_uyvy_v (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union32 *ORC_RESTRICT ptr4; - orc_union32 var33; - orc_int8 var34; - orc_union16 var35; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_union32 *) s1; - - - for (i = 0; i < n; i++) { - /* 0: loadl */ - var33 = ptr4[i]; - /* 1: select1lw */ - { - orc_union32 _src; - _src.i = var33.i; - var35.i = _src.x2[1]; - } - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var35.i; - var34 = _src.x2[0]; - } - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -#else -static void -_backup_orc_unpack_uyvy_v (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_union32 *ORC_RESTRICT ptr4; - orc_union32 var33; - orc_int8 var34; - orc_union16 var35; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_union32 *) ex->arrays[4]; - - - for (i = 0; i < n; i++) { - /* 0: loadl */ - var33 = ptr4[i]; - /* 1: select1lw */ - { - orc_union32 _src; - _src.i = var33.i; - var35.i = _src.x2[1]; - } - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var35.i; - var34 = _src.x2[0]; - } - /* 3: storeb */ - ptr0[i] = var34; - } - -} - -void -orc_unpack_uyvy_v (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_unpack_uyvy_v"); - orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_v); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 4, "s1"); - orc_program_add_temporary (p, 2, "t1"); - - orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_pack_uyvy */ -#ifdef DISABLE_ORC -void -orc_pack_uyvy (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int n) -{ - int i; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_union16 var37; - orc_int8 var38; - orc_int8 var39; - orc_union32 var40; - orc_union16 var41; - orc_int8 var42; - orc_int8 var43; - orc_union16 var44; - orc_union16 var45; - - ptr0 = (orc_union32 *) d1; - ptr4 = (orc_union16 *) s1; - ptr5 = (orc_int8 *) s2; - ptr6 = (orc_int8 *) s3; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var37 = ptr4[i]; - /* 1: copyw */ - var41.i = var37.i; - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var41.i; - var42 = _src.x2[0]; - } - /* 3: select1wb */ - { - orc_union16 _src; - _src.i = var41.i; - var43 = _src.x2[1]; - } - /* 4: loadb */ - var38 = ptr5[i]; - /* 5: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var38; - _dest.x2[1] = var42; - var44.i = _dest.i; - } - /* 6: loadb */ - var39 = ptr6[i]; - /* 7: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var39; - _dest.x2[1] = var43; - var45.i = _dest.i; - } - /* 8: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var44.i; - _dest.x2[1] = var45.i; - var40.i = _dest.i; - } - /* 9: storel */ - ptr0[i] = var40; - } - -} - -#else -static void -_backup_orc_pack_uyvy (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_union32 *ORC_RESTRICT ptr0; - const orc_union16 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_union16 var37; - orc_int8 var38; - orc_int8 var39; - orc_union32 var40; - orc_union16 var41; - orc_int8 var42; - orc_int8 var43; - orc_union16 var44; - orc_union16 var45; - - ptr0 = (orc_union32 *) ex->arrays[0]; - ptr4 = (orc_union16 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - ptr6 = (orc_int8 *) ex->arrays[6]; - - - for (i = 0; i < n; i++) { - /* 0: loadw */ - var37 = ptr4[i]; - /* 1: copyw */ - var41.i = var37.i; - /* 2: select0wb */ - { - orc_union16 _src; - _src.i = var41.i; - var42 = _src.x2[0]; - } - /* 3: select1wb */ - { - orc_union16 _src; - _src.i = var41.i; - var43 = _src.x2[1]; - } - /* 4: loadb */ - var38 = ptr5[i]; - /* 5: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var38; - _dest.x2[1] = var42; - var44.i = _dest.i; - } - /* 6: loadb */ - var39 = ptr6[i]; - /* 7: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var39; - _dest.x2[1] = var43; - var45.i = _dest.i; - } - /* 8: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var44.i; - _dest.x2[1] = var45.i; - var40.i = _dest.i; - } - /* 9: storel */ - ptr0[i] = var40; - } - -} - -void -orc_pack_uyvy (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_pack_uyvy"); - orc_program_set_backup_function (p, _backup_orc_pack_uyvy); - orc_program_add_destination (p, 4, "d1"); - orc_program_add_source (p, 2, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_source (p, 1, "s3"); - orc_program_add_temporary (p, 1, "t1"); - orc_program_add_temporary (p, 1, "t2"); - orc_program_add_temporary (p, 2, "t3"); - orc_program_add_temporary (p, 2, "t4"); - orc_program_add_temporary (p, 2, "t5"); - - orc_program_append_2 (p, "copyw", 0, ORC_VAR_T5, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T1, ORC_VAR_T5, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T2, ORC_VAR_T5, - ORC_VAR_D1, ORC_VAR_D1); - orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T3, ORC_VAR_S2, ORC_VAR_T1, - ORC_VAR_D1); - orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T4, ORC_VAR_S3, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T4, - ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->arrays[ORC_VAR_S3] = (void *) s3; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_matrix2_u8 */ -#ifdef DISABLE_ORC -void -orc_matrix2_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, int p1, int p2, int p3, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var34; - orc_union16 var35; - orc_int8 var36; - orc_union16 var37; - orc_union16 var38; - orc_int8 var39; - orc_union16 var40; - orc_union16 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - - /* 2: loadpw */ - var35.i = p1; - /* 6: loadpw */ - var37.i = p2; - /* 9: loadpw */ - var38.i = p3; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: convubw */ - var40.i = (orc_uint8) var34; - /* 3: mullw */ - var41.i = (var40.i * var35.i) & 0xffff; - /* 4: loadb */ - var36 = ptr5[i]; - /* 5: convubw */ - var42.i = (orc_uint8) var36; - /* 7: mullw */ - var43.i = (var42.i * var37.i) & 0xffff; - /* 8: addw */ - var44.i = var41.i + var43.i; - /* 10: addw */ - var45.i = var44.i + var38.i; - /* 11: shrsw */ - var46.i = var45.i >> 6; - /* 12: convsuswb */ - var39 = ORC_CLAMP_UB (var46.i); - /* 13: storeb */ - ptr0[i] = var39; - } - -} - -#else -static void -_backup_orc_matrix2_u8 (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var34; - orc_union16 var35; - orc_int8 var36; - orc_union16 var37; - orc_union16 var38; - orc_int8 var39; - orc_union16 var40; - orc_union16 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - - /* 2: loadpw */ - var35.i = ex->params[24]; - /* 6: loadpw */ - var37.i = ex->params[25]; - /* 9: loadpw */ - var38.i = ex->params[26]; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: convubw */ - var40.i = (orc_uint8) var34; - /* 3: mullw */ - var41.i = (var40.i * var35.i) & 0xffff; - /* 4: loadb */ - var36 = ptr5[i]; - /* 5: convubw */ - var42.i = (orc_uint8) var36; - /* 7: mullw */ - var43.i = (var42.i * var37.i) & 0xffff; - /* 8: addw */ - var44.i = var41.i + var43.i; - /* 10: addw */ - var45.i = var44.i + var38.i; - /* 11: shrsw */ - var46.i = var45.i >> 6; - /* 12: convsuswb */ - var39 = ORC_CLAMP_UB (var46.i); - /* 13: storeb */ - ptr0[i] = var39; - } - -} - -void -orc_matrix2_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, int p1, int p2, int p3, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_matrix2_u8"); - orc_program_set_backup_function (p, _backup_orc_matrix2_u8); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_constant (p, 4, 0x00000006, "c1"); - orc_program_add_parameter (p, 2, "p1"); - orc_program_add_parameter (p, 2, "p2"); - orc_program_add_parameter (p, 2, "p3"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, - ORC_VAR_D1); - orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->params[ORC_VAR_P1] = p1; - ex->params[ORC_VAR_P2] = p2; - ex->params[ORC_VAR_P3] = p3; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_matrix2_11_u8 */ -#ifdef DISABLE_ORC -void -orc_matrix2_11_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, int p1, int p2, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var36; - orc_union16 var37; - orc_union16 var38; - orc_int8 var39; - orc_union16 var40; - orc_union16 var41; - orc_union16 var42; - orc_int8 var43; - orc_union16 var44; - orc_union16 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; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - - /* 2: loadpw */ - var37.i = (int) 0x00000010; /* 16 or 7.90505e-323f */ - /* 4: loadpw */ - var38.i = p1; - /* 8: loadpw */ - var40.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - /* 10: loadpw */ - var41.i = p2; - /* 13: loadpw */ - var42.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var36 = ptr4[i]; - /* 1: convubw */ - var44.i = (orc_uint8) var36; - /* 3: subw */ - var45.i = var44.i - var37.i; - /* 5: mullw */ - var46.i = (var45.i * var38.i) & 0xffff; - /* 6: loadb */ - var39 = ptr5[i]; - /* 7: convubw */ - var47.i = (orc_uint8) var39; - /* 9: subw */ - var48.i = var47.i - var40.i; - /* 11: mullw */ - var49.i = (var48.i * var41.i) & 0xffff; - /* 12: addw */ - var50.i = var46.i + var49.i; - /* 14: addw */ - var51.i = var50.i + var42.i; - /* 15: shrsw */ - var52.i = var51.i >> 8; - /* 16: addw */ - var53.i = var52.i + var45.i; - /* 17: addw */ - var54.i = var53.i + var48.i; - /* 18: convsuswb */ - var43 = ORC_CLAMP_UB (var54.i); - /* 19: storeb */ - ptr0[i] = var43; - } - -} - -#else -static void -_backup_orc_matrix2_11_u8 (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var36; - orc_union16 var37; - orc_union16 var38; - orc_int8 var39; - orc_union16 var40; - orc_union16 var41; - orc_union16 var42; - orc_int8 var43; - orc_union16 var44; - orc_union16 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; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - - /* 2: loadpw */ - var37.i = (int) 0x00000010; /* 16 or 7.90505e-323f */ - /* 4: loadpw */ - var38.i = ex->params[24]; - /* 8: loadpw */ - var40.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - /* 10: loadpw */ - var41.i = ex->params[25]; - /* 13: loadpw */ - var42.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var36 = ptr4[i]; - /* 1: convubw */ - var44.i = (orc_uint8) var36; - /* 3: subw */ - var45.i = var44.i - var37.i; - /* 5: mullw */ - var46.i = (var45.i * var38.i) & 0xffff; - /* 6: loadb */ - var39 = ptr5[i]; - /* 7: convubw */ - var47.i = (orc_uint8) var39; - /* 9: subw */ - var48.i = var47.i - var40.i; - /* 11: mullw */ - var49.i = (var48.i * var41.i) & 0xffff; - /* 12: addw */ - var50.i = var46.i + var49.i; - /* 14: addw */ - var51.i = var50.i + var42.i; - /* 15: shrsw */ - var52.i = var51.i >> 8; - /* 16: addw */ - var53.i = var52.i + var45.i; - /* 17: addw */ - var54.i = var53.i + var48.i; - /* 18: convsuswb */ - var43 = ORC_CLAMP_UB (var54.i); - /* 19: storeb */ - ptr0[i] = var43; - } - -} - -void -orc_matrix2_11_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, int p1, int p2, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_matrix2_11_u8"); - orc_program_set_backup_function (p, _backup_orc_matrix2_11_u8); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_constant (p, 4, 0x00000010, "c1"); - orc_program_add_constant (p, 4, 0x00000080, "c2"); - orc_program_add_constant (p, 4, 0x00000008, "c3"); - orc_program_add_parameter (p, 2, "p1"); - orc_program_add_parameter (p, 2, "p2"); - 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_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_P1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_P2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C3, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T1, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T3, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->params[ORC_VAR_P1] = p1; - ex->params[ORC_VAR_P2] = p2; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_matrix2_12_u8 */ -#ifdef DISABLE_ORC -void -orc_matrix2_12_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, int p1, int p2, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var36; - orc_union16 var37; - orc_union16 var38; - orc_int8 var39; - orc_union16 var40; - orc_union16 var41; - orc_union16 var42; - orc_int8 var43; - orc_union16 var44; - orc_union16 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_union16 var55; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - - /* 2: loadpw */ - var37.i = (int) 0x00000010; /* 16 or 7.90505e-323f */ - /* 4: loadpw */ - var38.i = p1; - /* 8: loadpw */ - var40.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - /* 10: loadpw */ - var41.i = p2; - /* 13: loadpw */ - var42.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var36 = ptr4[i]; - /* 1: convubw */ - var44.i = (orc_uint8) var36; - /* 3: subw */ - var45.i = var44.i - var37.i; - /* 5: mullw */ - var46.i = (var45.i * var38.i) & 0xffff; - /* 6: loadb */ - var39 = ptr5[i]; - /* 7: convubw */ - var47.i = (orc_uint8) var39; - /* 9: subw */ - var48.i = var47.i - var40.i; - /* 11: mullw */ - var49.i = (var48.i * var41.i) & 0xffff; - /* 12: addw */ - var50.i = var46.i + var49.i; - /* 14: addw */ - var51.i = var50.i + var42.i; - /* 15: shrsw */ - var52.i = var51.i >> 8; - /* 16: addw */ - var53.i = var52.i + var45.i; - /* 17: addw */ - var54.i = var53.i + var48.i; - /* 18: addw */ - var55.i = var54.i + var48.i; - /* 19: convsuswb */ - var43 = ORC_CLAMP_UB (var55.i); - /* 20: storeb */ - ptr0[i] = var43; - } - -} - -#else -static void -_backup_orc_matrix2_12_u8 (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var36; - orc_union16 var37; - orc_union16 var38; - orc_int8 var39; - orc_union16 var40; - orc_union16 var41; - orc_union16 var42; - orc_int8 var43; - orc_union16 var44; - orc_union16 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_union16 var55; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - - /* 2: loadpw */ - var37.i = (int) 0x00000010; /* 16 or 7.90505e-323f */ - /* 4: loadpw */ - var38.i = ex->params[24]; - /* 8: loadpw */ - var40.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - /* 10: loadpw */ - var41.i = ex->params[25]; - /* 13: loadpw */ - var42.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var36 = ptr4[i]; - /* 1: convubw */ - var44.i = (orc_uint8) var36; - /* 3: subw */ - var45.i = var44.i - var37.i; - /* 5: mullw */ - var46.i = (var45.i * var38.i) & 0xffff; - /* 6: loadb */ - var39 = ptr5[i]; - /* 7: convubw */ - var47.i = (orc_uint8) var39; - /* 9: subw */ - var48.i = var47.i - var40.i; - /* 11: mullw */ - var49.i = (var48.i * var41.i) & 0xffff; - /* 12: addw */ - var50.i = var46.i + var49.i; - /* 14: addw */ - var51.i = var50.i + var42.i; - /* 15: shrsw */ - var52.i = var51.i >> 8; - /* 16: addw */ - var53.i = var52.i + var45.i; - /* 17: addw */ - var54.i = var53.i + var48.i; - /* 18: addw */ - var55.i = var54.i + var48.i; - /* 19: convsuswb */ - var43 = ORC_CLAMP_UB (var55.i); - /* 20: storeb */ - ptr0[i] = var43; - } - -} - -void -orc_matrix2_12_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, int p1, int p2, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_matrix2_12_u8"); - orc_program_set_backup_function (p, _backup_orc_matrix2_12_u8); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_constant (p, 4, 0x00000010, "c1"); - orc_program_add_constant (p, 4, 0x00000080, "c2"); - orc_program_add_constant (p, 4, 0x00000008, "c3"); - orc_program_add_parameter (p, 2, "p1"); - orc_program_add_parameter (p, 2, "p2"); - 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_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_P1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_P2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C3, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T1, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T3, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->params[ORC_VAR_P1] = p1; - ex->params[ORC_VAR_P2] = p2; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_matrix3_u8 */ -#ifdef DISABLE_ORC -void -orc_matrix3_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int p2, int p3, int p4, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var34; - orc_union16 var35; - orc_int8 var36; - orc_union16 var37; - orc_int8 var38; - orc_union16 var39; - orc_union16 var40; - orc_int8 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union16 var51; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - ptr6 = (orc_int8 *) s3; - - /* 2: loadpw */ - var35.i = p1; - /* 6: loadpw */ - var37.i = p2; - /* 11: loadpw */ - var39.i = p3; - /* 14: loadpw */ - var40.i = p4; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: convubw */ - var42.i = (orc_uint8) var34; - /* 3: mullw */ - var43.i = (var42.i * var35.i) & 0xffff; - /* 4: loadb */ - var36 = ptr5[i]; - /* 5: convubw */ - var44.i = (orc_uint8) var36; - /* 7: mullw */ - var45.i = (var44.i * var37.i) & 0xffff; - /* 8: addw */ - var46.i = var43.i + var45.i; - /* 9: loadb */ - var38 = ptr6[i]; - /* 10: convubw */ - var47.i = (orc_uint8) var38; - /* 12: mullw */ - var48.i = (var47.i * var39.i) & 0xffff; - /* 13: addw */ - var49.i = var46.i + var48.i; - /* 15: addw */ - var50.i = var49.i + var40.i; - /* 16: shrsw */ - var51.i = var50.i >> 6; - /* 17: convsuswb */ - var41 = ORC_CLAMP_UB (var51.i); - /* 18: storeb */ - ptr0[i] = var41; - } - -} - -#else -static void -_backup_orc_matrix3_u8 (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var34; - orc_union16 var35; - orc_int8 var36; - orc_union16 var37; - orc_int8 var38; - orc_union16 var39; - orc_union16 var40; - orc_int8 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union16 var51; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - ptr6 = (orc_int8 *) ex->arrays[6]; - - /* 2: loadpw */ - var35.i = ex->params[24]; - /* 6: loadpw */ - var37.i = ex->params[25]; - /* 11: loadpw */ - var39.i = ex->params[26]; - /* 14: loadpw */ - var40.i = ex->params[27]; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: convubw */ - var42.i = (orc_uint8) var34; - /* 3: mullw */ - var43.i = (var42.i * var35.i) & 0xffff; - /* 4: loadb */ - var36 = ptr5[i]; - /* 5: convubw */ - var44.i = (orc_uint8) var36; - /* 7: mullw */ - var45.i = (var44.i * var37.i) & 0xffff; - /* 8: addw */ - var46.i = var43.i + var45.i; - /* 9: loadb */ - var38 = ptr6[i]; - /* 10: convubw */ - var47.i = (orc_uint8) var38; - /* 12: mullw */ - var48.i = (var47.i * var39.i) & 0xffff; - /* 13: addw */ - var49.i = var46.i + var48.i; - /* 15: addw */ - var50.i = var49.i + var40.i; - /* 16: shrsw */ - var51.i = var50.i >> 6; - /* 17: convsuswb */ - var41 = ORC_CLAMP_UB (var51.i); - /* 18: storeb */ - ptr0[i] = var41; - } - -} - -void -orc_matrix3_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int p2, int p3, int p4, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_matrix3_u8"); - orc_program_set_backup_function (p, _backup_orc_matrix3_u8); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_source (p, 1, "s3"); - orc_program_add_constant (p, 4, 0x00000006, "c1"); - orc_program_add_parameter (p, 2, "p1"); - orc_program_add_parameter (p, 2, "p2"); - orc_program_add_parameter (p, 2, "p3"); - orc_program_add_parameter (p, 2, "p4"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, - ORC_VAR_D1); - orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->arrays[ORC_VAR_S3] = (void *) s3; - ex->params[ORC_VAR_P1] = p1; - ex->params[ORC_VAR_P2] = p2; - ex->params[ORC_VAR_P3] = p3; - ex->params[ORC_VAR_P4] = p4; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_matrix3_100_u8 */ -#ifdef DISABLE_ORC -void -orc_matrix3_100_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int p2, int p3, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var35; - orc_union16 var36; - orc_union16 var37; - orc_int8 var38; - orc_union16 var39; - orc_union16 var40; - orc_int8 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - orc_int8 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_union16 var55; - orc_union16 var56; - orc_union16 var57; - orc_union16 var58; - orc_union16 var59; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - ptr6 = (orc_int8 *) s3; - - /* 2: loadpw */ - var36.i = (int) 0x00000010; /* 16 or 7.90505e-323f */ - /* 4: loadpw */ - var37.i = p1; - /* 8: loadpw */ - var39.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - /* 10: loadpw */ - var40.i = p2; - /* 15: loadpw */ - var42.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - /* 17: loadpw */ - var43.i = p3; - /* 20: loadpw */ - var44.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var35 = ptr4[i]; - /* 1: convubw */ - var46.i = (orc_uint8) var35; - /* 3: subw */ - var47.i = var46.i - var36.i; - /* 5: mullw */ - var48.i = (var47.i * var37.i) & 0xffff; - /* 6: loadb */ - var38 = ptr5[i]; - /* 7: convubw */ - var49.i = (orc_uint8) var38; - /* 9: subw */ - var50.i = var49.i - var39.i; - /* 11: mullw */ - var51.i = (var50.i * var40.i) & 0xffff; - /* 12: addw */ - var52.i = var48.i + var51.i; - /* 13: loadb */ - var41 = ptr6[i]; - /* 14: convubw */ - var53.i = (orc_uint8) var41; - /* 16: subw */ - var54.i = var53.i - var42.i; - /* 18: mullw */ - var55.i = (var54.i * var43.i) & 0xffff; - /* 19: addw */ - var56.i = var52.i + var55.i; - /* 21: addw */ - var57.i = var56.i + var44.i; - /* 22: shrsw */ - var58.i = var57.i >> 8; - /* 23: addw */ - var59.i = var58.i + var47.i; - /* 24: convsuswb */ - var45 = ORC_CLAMP_UB (var59.i); - /* 25: storeb */ - ptr0[i] = var45; - } - -} - -#else -static void -_backup_orc_matrix3_100_u8 (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var35; - orc_union16 var36; - orc_union16 var37; - orc_int8 var38; - orc_union16 var39; - orc_union16 var40; - orc_int8 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - orc_int8 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_union16 var55; - orc_union16 var56; - orc_union16 var57; - orc_union16 var58; - orc_union16 var59; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - ptr6 = (orc_int8 *) ex->arrays[6]; - - /* 2: loadpw */ - var36.i = (int) 0x00000010; /* 16 or 7.90505e-323f */ - /* 4: loadpw */ - var37.i = ex->params[24]; - /* 8: loadpw */ - var39.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - /* 10: loadpw */ - var40.i = ex->params[25]; - /* 15: loadpw */ - var42.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - /* 17: loadpw */ - var43.i = ex->params[26]; - /* 20: loadpw */ - var44.i = (int) 0x00000080; /* 128 or 6.32404e-322f */ - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var35 = ptr4[i]; - /* 1: convubw */ - var46.i = (orc_uint8) var35; - /* 3: subw */ - var47.i = var46.i - var36.i; - /* 5: mullw */ - var48.i = (var47.i * var37.i) & 0xffff; - /* 6: loadb */ - var38 = ptr5[i]; - /* 7: convubw */ - var49.i = (orc_uint8) var38; - /* 9: subw */ - var50.i = var49.i - var39.i; - /* 11: mullw */ - var51.i = (var50.i * var40.i) & 0xffff; - /* 12: addw */ - var52.i = var48.i + var51.i; - /* 13: loadb */ - var41 = ptr6[i]; - /* 14: convubw */ - var53.i = (orc_uint8) var41; - /* 16: subw */ - var54.i = var53.i - var42.i; - /* 18: mullw */ - var55.i = (var54.i * var43.i) & 0xffff; - /* 19: addw */ - var56.i = var52.i + var55.i; - /* 21: addw */ - var57.i = var56.i + var44.i; - /* 22: shrsw */ - var58.i = var57.i >> 8; - /* 23: addw */ - var59.i = var58.i + var47.i; - /* 24: convsuswb */ - var45 = ORC_CLAMP_UB (var59.i); - /* 25: storeb */ - ptr0[i] = var45; - } - -} - -void -orc_matrix3_100_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int p2, int p3, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_matrix3_100_u8"); - orc_program_set_backup_function (p, _backup_orc_matrix3_100_u8); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_source (p, 1, "s3"); - orc_program_add_constant (p, 4, 0x00000010, "c1"); - orc_program_add_constant (p, 4, 0x00000080, "c2"); - orc_program_add_constant (p, 4, 0x00000008, "c3"); - orc_program_add_parameter (p, 2, "p1"); - orc_program_add_parameter (p, 2, "p2"); - orc_program_add_parameter (p, 2, "p3"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - orc_program_add_temporary (p, 2, "t3"); - - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_P1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C2, - ORC_VAR_D1); - orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C3, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T1, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T3, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->arrays[ORC_VAR_S3] = (void *) s3; - ex->params[ORC_VAR_P1] = p1; - ex->params[ORC_VAR_P2] = p2; - ex->params[ORC_VAR_P3] = p3; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_matrix3_100_offset_u8 */ -#ifdef DISABLE_ORC -void -orc_matrix3_100_offset_u8 (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, - const guint8 * ORC_RESTRICT s3, int p1, int p2, int p3, int p4, int p5, - int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var35; - orc_union16 var36; - orc_int8 var37; - orc_union16 var38; - orc_int8 var39; - orc_union16 var40; - orc_union16 var41; - orc_int8 var42; - orc_union16 var43; - orc_union16 var44; - orc_union16 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; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - ptr6 = (orc_int8 *) s3; - - /* 2: loadpw */ - var36.i = p1; - /* 6: loadpw */ - var38.i = p2; - /* 11: loadpw */ - var40.i = p3; - /* 14: loadpw */ - var41.i = p4; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var35 = ptr4[i]; - /* 1: convubw */ - var43.i = (orc_uint8) var35; - /* 3: mullw */ - var44.i = (var43.i * var36.i) & 0xffff; - /* 4: loadb */ - var37 = ptr5[i]; - /* 5: convubw */ - var45.i = (orc_uint8) var37; - /* 7: mullw */ - var46.i = (var45.i * var38.i) & 0xffff; - /* 8: addw */ - var47.i = var44.i + var46.i; - /* 9: loadb */ - var39 = ptr6[i]; - /* 10: convubw */ - var48.i = (orc_uint8) var39; - /* 12: mullw */ - var49.i = (var48.i * var40.i) & 0xffff; - /* 13: addw */ - var50.i = var47.i + var49.i; - /* 15: addw */ - var51.i = var50.i + var41.i; - /* 16: shrsw */ - var52.i = var51.i >> p5; - /* 17: addw */ - var53.i = var52.i + var43.i; - /* 18: convsuswb */ - var42 = ORC_CLAMP_UB (var53.i); - /* 19: storeb */ - ptr0[i] = var42; - } - -} - -#else -static void -_backup_orc_matrix3_100_offset_u8 (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var35; - orc_union16 var36; - orc_int8 var37; - orc_union16 var38; - orc_int8 var39; - orc_union16 var40; - orc_union16 var41; - orc_int8 var42; - orc_union16 var43; - orc_union16 var44; - orc_union16 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; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - ptr6 = (orc_int8 *) ex->arrays[6]; - - /* 2: loadpw */ - var36.i = ex->params[24]; - /* 6: loadpw */ - var38.i = ex->params[25]; - /* 11: loadpw */ - var40.i = ex->params[26]; - /* 14: loadpw */ - var41.i = ex->params[27]; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var35 = ptr4[i]; - /* 1: convubw */ - var43.i = (orc_uint8) var35; - /* 3: mullw */ - var44.i = (var43.i * var36.i) & 0xffff; - /* 4: loadb */ - var37 = ptr5[i]; - /* 5: convubw */ - var45.i = (orc_uint8) var37; - /* 7: mullw */ - var46.i = (var45.i * var38.i) & 0xffff; - /* 8: addw */ - var47.i = var44.i + var46.i; - /* 9: loadb */ - var39 = ptr6[i]; - /* 10: convubw */ - var48.i = (orc_uint8) var39; - /* 12: mullw */ - var49.i = (var48.i * var40.i) & 0xffff; - /* 13: addw */ - var50.i = var47.i + var49.i; - /* 15: addw */ - var51.i = var50.i + var41.i; - /* 16: shrsw */ - var52.i = var51.i >> ex->params[28]; - /* 17: addw */ - var53.i = var52.i + var43.i; - /* 18: convsuswb */ - var42 = ORC_CLAMP_UB (var53.i); - /* 19: storeb */ - ptr0[i] = var42; - } - -} - -void -orc_matrix3_100_offset_u8 (guint8 * ORC_RESTRICT d1, - const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, - const guint8 * ORC_RESTRICT s3, int p1, int p2, int p3, int p4, int p5, - int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_matrix3_100_offset_u8"); - orc_program_set_backup_function (p, _backup_orc_matrix3_100_offset_u8); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_source (p, 1, "s3"); - orc_program_add_parameter (p, 2, "p1"); - orc_program_add_parameter (p, 2, "p2"); - orc_program_add_parameter (p, 2, "p3"); - orc_program_add_parameter (p, 2, "p4"); - orc_program_add_parameter (p, 2, "p5"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - orc_program_add_temporary (p, 2, "t3"); - - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_P1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, - ORC_VAR_D1); - orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P5, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T3, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->arrays[ORC_VAR_S3] = (void *) s3; - ex->params[ORC_VAR_P1] = p1; - ex->params[ORC_VAR_P2] = p2; - ex->params[ORC_VAR_P3] = p3; - ex->params[ORC_VAR_P4] = p4; - ex->params[ORC_VAR_P5] = p5; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_matrix3_000_u8 */ -#ifdef DISABLE_ORC -void -orc_matrix3_000_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int p2, int p3, int p4, int p5, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var34; - orc_union16 var35; - orc_int8 var36; - orc_union16 var37; - orc_int8 var38; - orc_union16 var39; - orc_union16 var40; - orc_int8 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union16 var51; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - ptr6 = (orc_int8 *) s3; - - /* 2: loadpw */ - var35.i = p1; - /* 6: loadpw */ - var37.i = p2; - /* 11: loadpw */ - var39.i = p3; - /* 14: loadpw */ - var40.i = p4; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: convubw */ - var42.i = (orc_uint8) var34; - /* 3: mullw */ - var43.i = (var42.i * var35.i) & 0xffff; - /* 4: loadb */ - var36 = ptr5[i]; - /* 5: convubw */ - var44.i = (orc_uint8) var36; - /* 7: mullw */ - var45.i = (var44.i * var37.i) & 0xffff; - /* 8: addw */ - var46.i = var43.i + var45.i; - /* 9: loadb */ - var38 = ptr6[i]; - /* 10: convubw */ - var47.i = (orc_uint8) var38; - /* 12: mullw */ - var48.i = (var47.i * var39.i) & 0xffff; - /* 13: addw */ - var49.i = var46.i + var48.i; - /* 15: addw */ - var50.i = var49.i + var40.i; - /* 16: shrsw */ - var51.i = var50.i >> p5; - /* 17: convwb */ - var41 = var51.i; - /* 18: storeb */ - ptr0[i] = var41; - } - -} - -#else -static void -_backup_orc_matrix3_000_u8 (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var34; - orc_union16 var35; - orc_int8 var36; - orc_union16 var37; - orc_int8 var38; - orc_union16 var39; - orc_union16 var40; - orc_int8 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - orc_union16 var45; - orc_union16 var46; - orc_union16 var47; - orc_union16 var48; - orc_union16 var49; - orc_union16 var50; - orc_union16 var51; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - ptr6 = (orc_int8 *) ex->arrays[6]; - - /* 2: loadpw */ - var35.i = ex->params[24]; - /* 6: loadpw */ - var37.i = ex->params[25]; - /* 11: loadpw */ - var39.i = ex->params[26]; - /* 14: loadpw */ - var40.i = ex->params[27]; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: convubw */ - var42.i = (orc_uint8) var34; - /* 3: mullw */ - var43.i = (var42.i * var35.i) & 0xffff; - /* 4: loadb */ - var36 = ptr5[i]; - /* 5: convubw */ - var44.i = (orc_uint8) var36; - /* 7: mullw */ - var45.i = (var44.i * var37.i) & 0xffff; - /* 8: addw */ - var46.i = var43.i + var45.i; - /* 9: loadb */ - var38 = ptr6[i]; - /* 10: convubw */ - var47.i = (orc_uint8) var38; - /* 12: mullw */ - var48.i = (var47.i * var39.i) & 0xffff; - /* 13: addw */ - var49.i = var46.i + var48.i; - /* 15: addw */ - var50.i = var49.i + var40.i; - /* 16: shrsw */ - var51.i = var50.i >> ex->params[28]; - /* 17: convwb */ - var41 = var51.i; - /* 18: storeb */ - ptr0[i] = var41; - } - -} - -void -orc_matrix3_000_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int p2, int p3, int p4, int p5, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_matrix3_000_u8"); - orc_program_set_backup_function (p, _backup_orc_matrix3_000_u8); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_source (p, 1, "s3"); - orc_program_add_parameter (p, 2, "p1"); - orc_program_add_parameter (p, 2, "p2"); - orc_program_add_parameter (p, 2, "p3"); - orc_program_add_parameter (p, 2, "p4"); - orc_program_add_parameter (p, 2, "p5"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, - ORC_VAR_D1); - orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P5, - ORC_VAR_D1); - orc_program_append_2 (p, "convwb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, - ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->arrays[ORC_VAR_S3] = (void *) s3; - ex->params[ORC_VAR_P1] = p1; - ex->params[ORC_VAR_P2] = p2; - ex->params[ORC_VAR_P3] = p3; - ex->params[ORC_VAR_P4] = p4; - ex->params[ORC_VAR_P5] = p5; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_pack_123x */ -#ifdef DISABLE_ORC -void -orc_pack_123x (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int n) -{ - int i; - orc_union32 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var34; - orc_int8 var35; - orc_int8 var36; - orc_int8 var37; - orc_union32 var38; - orc_union16 var39; - orc_union16 var40; - - ptr0 = (orc_union32 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - ptr6 = (orc_int8 *) s3; - - /* 4: loadpb */ - var37 = p1; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: loadb */ - var35 = ptr5[i]; - /* 2: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var34; - _dest.x2[1] = var35; - var39.i = _dest.i; - } - /* 3: loadb */ - var36 = ptr6[i]; - /* 5: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var36; - _dest.x2[1] = var37; - var40.i = _dest.i; - } - /* 6: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var39.i; - _dest.x2[1] = var40.i; - var38.i = _dest.i; - } - /* 7: storel */ - ptr0[i] = var38; - } - -} - -#else -static void -_backup_orc_pack_123x (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_union32 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var34; - orc_int8 var35; - orc_int8 var36; - orc_int8 var37; - orc_union32 var38; - orc_union16 var39; - orc_union16 var40; - - ptr0 = (orc_union32 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - ptr6 = (orc_int8 *) ex->arrays[6]; - - /* 4: loadpb */ - var37 = ex->params[24]; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: loadb */ - var35 = ptr5[i]; - /* 2: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var34; - _dest.x2[1] = var35; - var39.i = _dest.i; - } - /* 3: loadb */ - var36 = ptr6[i]; - /* 5: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var36; - _dest.x2[1] = var37; - var40.i = _dest.i; - } - /* 6: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var39.i; - _dest.x2[1] = var40.i; - var38.i = _dest.i; - } - /* 7: storel */ - ptr0[i] = var38; - } - -} - -void -orc_pack_123x (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_pack_123x"); - orc_program_set_backup_function (p, _backup_orc_pack_123x); - orc_program_add_destination (p, 4, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_source (p, 1, "s3"); - orc_program_add_parameter (p, 1, "p1"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - - orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, - ORC_VAR_D1); - orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_P1, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->arrays[ORC_VAR_S3] = (void *) s3; - ex->params[ORC_VAR_P1] = p1; - - func = p->code_exec; - func (ex); -} -#endif - - -/* orc_pack_x123 */ -#ifdef DISABLE_ORC -void -orc_pack_x123 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int n) -{ - int i; - orc_union32 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var34; - orc_int8 var35; - orc_int8 var36; - orc_int8 var37; - orc_union32 var38; - orc_union16 var39; - orc_union16 var40; - - ptr0 = (orc_union32 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - ptr6 = (orc_int8 *) s3; - - /* 0: loadpb */ - var34 = p1; - - for (i = 0; i < n; i++) { - /* 1: loadb */ - var35 = ptr4[i]; - /* 2: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var34; - _dest.x2[1] = var35; - var39.i = _dest.i; - } - /* 3: loadb */ - var36 = ptr5[i]; - /* 4: loadb */ - var37 = ptr6[i]; - /* 5: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var36; - _dest.x2[1] = var37; - var40.i = _dest.i; - } - /* 6: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var39.i; - _dest.x2[1] = var40.i; - var38.i = _dest.i; - } - /* 7: storel */ - ptr0[i] = var38; - } - -} - -#else -static void -_backup_orc_pack_x123 (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_union32 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - const orc_int8 *ORC_RESTRICT ptr6; - orc_int8 var34; - orc_int8 var35; - orc_int8 var36; - orc_int8 var37; - orc_union32 var38; - orc_union16 var39; - orc_union16 var40; - - ptr0 = (orc_union32 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - ptr6 = (orc_int8 *) ex->arrays[6]; - - /* 0: loadpb */ - var34 = ex->params[24]; - - for (i = 0; i < n; i++) { - /* 1: loadb */ - var35 = ptr4[i]; - /* 2: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var34; - _dest.x2[1] = var35; - var39.i = _dest.i; - } - /* 3: loadb */ - var36 = ptr5[i]; - /* 4: loadb */ - var37 = ptr6[i]; - /* 5: mergebw */ - { - orc_union16 _dest; - _dest.x2[0] = var36; - _dest.x2[1] = var37; - var40.i = _dest.i; - } - /* 6: mergewl */ - { - orc_union32 _dest; - _dest.x2[0] = var39.i; - _dest.x2[1] = var40.i; - var38.i = _dest.i; - } - /* 7: storel */ - ptr0[i] = var38; - } - -} - -void -orc_pack_x123 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, - int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "orc_pack_x123"); - orc_program_set_backup_function (p, _backup_orc_pack_x123); - orc_program_add_destination (p, 4, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_source (p, 1, "s3"); - orc_program_add_parameter (p, 1, "p1"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - - orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_S1, - ORC_VAR_D1); - orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_S3, - ORC_VAR_D1); - orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->arrays[ORC_VAR_S3] = (void *) s3; - ex->params[ORC_VAR_P1] = p1; - - func = p->code_exec; - func (ex); -} -#endif - - -/* cogorc_combine2_u8 */ -#ifdef DISABLE_ORC -void -cogorc_combine2_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, int p1, int p2, int n) -{ - int i; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var34; - orc_union16 var35; - orc_int8 var36; - orc_union16 var37; - orc_int8 var38; - orc_union16 var39; - orc_union16 var40; - orc_union16 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - - ptr0 = (orc_int8 *) d1; - ptr4 = (orc_int8 *) s1; - ptr5 = (orc_int8 *) s2; - - /* 2: loadpw */ - var35.i = p1; - /* 6: loadpw */ - var37.i = p2; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: convubw */ - var39.i = (orc_uint8) var34; - /* 3: mullw */ - var40.i = (var39.i * var35.i) & 0xffff; - /* 4: loadb */ - var36 = ptr5[i]; - /* 5: convubw */ - var41.i = (orc_uint8) var36; - /* 7: mullw */ - var42.i = (var41.i * var37.i) & 0xffff; - /* 8: addw */ - var43.i = var40.i + var42.i; - /* 9: shruw */ - var44.i = ((orc_uint16) var43.i) >> 8; - /* 10: convsuswb */ - var38 = ORC_CLAMP_UB (var44.i); - /* 11: storeb */ - ptr0[i] = var38; - } - -} - -#else -static void -_backup_cogorc_combine2_u8 (OrcExecutor * ORC_RESTRICT ex) -{ - int i; - int n = ex->n; - orc_int8 *ORC_RESTRICT ptr0; - const orc_int8 *ORC_RESTRICT ptr4; - const orc_int8 *ORC_RESTRICT ptr5; - orc_int8 var34; - orc_union16 var35; - orc_int8 var36; - orc_union16 var37; - orc_int8 var38; - orc_union16 var39; - orc_union16 var40; - orc_union16 var41; - orc_union16 var42; - orc_union16 var43; - orc_union16 var44; - - ptr0 = (orc_int8 *) ex->arrays[0]; - ptr4 = (orc_int8 *) ex->arrays[4]; - ptr5 = (orc_int8 *) ex->arrays[5]; - - /* 2: loadpw */ - var35.i = ex->params[24]; - /* 6: loadpw */ - var37.i = ex->params[25]; - - for (i = 0; i < n; i++) { - /* 0: loadb */ - var34 = ptr4[i]; - /* 1: convubw */ - var39.i = (orc_uint8) var34; - /* 3: mullw */ - var40.i = (var39.i * var35.i) & 0xffff; - /* 4: loadb */ - var36 = ptr5[i]; - /* 5: convubw */ - var41.i = (orc_uint8) var36; - /* 7: mullw */ - var42.i = (var41.i * var37.i) & 0xffff; - /* 8: addw */ - var43.i = var40.i + var42.i; - /* 9: shruw */ - var44.i = ((orc_uint16) var43.i) >> 8; - /* 10: convsuswb */ - var38 = ORC_CLAMP_UB (var44.i); - /* 11: storeb */ - ptr0[i] = var38; - } - -} - -void -cogorc_combine2_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, - const guint8 * ORC_RESTRICT s2, int p1, int p2, int n) -{ - OrcExecutor _ex, *ex = &_ex; - static volatile int p_inited = 0; - static OrcProgram *p = 0; - void (*func) (OrcExecutor *); - - if (!p_inited) { - orc_once_mutex_lock (); - if (!p_inited) { - - p = orc_program_new (); - orc_program_set_name (p, "cogorc_combine2_u8"); - orc_program_set_backup_function (p, _backup_cogorc_combine2_u8); - orc_program_add_destination (p, 1, "d1"); - orc_program_add_source (p, 1, "s1"); - orc_program_add_source (p, 1, "s2"); - orc_program_add_constant (p, 4, 0x00000008, "c1"); - orc_program_add_parameter (p, 2, "p1"); - orc_program_add_parameter (p, 2, "p2"); - orc_program_add_temporary (p, 2, "t1"); - orc_program_add_temporary (p, 2, "t2"); - - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, - ORC_VAR_D1); - orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, - ORC_VAR_D1); - orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, - ORC_VAR_D1); - orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, - ORC_VAR_D1); - orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, - ORC_VAR_D1); - orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, - ORC_VAR_D1, ORC_VAR_D1); - - orc_program_compile (p); - } - p_inited = TRUE; - orc_once_mutex_unlock (); - } - ex->program = p; - - ex->n = n; - ex->arrays[ORC_VAR_D1] = d1; - ex->arrays[ORC_VAR_S1] = (void *) s1; - ex->arrays[ORC_VAR_S2] = (void *) s2; - ex->params[ORC_VAR_P1] = p1; - ex->params[ORC_VAR_P2] = p2; - - func = p->code_exec; - func (ex); -} -#endif - - /* cogorc_convert_I420_UYVY */ #ifdef DISABLE_ORC void diff --git a/gst/videoconvert/gstvideoconvertorc-dist.h b/gst/videoconvert/gstvideoconvertorc-dist.h index 6ba5ae6ff7..17e7a01ea5 100644 --- a/gst/videoconvert/gstvideoconvertorc-dist.h +++ b/gst/videoconvert/gstvideoconvertorc-dist.h @@ -68,33 +68,6 @@ typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 #endif #endif void cogorc_memcpy_2d (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int n, int m); -void cogorc_downsample_horiz_cosite_1tap (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n); -void cogorc_downsample_horiz_cosite_3tap (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n); -void cogorc_downsample_420_jpeg (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n); -void cogorc_downsample_vert_halfsite_2tap (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n); -void cogorc_downsample_vert_cosite_3tap (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int n); -void cogorc_downsample_vert_halfsite_4tap (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int n); -void cogorc_upsample_horiz_cosite_1tap (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n); -void cogorc_upsample_horiz_cosite (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n); -void cogorc_upsample_vert_avgub (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n); -void orc_unpack_yuyv_y (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n); -void orc_unpack_yuyv_u (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n); -void orc_unpack_yuyv_v (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n); -void orc_pack_yuyv (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int n); -void orc_unpack_uyvy_y (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n); -void orc_unpack_uyvy_u (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n); -void orc_unpack_uyvy_v (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n); -void orc_pack_uyvy (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int n); -void orc_matrix2_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int p1, int p2, int p3, int n); -void orc_matrix2_11_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int p1, int p2, int n); -void orc_matrix2_12_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int p1, int p2, int n); -void orc_matrix3_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, int p2, int p3, int p4, int n); -void orc_matrix3_100_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, int p2, int p3, int n); -void orc_matrix3_100_offset_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, int p2, int p3, int p4, int p5, int n); -void orc_matrix3_000_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, int p2, int p3, int p4, int p5, int n); -void orc_pack_123x (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, int n); -void orc_pack_x123 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, int p1, int n); -void cogorc_combine2_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int p1, int p2, int n); void cogorc_convert_I420_UYVY (guint8 * ORC_RESTRICT d1, guint8 * ORC_RESTRICT d2, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int n); void cogorc_convert_I420_YUY2 (guint8 * ORC_RESTRICT d1, guint8 * ORC_RESTRICT d2, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int n); void cogorc_convert_I420_AYUV (guint8 * ORC_RESTRICT d1, guint8 * ORC_RESTRICT d2, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int n); diff --git a/gst/videoconvert/gstvideoconvertorc.orc b/gst/videoconvert/gstvideoconvertorc.orc index 086990e15e..978a562930 100644 --- a/gst/videoconvert/gstvideoconvertorc.orc +++ b/gst/videoconvert/gstvideoconvertorc.orc @@ -6,470 +6,6 @@ copyb d1, s1 - -.function cogorc_downsample_horiz_cosite_1tap -.dest 1 d1 guint8 -.source 2 s1 guint8 - -select0wb d1, s1 - - -.function cogorc_downsample_horiz_cosite_3tap -.dest 1 d1 guint8 -.source 2 s1 guint8 -.source 2 s2 guint8 -.temp 1 t1 -.temp 1 t2 -.temp 1 t3 -.temp 2 t4 -.temp 2 t5 -.temp 2 t6 - -copyw t4, s1 -select0wb t1, t4 -select1wb t2, t4 -select0wb t3, s2 -convubw t4, t1 -convubw t5, t2 -convubw t6, t3 -mullw t5, t5, 2 -addw t4, t4, t6 -addw t4, t4, t5 -addw t4, t4, 2 -shrsw t4, t4, 2 -convsuswb d1, t4 - - -.function cogorc_downsample_420_jpeg -.dest 1 d1 guint8 -.source 2 s1 guint8 -.source 2 s2 guint8 -.temp 2 t1 -.temp 1 t2 -.temp 1 t3 -.temp 1 t4 -.temp 1 t5 - -copyw t1, s1 -select0wb t2, t1 -select1wb t3, t1 -avgub t2, t2, t3 -copyw t1, s2 -select0wb t4, t1 -select1wb t5, t1 -avgub t4, t4, t5 -avgub d1, t2, t4 - - -.function cogorc_downsample_vert_halfsite_2tap -.dest 1 d1 guint8 -.source 1 s1 guint8 -.source 1 s2 guint8 - -avgub d1, s1, s2 - - -.function cogorc_downsample_vert_cosite_3tap -.dest 1 d1 guint8 -.source 1 s1 guint8 -.source 1 s2 guint8 -.source 1 s3 guint8 -.temp 2 t1 -.temp 2 t2 -.temp 2 t3 - -convubw t1, s1 -convubw t2, s2 -convubw t3, s3 -mullw t2, t2, 2 -addw t1, t1, t3 -addw t1, t1, t2 -addw t1, t1, 2 -shrsw t1, t1, 2 -convsuswb d1, t1 - - - -.function cogorc_downsample_vert_halfsite_4tap -.dest 1 d1 guint8 -.source 1 s1 guint8 -.source 1 s2 guint8 -.source 1 s3 guint8 -.source 1 s4 guint8 -.temp 2 t1 -.temp 2 t2 -.temp 2 t3 -.temp 2 t4 - -convubw t1, s1 -convubw t2, s2 -convubw t3, s3 -convubw t4, s4 -addw t2, t2, t3 -mullw t2, t2, 26 -addw t1, t1, t4 -mullw t1, t1, 6 -addw t2, t2, t1 -addw t2, t2, 32 -shrsw t2, t2, 6 -convsuswb d1, t2 - - -.function cogorc_upsample_horiz_cosite_1tap -.dest 2 d1 guint8 guint8 -.source 1 s1 guint8 -.temp 1 t1 - -copyb t1, s1 -mergebw d1, t1, t1 - - -.function cogorc_upsample_horiz_cosite -.dest 2 d1 guint8 guint8 -.source 1 s1 guint8 -.source 1 s2 guint8 -.temp 1 t1 -.temp 1 t2 - -copyb t1, s1 -avgub t2, t1, s2 -mergebw d1, t1, t2 - - -.function cogorc_upsample_vert_avgub -.dest 1 d1 guint8 -.source 1 s1 guint8 -.source 1 s2 guint8 - -avgub d1, s1, s2 - - - - -.function orc_unpack_yuyv_y -.dest 1 d1 guint8 -.source 2 s1 guint8 - -select0wb d1, s1 - - -.function orc_unpack_yuyv_u -.dest 1 d1 guint8 -.source 4 s1 guint8 -.temp 2 t1 - -select0lw t1, s1 -select1wb d1, t1 - - -.function orc_unpack_yuyv_v -.dest 1 d1 guint8 -.source 4 s1 guint8 -.temp 2 t1 - -select1lw t1, s1 -select1wb d1, t1 - - -.function orc_pack_yuyv -.dest 4 d1 guint8 -.source 2 s1 guint8 guint8 -.source 1 s2 guint8 -.source 1 s3 guint8 -.temp 1 t1 -.temp 1 t2 -.temp 2 t3 -.temp 2 t4 -.temp 2 t5 - -copyw t5, s1 -select0wb t1, t5 -select1wb t2, t5 -mergebw t3, t1, s2 -mergebw t4, t2, s3 -mergewl d1, t3, t4 - - -.function orc_unpack_uyvy_y -.dest 1 d1 guint8 -.source 2 s1 guint8 - -select1wb d1, s1 - - -.function orc_unpack_uyvy_u -.dest 1 d1 guint8 -.source 4 s1 guint8 -.temp 2 t1 - -select0lw t1, s1 -select0wb d1, t1 - - -.function orc_unpack_uyvy_v -.dest 1 d1 guint8 -.source 4 s1 guint8 -.temp 2 t1 - -select1lw t1, s1 -select0wb d1, t1 - - -.function orc_pack_uyvy -.dest 4 d1 guint8 -.source 2 s1 guint8 guint8 -.source 1 s2 guint8 -.source 1 s3 guint8 -.temp 1 t1 -.temp 1 t2 -.temp 2 t3 -.temp 2 t4 -.temp 2 t5 - -copyw t5, s1 -select0wb t1, t5 -select1wb t2, t5 -mergebw t3, s2, t1 -mergebw t4, s3, t2 -mergewl d1, t3, t4 - - -.function orc_matrix2_u8 -.dest 1 d1 guint8 guint8 -.source 1 s1 guint8 guint8 -.source 1 s2 guint8 guint8 -.param 2 p1 -.param 2 p2 -.param 2 p3 -.temp 2 t1 -.temp 2 t2 - -convubw t1, s1 -mullw t1, t1, p1 -convubw t2, s2 -mullw t2, t2, p2 -addw t1, t1, t2 -addw t1, t1, p3 -shrsw t1, t1, 6 -convsuswb d1, t1 - - -.function orc_matrix2_11_u8 -.dest 1 d1 guint8 guint8 -.source 1 s1 guint8 guint8 -.source 1 s2 guint8 guint8 -.param 2 p1 -.param 2 p2 -.temp 2 t1 -.temp 2 t2 -.temp 2 t3 -.temp 2 t4 - -convubw t1, s1 -subw t1, t1, 16 -mullw t3, t1, p1 -convubw t2, s2 -subw t2, t2, 128 -mullw t4, t2, p2 -addw t3, t3, t4 -addw t3, t3, 128 -shrsw t3, t3, 8 -addw t3, t3, t1 -addw t3, t3, t2 -convsuswb d1, t3 - - -.function orc_matrix2_12_u8 -.dest 1 d1 guint8 guint8 -.source 1 s1 guint8 guint8 -.source 1 s2 guint8 guint8 -.param 2 p1 -.param 2 p2 -.temp 2 t1 -.temp 2 t2 -.temp 2 t3 -.temp 2 t4 - -convubw t1, s1 -subw t1, t1, 16 -mullw t3, t1, p1 -convubw t2, s2 -subw t2, t2, 128 -mullw t4, t2, p2 -addw t3, t3, t4 -addw t3, t3, 128 -shrsw t3, t3, 8 -addw t3, t3, t1 -addw t3, t3, t2 -addw t3, t3, t2 -convsuswb d1, t3 - - -.function orc_matrix3_u8 -.dest 1 d1 guint8 guint8 -.source 1 s1 guint8 guint8 -.source 1 s2 guint8 guint8 -.source 1 s3 guint8 guint8 -.param 2 p1 -.param 2 p2 -.param 2 p3 -.param 2 p4 -.temp 2 t1 -.temp 2 t2 - -convubw t1, s1 -mullw t1, t1, p1 -convubw t2, s2 -mullw t2, t2, p2 -addw t1, t1, t2 -convubw t2, s3 -mullw t2, t2, p3 -addw t1, t1, t2 -addw t1, t1, p4 -shrsw t1, t1, 6 -convsuswb d1, t1 - - -.function orc_matrix3_100_u8 -.dest 1 d1 guint8 guint8 -.source 1 s1 guint8 guint8 -.source 1 s2 guint8 guint8 -.source 1 s3 guint8 guint8 -.param 2 p1 -.param 2 p2 -.param 2 p3 -.temp 2 t1 -.temp 2 t2 -.temp 2 t3 -#.temp 2 t4 - -convubw t1, s1 -subw t1, t1, 16 -mullw t3, t1, p1 -convubw t2, s2 -subw t2, t2, 128 -mullw t2, t2, p2 -addw t3, t3, t2 -convubw t2, s3 -subw t2, t2, 128 -mullw t2, t2, p3 -addw t3, t3, t2 -addw t3, t3, 128 -shrsw t3, t3, 8 -addw t3, t3, t1 -convsuswb d1, t3 - - -.function orc_matrix3_100_offset_u8 -.dest 1 d1 guint8 guint8 -.source 1 s1 guint8 guint8 -.source 1 s2 guint8 guint8 -.source 1 s3 guint8 guint8 -.param 2 p1 -.param 2 p2 -.param 2 p3 -.param 2 p4 -.param 2 p5 -#.param 2 p6 -.temp 2 t1 -.temp 2 t2 -.temp 2 t3 -#.temp 2 t3 -#.temp 2 t4 - -convubw t3, s1 -mullw t1, t3, p1 -convubw t2, s2 -mullw t2, t2, p2 -addw t1, t1, t2 -convubw t2, s3 -mullw t2, t2, p3 -addw t1, t1, t2 -addw t1, t1, p4 -shrsw t1, t1, p5 -#addw t1, t1, p6 -addw t1, t1, t3 -convsuswb d1, t1 - - - -.function orc_matrix3_000_u8 -.dest 1 d1 guint8 guint8 -.source 1 s1 guint8 guint8 -.source 1 s2 guint8 guint8 -.source 1 s3 guint8 guint8 -.param 2 p1 -.param 2 p2 -.param 2 p3 -.param 2 p4 -.param 2 p5 -#.param 2 p6 -.temp 2 t1 -.temp 2 t2 -#.temp 2 t3 -#.temp 2 t4 - -convubw t1, s1 -mullw t1, t1, p1 -convubw t2, s2 -mullw t2, t2, p2 -addw t1, t1, t2 -convubw t2, s3 -mullw t2, t2, p3 -addw t1, t1, t2 -addw t1, t1, p4 -shrsw t1, t1, p5 -#addw t1, t1, p6 -convwb d1, t1 - - - -.function orc_pack_123x -.dest 4 d1 guint32 guint8 -.source 1 s1 guint8 -.source 1 s2 guint8 -.source 1 s3 guint8 -.param 1 p1 -.temp 2 t1 -.temp 2 t2 - -mergebw t1, s1, s2 -mergebw t2, s3, p1 -mergewl d1, t1, t2 - - -.function orc_pack_x123 -.dest 4 d1 guint32 guint8 -.source 1 s1 guint8 -.source 1 s2 guint8 -.source 1 s3 guint8 -.param 1 p1 -.temp 2 t1 -.temp 2 t2 - -mergebw t1, p1, s1 -mergebw t2, s2, s3 -mergewl d1, t1, t2 - - -.function cogorc_combine2_u8 -.dest 1 d1 guint8 -.source 1 s1 guint8 -.source 1 s2 guint8 -.param 2 p1 -.param 2 p2 -.temp 2 t1 -.temp 2 t2 - -convubw t1, s1 -mullw t1, t1, p1 -convubw t2, s2 -mullw t2, t2, p2 -addw t1, t1, t2 -shruw t1, t1, 8 -convsuswb d1, t1 - - .function cogorc_convert_I420_UYVY .dest 4 d1 guint8 .dest 4 d2 guint8