/* autogenerated from cog.orc */ #define DISABLE_ORC #ifndef DISABLE_ORC #include #else #include #endif #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #define ORC_ABS(a) ((a)<0 ? -(a) : (a)) #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b)) #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b)) #define ORC_SB_MAX 127 #define ORC_SB_MIN (-1-ORC_SB_MAX) #define ORC_UB_MAX 255 #define ORC_UB_MIN 0 #define ORC_SW_MAX 32767 #define ORC_SW_MIN (-1-ORC_SW_MAX) #define ORC_UW_MAX 65535 #define ORC_UW_MIN 0 #define ORC_SL_MAX 2147483647 #define ORC_SL_MIN (-1-ORC_SL_MAX) #define ORC_UL_MAX 4294967295U #define ORC_UL_MIN 0 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX) #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX) #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX) #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX) #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX) #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8)) #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) /* cogorc_downsample_horiz_cosite_3tap */ #ifdef DISABLE_ORC void cogorc_downsample_horiz_cosite_3tap (uint8_t * d1, uint16_t * s1, uint16_t * s2, int n) { int i; int8_t *var0; const int16_t *var4; const int16_t *var5; const int16_t var16 = 2; const int16_t var17 = 2; const int16_t var18 = 2; int8_t var32; int8_t var33; int8_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; int16_t var39; int16_t var40; int16_t var41; int16_t var42; int16_t var43; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; for (i = 0; i < n; i++) { /* 0: copyw */ var35 = var4[i]; /* 1: select0wb */ var32 = (uint16_t) var35 & 0xff; /* 2: select1wb */ var33 = ((uint16_t) var35 >> 8) & 0xff; /* 3: select0wb */ var34 = (uint16_t) var5[i] & 0xff; /* 4: convubw */ var38 = (uint8_t) var32; /* 5: convubw */ var36 = (uint8_t) var33; /* 6: convubw */ var37 = (uint8_t) var34; /* 7: mullw */ var39 = (var36 * var16) & 0xffff; /* 8: addw */ var40 = var38 + var37; /* 9: addw */ var41 = var40 + var39; /* 10: addw */ var42 = var41 + var17; /* 11: shrsw */ var43 = var42 >> var18; /* 12: convsuswb */ var0[i] = ORC_CLAMP_UB (var43); } } #else static void _backup_cogorc_downsample_horiz_cosite_3tap (OrcExecutor * ex) { int i; int8_t *var0; const int16_t *var4; const int16_t *var5; const int16_t var16 = 2; const int16_t var17 = 2; const int16_t var18 = 2; int8_t var32; int8_t var33; int8_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; int16_t var39; int16_t var40; int16_t var41; int16_t var42; int16_t var43; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; for (i = 0; i < ex->n; i++) { /* 0: copyw */ var35 = var4[i]; /* 1: select0wb */ var32 = (uint16_t) var35 & 0xff; /* 2: select1wb */ var33 = ((uint16_t) var35 >> 8) & 0xff; /* 3: select0wb */ var34 = (uint16_t) var5[i] & 0xff; /* 4: convubw */ var38 = (uint8_t) var32; /* 5: convubw */ var36 = (uint8_t) var33; /* 6: convubw */ var37 = (uint8_t) var34; /* 7: mullw */ var39 = (var36 * var16) & 0xffff; /* 8: addw */ var40 = var38 + var37; /* 9: addw */ var41 = var40 + var39; /* 10: addw */ var42 = var41 + var17; /* 11: shrsw */ var43 = var42 >> var18; /* 12: convsuswb */ var0[i] = ORC_CLAMP_UB (var43); } } void cogorc_downsample_horiz_cosite_3tap (uint8_t * d1, uint16_t * s1, uint16_t * s2, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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, 2, 2, "c1"); orc_program_add_constant (p, 2, 2, "c2"); orc_program_add_constant (p, 2, 2, "c3"); 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 (p, "copyw", ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "select0wb", ORC_VAR_T1, ORC_VAR_T4, ORC_VAR_D1); orc_program_append (p, "select1wb", ORC_VAR_T2, ORC_VAR_T4, ORC_VAR_D1); orc_program_append (p, "select0wb", ORC_VAR_T3, ORC_VAR_S2, ORC_VAR_D1); orc_program_append (p, "convubw", ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_D1); orc_program_append (p, "convubw", ORC_VAR_T5, ORC_VAR_T2, ORC_VAR_D1); orc_program_append (p, "convubw", ORC_VAR_T6, ORC_VAR_T3, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1); orc_program_append (p, "addw", ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T6); orc_program_append (p, "addw", ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5); orc_program_append (p, "addw", ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C2); orc_program_append (p, "shrsw", ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C3); orc_program_append (p, "convsuswb", ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_D1); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; orc_executor_run (ex); } #endif /* cogorc_downsample_vert_halfsite_2tap */ #ifdef DISABLE_ORC void cogorc_downsample_vert_halfsite_2tap (uint8_t * d1, uint8_t * s1, uint8_t * s2, int n) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; for (i = 0; i < n; i++) { /* 0: avgub */ var0[i] = ((uint8_t) var4[i] + (uint8_t) var5[i] + 1) >> 1; } } #else static void _backup_cogorc_downsample_vert_halfsite_2tap (OrcExecutor * ex) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; for (i = 0; i < ex->n; i++) { /* 0: avgub */ var0[i] = ((uint8_t) var4[i] + (uint8_t) var5[i] + 1) >> 1; } } void cogorc_downsample_vert_halfsite_2tap (uint8_t * d1, uint8_t * s1, uint8_t * s2, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "avgub", ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; orc_executor_run (ex); } #endif /* cogorc_downsample_vert_halfsite_3tap */ #ifdef DISABLE_ORC void cogorc_downsample_vert_halfsite_3tap (uint8_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int n) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int16_t var16 = 2; const int16_t var17 = 2; const int16_t var18 = 2; int16_t var32; int16_t var33; int16_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; int16_t var39; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; var6 = (void *) s3; for (i = 0; i < n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: convubw */ var33 = (uint8_t) var5[i]; /* 2: convubw */ var34 = (uint8_t) var6[i]; /* 3: mullw */ var35 = (var33 * var16) & 0xffff; /* 4: addw */ var36 = var32 + var34; /* 5: addw */ var37 = var36 + var35; /* 6: addw */ var38 = var37 + var17; /* 7: shrsw */ var39 = var38 >> var18; /* 8: convsuswb */ var0[i] = ORC_CLAMP_UB (var39); } } #else static void _backup_cogorc_downsample_vert_halfsite_3tap (OrcExecutor * ex) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int16_t var16 = 2; const int16_t var17 = 2; const int16_t var18 = 2; int16_t var32; int16_t var33; int16_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; int16_t var39; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; var6 = ex->arrays[6]; for (i = 0; i < ex->n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: convubw */ var33 = (uint8_t) var5[i]; /* 2: convubw */ var34 = (uint8_t) var6[i]; /* 3: mullw */ var35 = (var33 * var16) & 0xffff; /* 4: addw */ var36 = var32 + var34; /* 5: addw */ var37 = var36 + var35; /* 6: addw */ var38 = var37 + var17; /* 7: shrsw */ var39 = var38 >> var18; /* 8: convsuswb */ var0[i] = ORC_CLAMP_UB (var39); } } void cogorc_downsample_vert_halfsite_3tap (uint8_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; p = orc_program_new (); orc_program_set_name (p, "cogorc_downsample_vert_halfsite_3tap"); orc_program_set_backup_function (p, _backup_cogorc_downsample_vert_halfsite_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, 2, 2, "c1"); orc_program_add_constant (p, 2, 2, "c2"); orc_program_add_constant (p, 2, 2, "c3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append (p, "convubw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "convubw", ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1); orc_program_append (p, "convubw", ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T3); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2); orc_program_append (p, "shrsw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C3); orc_program_append (p, "convsuswb", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; ex->arrays[ORC_VAR_S3] = s3; orc_executor_run (ex); } #endif /* cogorc_downsample_vert_halfsite_4tap */ #ifdef DISABLE_ORC void cogorc_downsample_vert_halfsite_4tap (uint8_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, uint8_t * s4, int n) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int8_t *var7; const int16_t var16 = 26; const int16_t var17 = 6; const int16_t var18 = 32; const int16_t var19 = 6; int16_t var32; int16_t var33; int16_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; int16_t var39; int16_t var40; int16_t var41; int16_t var42; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; var6 = (void *) s3; var7 = (void *) s4; for (i = 0; i < n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: convubw */ var33 = (uint8_t) var5[i]; /* 2: convubw */ var34 = (uint8_t) var6[i]; /* 3: convubw */ var35 = (uint8_t) var7[i]; /* 4: addw */ var36 = var33 + var34; /* 5: mullw */ var37 = (var36 * var16) & 0xffff; /* 6: addw */ var38 = var32 + var35; /* 7: mullw */ var39 = (var38 * var17) & 0xffff; /* 8: addw */ var40 = var37 + var39; /* 9: addw */ var41 = var40 + var18; /* 10: shrsw */ var42 = var41 >> var19; /* 11: convsuswb */ var0[i] = ORC_CLAMP_UB (var42); } } #else static void _backup_cogorc_downsample_vert_halfsite_4tap (OrcExecutor * ex) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int8_t *var7; const int16_t var16 = 26; const int16_t var17 = 6; const int16_t var18 = 32; const int16_t var19 = 6; int16_t var32; int16_t var33; int16_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; int16_t var39; int16_t var40; int16_t var41; int16_t var42; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; var6 = ex->arrays[6]; var7 = ex->arrays[7]; for (i = 0; i < ex->n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: convubw */ var33 = (uint8_t) var5[i]; /* 2: convubw */ var34 = (uint8_t) var6[i]; /* 3: convubw */ var35 = (uint8_t) var7[i]; /* 4: addw */ var36 = var33 + var34; /* 5: mullw */ var37 = (var36 * var16) & 0xffff; /* 6: addw */ var38 = var32 + var35; /* 7: mullw */ var39 = (var38 * var17) & 0xffff; /* 8: addw */ var40 = var37 + var39; /* 9: addw */ var41 = var40 + var18; /* 10: shrsw */ var42 = var41 >> var19; /* 11: convsuswb */ var0[i] = ORC_CLAMP_UB (var42); } } void cogorc_downsample_vert_halfsite_4tap (uint8_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, uint8_t * s4, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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, 2, 26, "c1"); orc_program_add_constant (p, 2, 6, "c2"); orc_program_add_constant (p, 2, 32, "c3"); orc_program_add_constant (p, 2, 6, "c4"); 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 (p, "convubw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "convubw", ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1); orc_program_append (p, "convubw", ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1); orc_program_append (p, "convubw", ORC_VAR_T4, ORC_VAR_S4, ORC_VAR_D1); orc_program_append (p, "addw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3); orc_program_append (p, "mullw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T4); orc_program_append (p, "mullw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2); orc_program_append (p, "addw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1); orc_program_append (p, "addw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C3); orc_program_append (p, "shrsw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C4); orc_program_append (p, "convsuswb", ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; ex->arrays[ORC_VAR_S3] = s3; ex->arrays[ORC_VAR_S4] = s4; orc_executor_run (ex); } #endif /* cogorc_upsample_horiz_cosite */ #ifdef DISABLE_ORC void cogorc_upsample_horiz_cosite (uint8_t * d1, uint8_t * s1, uint8_t * s2, int n) { int i; int16_t *var0; const int8_t *var4; const int8_t *var5; int8_t var32; int8_t var33; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; for (i = 0; i < n; i++) { /* 0: copyb */ var32 = var4[i]; /* 1: avgub */ var33 = ((uint8_t) var32 + (uint8_t) var5[i] + 1) >> 1; /* 2: mergebw */ var0[i] = ((uint8_t) var32) | ((uint8_t) var33 << 8); } } #else static void _backup_cogorc_upsample_horiz_cosite (OrcExecutor * ex) { int i; int16_t *var0; const int8_t *var4; const int8_t *var5; int8_t var32; int8_t var33; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; for (i = 0; i < ex->n; i++) { /* 0: copyb */ var32 = var4[i]; /* 1: avgub */ var33 = ((uint8_t) var32 + (uint8_t) var5[i] + 1) >> 1; /* 2: mergebw */ var0[i] = ((uint8_t) var32) | ((uint8_t) var33 << 8); } } void cogorc_upsample_horiz_cosite (uint8_t * d1, uint8_t * s1, uint8_t * s2, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "copyb", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "avgub", ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_S2); orc_program_append (p, "mergebw", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; orc_executor_run (ex); } #endif /* cogorc_upsample_vert_avgub */ #ifdef DISABLE_ORC void cogorc_upsample_vert_avgub (uint8_t * d1, uint8_t * s1, uint8_t * s2, int n) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; for (i = 0; i < n; i++) { /* 0: avgub */ var0[i] = ((uint8_t) var4[i] + (uint8_t) var5[i] + 1) >> 1; } } #else static void _backup_cogorc_upsample_vert_avgub (OrcExecutor * ex) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; for (i = 0; i < ex->n; i++) { /* 0: avgub */ var0[i] = ((uint8_t) var4[i] + (uint8_t) var5[i] + 1) >> 1; } } void cogorc_upsample_vert_avgub (uint8_t * d1, uint8_t * s1, uint8_t * s2, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "avgub", ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; orc_executor_run (ex); } #endif /* orc_unpack_yuyv_y */ #ifdef DISABLE_ORC void orc_unpack_yuyv_y (uint8_t * d1, uint16_t * s1, int n) { int i; int8_t *var0; const int16_t *var4; var0 = (void *) d1; var4 = (void *) s1; for (i = 0; i < n; i++) { /* 0: select0wb */ var0[i] = (uint16_t) var4[i] & 0xff; } } #else static void _backup_orc_unpack_yuyv_y (OrcExecutor * ex) { int i; int8_t *var0; const int16_t *var4; var0 = ex->arrays[0]; var4 = ex->arrays[4]; for (i = 0; i < ex->n; i++) { /* 0: select0wb */ var0[i] = (uint16_t) var4[i] & 0xff; } } void orc_unpack_yuyv_y (uint8_t * d1, uint16_t * s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "select0wb", ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); result = 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] = s1; orc_executor_run (ex); } #endif /* orc_unpack_yuyv_u */ #ifdef DISABLE_ORC void orc_unpack_yuyv_u (uint8_t * d1, uint32_t * s1, int n) { int i; int8_t *var0; const int32_t *var4; int16_t var32; var0 = (void *) d1; var4 = (void *) s1; for (i = 0; i < n; i++) { /* 0: select0lw */ var32 = (uint32_t) var4[i] & 0xffff; /* 1: select1wb */ var0[i] = ((uint16_t) var32 >> 8) & 0xff; } } #else static void _backup_orc_unpack_yuyv_u (OrcExecutor * ex) { int i; int8_t *var0; const int32_t *var4; int16_t var32; var0 = ex->arrays[0]; var4 = ex->arrays[4]; for (i = 0; i < ex->n; i++) { /* 0: select0lw */ var32 = (uint32_t) var4[i] & 0xffff; /* 1: select1wb */ var0[i] = ((uint16_t) var32 >> 8) & 0xff; } } void orc_unpack_yuyv_u (uint8_t * d1, uint32_t * s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "select0lw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "select1wb", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); result = 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] = s1; orc_executor_run (ex); } #endif /* orc_unpack_yuyv_v */ #ifdef DISABLE_ORC void orc_unpack_yuyv_v (uint8_t * d1, uint32_t * s1, int n) { int i; int8_t *var0; const int32_t *var4; int16_t var32; var0 = (void *) d1; var4 = (void *) s1; for (i = 0; i < n; i++) { /* 0: select1lw */ var32 = ((uint32_t) var4[i] >> 16) & 0xffff; /* 1: select1wb */ var0[i] = ((uint16_t) var32 >> 8) & 0xff; } } #else static void _backup_orc_unpack_yuyv_v (OrcExecutor * ex) { int i; int8_t *var0; const int32_t *var4; int16_t var32; var0 = ex->arrays[0]; var4 = ex->arrays[4]; for (i = 0; i < ex->n; i++) { /* 0: select1lw */ var32 = ((uint32_t) var4[i] >> 16) & 0xffff; /* 1: select1wb */ var0[i] = ((uint16_t) var32 >> 8) & 0xff; } } void orc_unpack_yuyv_v (uint8_t * d1, uint32_t * s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "select1lw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "select1wb", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); result = 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] = s1; orc_executor_run (ex); } #endif /* orc_pack_yuyv */ #ifdef DISABLE_ORC void orc_pack_yuyv (uint32_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int n) { int i; int32_t *var0; const int16_t *var4; const int8_t *var5; const int8_t *var6; int8_t var32; int8_t var33; int16_t var34; int16_t var35; int16_t var36; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; var6 = (void *) s3; for (i = 0; i < n; i++) { /* 0: copyw */ var36 = var4[i]; /* 1: select0wb */ var32 = (uint16_t) var36 & 0xff; /* 2: select1wb */ var33 = ((uint16_t) var36 >> 8) & 0xff; /* 3: mergebw */ var34 = ((uint8_t) var32) | ((uint8_t) var5[i] << 8); /* 4: mergebw */ var35 = ((uint8_t) var33) | ((uint8_t) var6[i] << 8); /* 5: mergewl */ var0[i] = ((uint16_t) var34) | ((uint16_t) var35 << 16); } } #else static void _backup_orc_pack_yuyv (OrcExecutor * ex) { int i; int32_t *var0; const int16_t *var4; const int8_t *var5; const int8_t *var6; int8_t var32; int8_t var33; int16_t var34; int16_t var35; int16_t var36; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; var6 = ex->arrays[6]; for (i = 0; i < ex->n; i++) { /* 0: copyw */ var36 = var4[i]; /* 1: select0wb */ var32 = (uint16_t) var36 & 0xff; /* 2: select1wb */ var33 = ((uint16_t) var36 >> 8) & 0xff; /* 3: mergebw */ var34 = ((uint8_t) var32) | ((uint8_t) var5[i] << 8); /* 4: mergebw */ var35 = ((uint8_t) var33) | ((uint8_t) var6[i] << 8); /* 5: mergewl */ var0[i] = ((uint16_t) var34) | ((uint16_t) var35 << 16); } } void orc_pack_yuyv (uint32_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "copyw", ORC_VAR_T5, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "select0wb", ORC_VAR_T1, ORC_VAR_T5, ORC_VAR_D1); orc_program_append (p, "select1wb", ORC_VAR_T2, ORC_VAR_T5, ORC_VAR_D1); orc_program_append (p, "mergebw", ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_S2); orc_program_append (p, "mergebw", ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_S3); orc_program_append (p, "mergewl", ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T4); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; ex->arrays[ORC_VAR_S3] = s3; orc_executor_run (ex); } #endif /* orc_unpack_uyvy_y */ #ifdef DISABLE_ORC void orc_unpack_uyvy_y (uint8_t * d1, uint16_t * s1, int n) { int i; int8_t *var0; const int16_t *var4; var0 = (void *) d1; var4 = (void *) s1; for (i = 0; i < n; i++) { /* 0: select1wb */ var0[i] = ((uint16_t) var4[i] >> 8) & 0xff; } } #else static void _backup_orc_unpack_uyvy_y (OrcExecutor * ex) { int i; int8_t *var0; const int16_t *var4; var0 = ex->arrays[0]; var4 = ex->arrays[4]; for (i = 0; i < ex->n; i++) { /* 0: select1wb */ var0[i] = ((uint16_t) var4[i] >> 8) & 0xff; } } void orc_unpack_uyvy_y (uint8_t * d1, uint16_t * s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "select1wb", ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); result = 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] = s1; orc_executor_run (ex); } #endif /* orc_unpack_uyvy_u */ #ifdef DISABLE_ORC void orc_unpack_uyvy_u (uint8_t * d1, uint32_t * s1, int n) { int i; int8_t *var0; const int32_t *var4; int16_t var32; var0 = (void *) d1; var4 = (void *) s1; for (i = 0; i < n; i++) { /* 0: select0lw */ var32 = (uint32_t) var4[i] & 0xffff; /* 1: select0wb */ var0[i] = (uint16_t) var32 & 0xff; } } #else static void _backup_orc_unpack_uyvy_u (OrcExecutor * ex) { int i; int8_t *var0; const int32_t *var4; int16_t var32; var0 = ex->arrays[0]; var4 = ex->arrays[4]; for (i = 0; i < ex->n; i++) { /* 0: select0lw */ var32 = (uint32_t) var4[i] & 0xffff; /* 1: select0wb */ var0[i] = (uint16_t) var32 & 0xff; } } void orc_unpack_uyvy_u (uint8_t * d1, uint32_t * s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "select0lw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "select0wb", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); result = 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] = s1; orc_executor_run (ex); } #endif /* orc_unpack_uyvy_v */ #ifdef DISABLE_ORC void orc_unpack_uyvy_v (uint8_t * d1, uint32_t * s1, int n) { int i; int8_t *var0; const int32_t *var4; int16_t var32; var0 = (void *) d1; var4 = (void *) s1; for (i = 0; i < n; i++) { /* 0: select1lw */ var32 = ((uint32_t) var4[i] >> 16) & 0xffff; /* 1: select0wb */ var0[i] = (uint16_t) var32 & 0xff; } } #else static void _backup_orc_unpack_uyvy_v (OrcExecutor * ex) { int i; int8_t *var0; const int32_t *var4; int16_t var32; var0 = ex->arrays[0]; var4 = ex->arrays[4]; for (i = 0; i < ex->n; i++) { /* 0: select1lw */ var32 = ((uint32_t) var4[i] >> 16) & 0xffff; /* 1: select0wb */ var0[i] = (uint16_t) var32 & 0xff; } } void orc_unpack_uyvy_v (uint8_t * d1, uint32_t * s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "select1lw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "select0wb", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); result = 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] = s1; orc_executor_run (ex); } #endif /* orc_pack_uyvy */ #ifdef DISABLE_ORC void orc_pack_uyvy (uint32_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int n) { int i; int32_t *var0; const int16_t *var4; const int8_t *var5; const int8_t *var6; int8_t var32; int8_t var33; int16_t var34; int16_t var35; int16_t var36; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; var6 = (void *) s3; for (i = 0; i < n; i++) { /* 0: copyw */ var36 = var4[i]; /* 1: select0wb */ var32 = (uint16_t) var36 & 0xff; /* 2: select1wb */ var33 = ((uint16_t) var36 >> 8) & 0xff; /* 3: mergebw */ var34 = ((uint8_t) var5[i]) | ((uint8_t) var32 << 8); /* 4: mergebw */ var35 = ((uint8_t) var6[i]) | ((uint8_t) var33 << 8); /* 5: mergewl */ var0[i] = ((uint16_t) var34) | ((uint16_t) var35 << 16); } } #else static void _backup_orc_pack_uyvy (OrcExecutor * ex) { int i; int32_t *var0; const int16_t *var4; const int8_t *var5; const int8_t *var6; int8_t var32; int8_t var33; int16_t var34; int16_t var35; int16_t var36; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; var6 = ex->arrays[6]; for (i = 0; i < ex->n; i++) { /* 0: copyw */ var36 = var4[i]; /* 1: select0wb */ var32 = (uint16_t) var36 & 0xff; /* 2: select1wb */ var33 = ((uint16_t) var36 >> 8) & 0xff; /* 3: mergebw */ var34 = ((uint8_t) var5[i]) | ((uint8_t) var32 << 8); /* 4: mergebw */ var35 = ((uint8_t) var6[i]) | ((uint8_t) var33 << 8); /* 5: mergewl */ var0[i] = ((uint16_t) var34) | ((uint16_t) var35 << 16); } } void orc_pack_uyvy (uint32_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "copyw", ORC_VAR_T5, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "select0wb", ORC_VAR_T1, ORC_VAR_T5, ORC_VAR_D1); orc_program_append (p, "select1wb", ORC_VAR_T2, ORC_VAR_T5, ORC_VAR_D1); orc_program_append (p, "mergebw", ORC_VAR_T3, ORC_VAR_S2, ORC_VAR_T1); orc_program_append (p, "mergebw", ORC_VAR_T4, ORC_VAR_S3, ORC_VAR_T2); orc_program_append (p, "mergewl", ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T4); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; ex->arrays[ORC_VAR_S3] = s3; orc_executor_run (ex); } #endif /* orc_memcpy */ #ifdef DISABLE_ORC void orc_memcpy (void *d1, void *s1, int n) { int i; int8_t *var0; const int8_t *var4; var0 = (void *) d1; var4 = (void *) s1; for (i = 0; i < n; i++) { /* 0: copyb */ var0[i] = var4[i]; } } #else static void _backup_orc_memcpy (OrcExecutor * ex) { int i; int8_t *var0; const int8_t *var4; var0 = ex->arrays[0]; var4 = ex->arrays[4]; for (i = 0; i < ex->n; i++) { /* 0: copyb */ var0[i] = var4[i]; } } void orc_memcpy (void *d1, void *s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; p = orc_program_new (); orc_program_set_name (p, "orc_memcpy"); orc_program_set_backup_function (p, _backup_orc_memcpy); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_append (p, "copyb", ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); result = 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] = s1; orc_executor_run (ex); } #endif /* orc_addc_convert_u8_s16 */ #ifdef DISABLE_ORC void orc_addc_convert_u8_s16 (uint8_t * d1, int16_t * s1, int n) { int i; int8_t *var0; const int16_t *var4; const int16_t var16 = 128; int16_t var32; var0 = (void *) d1; var4 = (void *) s1; for (i = 0; i < n; i++) { /* 0: addw */ var32 = var4[i] + var16; /* 1: convsuswb */ var0[i] = ORC_CLAMP_UB (var32); } } #else static void _backup_orc_addc_convert_u8_s16 (OrcExecutor * ex) { int i; int8_t *var0; const int16_t *var4; const int16_t var16 = 128; int16_t var32; var0 = ex->arrays[0]; var4 = ex->arrays[4]; for (i = 0; i < ex->n; i++) { /* 0: addw */ var32 = var4[i] + var16; /* 1: convsuswb */ var0[i] = ORC_CLAMP_UB (var32); } } void orc_addc_convert_u8_s16 (uint8_t * d1, int16_t * s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; p = orc_program_new (); orc_program_set_name (p, "orc_addc_convert_u8_s16"); orc_program_set_backup_function (p, _backup_orc_addc_convert_u8_s16); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 2, 128, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1); orc_program_append (p, "convsuswb", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); result = 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] = s1; orc_executor_run (ex); } #endif /* orc_subc_convert_s16_u8 */ #ifdef DISABLE_ORC void orc_subc_convert_s16_u8 (int16_t * d1, uint8_t * s1, int n) { int i; int16_t *var0; const int8_t *var4; const int16_t var16 = 128; int16_t var32; var0 = (void *) d1; var4 = (void *) s1; for (i = 0; i < n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: subw */ var0[i] = var32 - var16; } } #else static void _backup_orc_subc_convert_s16_u8 (OrcExecutor * ex) { int i; int16_t *var0; const int8_t *var4; const int16_t var16 = 128; int16_t var32; var0 = ex->arrays[0]; var4 = ex->arrays[4]; for (i = 0; i < ex->n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: subw */ var0[i] = var32 - var16; } } void orc_subc_convert_s16_u8 (int16_t * d1, uint8_t * s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; p = orc_program_new (); orc_program_set_name (p, "orc_subc_convert_s16_u8"); orc_program_set_backup_function (p, _backup_orc_subc_convert_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_constant (p, 2, 128, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append (p, "convubw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "subw", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C1); result = 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] = s1; orc_executor_run (ex); } #endif /* orc_splat_u8_ns */ #ifdef DISABLE_ORC void orc_splat_u8_ns (uint8_t * d1, int p1, int n) { int i; int8_t *var0; const int8_t var24 = p1; var0 = (void *) d1; for (i = 0; i < n; i++) { /* 0: copyb */ var0[i] = var24; } } #else static void _backup_orc_splat_u8_ns (OrcExecutor * ex) { int i; int8_t *var0; const int8_t var24 = ex->params[24]; var0 = ex->arrays[0]; for (i = 0; i < ex->n; i++) { /* 0: copyb */ var0[i] = var24; } } void orc_splat_u8_ns (uint8_t * d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; p = orc_program_new (); orc_program_set_name (p, "orc_splat_u8_ns"); orc_program_set_backup_function (p, _backup_orc_splat_u8_ns); orc_program_add_destination (p, 1, "d1"); orc_program_add_parameter (p, 1, "p1"); orc_program_append (p, "copyb", ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1); result = orc_program_compile (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->program = p; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; orc_executor_run (ex); } #endif /* orc_splat_s16_ns */ #ifdef DISABLE_ORC void orc_splat_s16_ns (int16_t * d1, int p1, int n) { int i; int16_t *var0; const int16_t var24 = p1; var0 = (void *) d1; for (i = 0; i < n; i++) { /* 0: copyw */ var0[i] = var24; } } #else static void _backup_orc_splat_s16_ns (OrcExecutor * ex) { int i; int16_t *var0; const int16_t var24 = ex->params[24]; var0 = ex->arrays[0]; for (i = 0; i < ex->n; i++) { /* 0: copyw */ var0[i] = var24; } } void orc_splat_s16_ns (int16_t * d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; p = orc_program_new (); orc_program_set_name (p, "orc_splat_s16_ns"); orc_program_set_backup_function (p, _backup_orc_splat_s16_ns); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append (p, "copyw", ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1); result = orc_program_compile (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->program = p; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; orc_executor_run (ex); } #endif /* orc_matrix2_u8 */ #ifdef DISABLE_ORC void orc_matrix2_u8 (uint8_t * d1, uint8_t * s1, uint8_t * s2, int p1, int p2, int p3, int n) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; const int16_t var16 = 6; const int16_t var24 = p1; const int16_t var25 = p2; const int16_t var26 = p3; int16_t var32; int16_t var33; int16_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; for (i = 0; i < n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: mullw */ var34 = (var32 * var24) & 0xffff; /* 2: convubw */ var33 = (uint8_t) var5[i]; /* 3: mullw */ var35 = (var33 * var25) & 0xffff; /* 4: addw */ var36 = var34 + var35; /* 5: addw */ var37 = var36 + var26; /* 6: shrsw */ var38 = var37 >> var16; /* 7: convsuswb */ var0[i] = ORC_CLAMP_UB (var38); } } #else static void _backup_orc_matrix2_u8 (OrcExecutor * ex) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; const int16_t var16 = 6; const int16_t var24 = ex->params[24]; const int16_t var25 = ex->params[25]; const int16_t var26 = ex->params[26]; int16_t var32; int16_t var33; int16_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; for (i = 0; i < ex->n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: mullw */ var34 = (var32 * var24) & 0xffff; /* 2: convubw */ var33 = (uint8_t) var5[i]; /* 3: mullw */ var35 = (var33 * var25) & 0xffff; /* 4: addw */ var36 = var34 + var35; /* 5: addw */ var37 = var36 + var26; /* 6: shrsw */ var38 = var37 >> var16; /* 7: convsuswb */ var0[i] = ORC_CLAMP_UB (var38); } } void orc_matrix2_u8 (uint8_t * d1, uint8_t * s1, uint8_t * s2, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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, 2, 6, "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 (p, "convubw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1); orc_program_append (p, "convubw", ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3); orc_program_append (p, "shrsw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1); orc_program_append (p, "convsuswb", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; orc_executor_run (ex); } #endif /* orc_matrix3_u8 */ #ifdef DISABLE_ORC void orc_matrix3_u8 (uint8_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int p1, int p2, int p3, int p4, int n) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int16_t var16 = 6; const int16_t var24 = p1; const int16_t var25 = p2; const int16_t var26 = p3; const int16_t var27 = p4; int16_t var32; int16_t var33; int16_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; int16_t var39; int16_t var40; int16_t var41; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; var6 = (void *) s3; for (i = 0; i < n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: mullw */ var34 = (var32 * var24) & 0xffff; /* 2: convubw */ var33 = (uint8_t) var5[i]; /* 3: mullw */ var35 = (var33 * var25) & 0xffff; /* 4: addw */ var36 = var34 + var35; /* 5: convubw */ var37 = (uint8_t) var6[i]; /* 6: mullw */ var38 = (var37 * var26) & 0xffff; /* 7: addw */ var39 = var36 + var38; /* 8: addw */ var40 = var39 + var27; /* 9: shrsw */ var41 = var40 >> var16; /* 10: convsuswb */ var0[i] = ORC_CLAMP_UB (var41); } } #else static void _backup_orc_matrix3_u8 (OrcExecutor * ex) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int16_t var16 = 6; const int16_t var24 = ex->params[24]; const int16_t var25 = ex->params[25]; const int16_t var26 = ex->params[26]; const int16_t var27 = ex->params[27]; int16_t var32; int16_t var33; int16_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; int16_t var39; int16_t var40; int16_t var41; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; var6 = ex->arrays[6]; for (i = 0; i < ex->n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: mullw */ var34 = (var32 * var24) & 0xffff; /* 2: convubw */ var33 = (uint8_t) var5[i]; /* 3: mullw */ var35 = (var33 * var25) & 0xffff; /* 4: addw */ var36 = var34 + var35; /* 5: convubw */ var37 = (uint8_t) var6[i]; /* 6: mullw */ var38 = (var37 * var26) & 0xffff; /* 7: addw */ var39 = var36 + var38; /* 8: addw */ var40 = var39 + var27; /* 9: shrsw */ var41 = var40 >> var16; /* 10: convsuswb */ var0[i] = ORC_CLAMP_UB (var41); } } void orc_matrix3_u8 (uint8_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int p1, int p2, int p3, int p4, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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, 2, 6, "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 (p, "convubw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1); orc_program_append (p, "convubw", ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2); orc_program_append (p, "convubw", ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4); orc_program_append (p, "shrsw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1); orc_program_append (p, "convsuswb", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; ex->arrays[ORC_VAR_S3] = 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; orc_executor_run (ex); } #endif /* orc_pack_123x */ #ifdef DISABLE_ORC void orc_pack_123x (uint32_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int p1, int n) { int i; int32_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int8_t var24 = p1; int16_t var32; int16_t var33; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; var6 = (void *) s3; for (i = 0; i < n; i++) { /* 0: mergebw */ var32 = ((uint8_t) var4[i]) | ((uint8_t) var5[i] << 8); /* 1: mergebw */ var33 = ((uint8_t) var6[i]) | ((uint8_t) var24 << 8); /* 2: mergewl */ var0[i] = ((uint16_t) var32) | ((uint16_t) var33 << 16); } } #else static void _backup_orc_pack_123x (OrcExecutor * ex) { int i; int32_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int8_t var24 = ex->params[24]; int16_t var32; int16_t var33; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; var6 = ex->arrays[6]; for (i = 0; i < ex->n; i++) { /* 0: mergebw */ var32 = ((uint8_t) var4[i]) | ((uint8_t) var5[i] << 8); /* 1: mergebw */ var33 = ((uint8_t) var6[i]) | ((uint8_t) var24 << 8); /* 2: mergewl */ var0[i] = ((uint16_t) var32) | ((uint16_t) var33 << 16); } } void orc_pack_123x (uint32_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "mergebw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2); orc_program_append (p, "mergebw", ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_P1); orc_program_append (p, "mergewl", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; ex->arrays[ORC_VAR_S3] = s3; ex->params[ORC_VAR_P1] = p1; orc_executor_run (ex); } #endif /* orc_pack_x123 */ #ifdef DISABLE_ORC void orc_pack_x123 (uint32_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int p1, int n) { int i; int32_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int8_t var24 = p1; int16_t var32; int16_t var33; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; var6 = (void *) s3; for (i = 0; i < n; i++) { /* 0: mergebw */ var32 = ((uint8_t) var24) | ((uint8_t) var4[i] << 8); /* 1: mergebw */ var33 = ((uint8_t) var5[i]) | ((uint8_t) var6[i] << 8); /* 2: mergewl */ var0[i] = ((uint16_t) var32) | ((uint16_t) var33 << 16); } } #else static void _backup_orc_pack_x123 (OrcExecutor * ex) { int i; int32_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int8_t var24 = ex->params[24]; int16_t var32; int16_t var33; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; var6 = ex->arrays[6]; for (i = 0; i < ex->n; i++) { /* 0: mergebw */ var32 = ((uint8_t) var24) | ((uint8_t) var4[i] << 8); /* 1: mergebw */ var33 = ((uint8_t) var5[i]) | ((uint8_t) var6[i] << 8); /* 2: mergewl */ var0[i] = ((uint16_t) var32) | ((uint16_t) var33 << 16); } } void orc_pack_x123 (uint32_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; 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 (p, "mergebw", ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_S1); orc_program_append (p, "mergebw", ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_S3); orc_program_append (p, "mergewl", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; ex->arrays[ORC_VAR_S3] = s3; ex->params[ORC_VAR_P1] = p1; orc_executor_run (ex); } #endif /* cogorc_combine4_u8 */ #ifdef DISABLE_ORC void cogorc_combine4_u8 (uint8_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, uint8_t * s4, int p1, int p2, int p3, int p4, int n) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int8_t *var7; const int16_t var16 = 32; const int16_t var17 = 6; const int16_t var24 = p1; const int16_t var25 = p2; const int16_t var26 = p3; const int16_t var27 = p4; int16_t var32; int16_t var33; int16_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; int16_t var39; int16_t var40; int16_t var41; int16_t var42; int16_t var43; int16_t var44; var0 = (void *) d1; var4 = (void *) s1; var5 = (void *) s2; var6 = (void *) s3; var7 = (void *) s4; for (i = 0; i < n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: mullw */ var34 = (var32 * var24) & 0xffff; /* 2: convubw */ var33 = (uint8_t) var5[i]; /* 3: mullw */ var35 = (var33 * var25) & 0xffff; /* 4: addw */ var36 = var34 + var35; /* 5: convubw */ var37 = (uint8_t) var6[i]; /* 6: mullw */ var38 = (var37 * var26) & 0xffff; /* 7: addw */ var39 = var36 + var38; /* 8: convubw */ var40 = (uint8_t) var7[i]; /* 9: mullw */ var41 = (var40 * var27) & 0xffff; /* 10: addw */ var42 = var39 + var41; /* 11: addw */ var43 = var42 + var16; /* 12: shrsw */ var44 = var43 >> var17; /* 13: convsuswb */ var0[i] = ORC_CLAMP_UB (var44); } } #else static void _backup_cogorc_combine4_u8 (OrcExecutor * ex) { int i; int8_t *var0; const int8_t *var4; const int8_t *var5; const int8_t *var6; const int8_t *var7; const int16_t var16 = 32; const int16_t var17 = 6; const int16_t var24 = ex->params[24]; const int16_t var25 = ex->params[25]; const int16_t var26 = ex->params[26]; const int16_t var27 = ex->params[27]; int16_t var32; int16_t var33; int16_t var34; int16_t var35; int16_t var36; int16_t var37; int16_t var38; int16_t var39; int16_t var40; int16_t var41; int16_t var42; int16_t var43; int16_t var44; var0 = ex->arrays[0]; var4 = ex->arrays[4]; var5 = ex->arrays[5]; var6 = ex->arrays[6]; var7 = ex->arrays[7]; for (i = 0; i < ex->n; i++) { /* 0: convubw */ var32 = (uint8_t) var4[i]; /* 1: mullw */ var34 = (var32 * var24) & 0xffff; /* 2: convubw */ var33 = (uint8_t) var5[i]; /* 3: mullw */ var35 = (var33 * var25) & 0xffff; /* 4: addw */ var36 = var34 + var35; /* 5: convubw */ var37 = (uint8_t) var6[i]; /* 6: mullw */ var38 = (var37 * var26) & 0xffff; /* 7: addw */ var39 = var36 + var38; /* 8: convubw */ var40 = (uint8_t) var7[i]; /* 9: mullw */ var41 = (var40 * var27) & 0xffff; /* 10: addw */ var42 = var39 + var41; /* 11: addw */ var43 = var42 + var16; /* 12: shrsw */ var44 = var43 >> var17; /* 13: convsuswb */ var0[i] = ORC_CLAMP_UB (var44); } } void cogorc_combine4_u8 (uint8_t * d1, uint8_t * s1, uint8_t * s2, uint8_t * s3, uint8_t * s4, int p1, int p2, int p3, int p4, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; p = orc_program_new (); orc_program_set_name (p, "cogorc_combine4_u8"); orc_program_set_backup_function (p, _backup_cogorc_combine4_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_source (p, 1, "s4"); orc_program_add_constant (p, 2, 32, "c1"); orc_program_add_constant (p, 2, 6, "c2"); 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 (p, "convubw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1); orc_program_append (p, "convubw", ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2); orc_program_append (p, "convubw", ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2); orc_program_append (p, "convubw", ORC_VAR_T2, ORC_VAR_S4, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P4); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1); orc_program_append (p, "shrsw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2); orc_program_append (p, "convsuswb", ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); result = 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] = s1; ex->arrays[ORC_VAR_S2] = s2; ex->arrays[ORC_VAR_S3] = s3; ex->arrays[ORC_VAR_S4] = s4; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; orc_executor_run (ex); } #endif /* cogorc_unpack_ayuv_y */ #ifdef DISABLE_ORC void cogorc_unpack_ayuv_y (uint8_t * d1, uint32_t * s1, int n) { } #else static void _backup_cogorc_unpack_ayuv_y (OrcExecutor * ex) { } void cogorc_unpack_ayuv_y (uint8_t * d1, uint32_t * s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; p = orc_program_new (); orc_program_set_name (p, "cogorc_unpack_ayuv_y"); orc_program_set_backup_function (p, _backup_cogorc_unpack_ayuv_y); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append (p, "select0lw", ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append (p, "select1wb", ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); result = 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] = s1; orc_executor_run (ex); } #endif /* cogorc_unpack_ayuv_u */ #ifdef DISABLE_ORC void cogorc_unpack_ayuv_u (uint8_t * d1, uint32_t * s1, int n) { } #else static void _backup_cogorc_unpack_ayuv_u (OrcExecutor * ex) { } void cogorc_unpack_ayuv_u (uint8_t * d1, uint32_t * s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; p = orc_program_new (); orc_program_set_name (p, "cogorc_unpack_ayuv_u"); orc_program_set_backup_function (p, _backup_cogorc_unpack_ayuv_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 (p, "select1lw", ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append (p, "select0wb", ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); result = 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] = s1; orc_executor_run (ex); } #endif /* cogorc_unpack_ayuv_v */ #ifdef DISABLE_ORC void cogorc_unpack_ayuv_v (uint8_t * d1, uint32_t * s1, int n) { } #else static void _backup_cogorc_unpack_ayuv_v (OrcExecutor * ex) { } void cogorc_unpack_ayuv_v (uint8_t * d1, uint32_t * s1, int n) { OrcExecutor _ex, *ex = &_ex; static int p_inited = 0; static OrcProgram *p = 0; if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcCompileResult result; p = orc_program_new (); orc_program_set_name (p, "cogorc_unpack_ayuv_v"); orc_program_set_backup_function (p, _backup_cogorc_unpack_ayuv_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 (p, "select1lw", ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append (p, "select1wb", ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); result = 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] = s1; orc_executor_run (ex); } #endif