2 /* autogenerated from gstvideoscaleorc.orc */
9 #ifndef _ORC_INTEGER_TYPEDEFS_
10 #define _ORC_INTEGER_TYPEDEFS_
11 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
13 typedef int8_t orc_int8;
14 typedef int16_t orc_int16;
15 typedef int32_t orc_int32;
16 typedef int64_t orc_int64;
17 typedef uint8_t orc_uint8;
18 typedef uint16_t orc_uint16;
19 typedef uint32_t orc_uint32;
20 typedef uint64_t orc_uint64;
21 #define ORC_UINT64_C(x) UINT64_C(x)
22 #elif defined(_MSC_VER)
23 typedef signed __int8 orc_int8;
24 typedef signed __int16 orc_int16;
25 typedef signed __int32 orc_int32;
26 typedef signed __int64 orc_int64;
27 typedef unsigned __int8 orc_uint8;
28 typedef unsigned __int16 orc_uint16;
29 typedef unsigned __int32 orc_uint32;
30 typedef unsigned __int64 orc_uint64;
31 #define ORC_UINT64_C(x) (x##Ui64)
32 #define inline __inline
35 typedef signed char orc_int8;
36 typedef short orc_int16;
37 typedef int orc_int32;
38 typedef unsigned char orc_uint8;
39 typedef unsigned short orc_uint16;
40 typedef unsigned int orc_uint32;
41 #if INT_MAX == LONG_MAX
42 typedef long long orc_int64;
43 typedef unsigned long long orc_uint64;
44 #define ORC_UINT64_C(x) (x##ULL)
46 typedef long orc_int64;
47 typedef unsigned long orc_uint64;
48 #define ORC_UINT64_C(x) (x##UL)
73 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
74 #define ORC_RESTRICT restrict
75 #elif defined(__GNUC__) && __GNUC__ >= 4
76 #define ORC_RESTRICT __restrict__
85 void orc_merge_linear_u8 (orc_uint8 * ORC_RESTRICT d1,
86 const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2,
88 void orc_merge_linear_u16 (orc_uint16 * ORC_RESTRICT d1,
89 const orc_uint16 * ORC_RESTRICT s1, const orc_uint16 * ORC_RESTRICT s2,
90 int p1, int p2, int n);
91 void orc_splat_u16 (orc_uint16 * ORC_RESTRICT d1, int p1, int n);
92 void orc_splat_u32 (orc_uint32 * ORC_RESTRICT d1, int p1, int n);
93 void orc_splat_u64 (orc_uint64 * ORC_RESTRICT d1, orc_int64 p1, int n);
94 void orc_downsample_u8 (guint8 * ORC_RESTRICT d1,
95 const guint8 * ORC_RESTRICT s1, int n);
96 void orc_downsample_u16 (guint16 * ORC_RESTRICT d1,
97 const guint16 * ORC_RESTRICT s1, int n);
98 void gst_videoscale_orc_downsample_u32 (guint8 * ORC_RESTRICT d1,
99 const guint8 * ORC_RESTRICT s1, int n);
100 void gst_videoscale_orc_downsample_yuyv (guint8 * ORC_RESTRICT d1,
101 const guint8 * ORC_RESTRICT s1, int n);
102 void gst_videoscale_orc_resample_nearest_u8 (guint8 * ORC_RESTRICT d1,
103 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n);
104 void gst_videoscale_orc_resample_bilinear_u8 (guint8 * ORC_RESTRICT d1,
105 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n);
106 void gst_videoscale_orc_resample_nearest_u32 (guint8 * ORC_RESTRICT d1,
107 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n);
108 void gst_videoscale_orc_resample_bilinear_u32 (guint8 * ORC_RESTRICT d1,
109 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n);
110 void gst_videoscale_orc_resample_merge_bilinear_u32 (guint8 * ORC_RESTRICT d1,
111 guint8 * ORC_RESTRICT d2, const guint8 * ORC_RESTRICT s1,
112 const guint8 * ORC_RESTRICT s2, int p1, int p2, int p3, int n);
113 void gst_videoscale_orc_merge_bicubic_u8 (guint8 * ORC_RESTRICT d1,
114 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
115 const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int p1,
116 int p2, int p3, int p4, int n);
118 void gst_videoscale_orc_init (void);
121 /* begin Orc C target preamble */
122 #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))
123 #define ORC_ABS(a) ((a)<0 ? -(a) : (a))
124 #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b))
125 #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b))
126 #define ORC_SB_MAX 127
127 #define ORC_SB_MIN (-1-ORC_SB_MAX)
128 #define ORC_UB_MAX 255
130 #define ORC_SW_MAX 32767
131 #define ORC_SW_MIN (-1-ORC_SW_MAX)
132 #define ORC_UW_MAX 65535
134 #define ORC_SL_MAX 2147483647
135 #define ORC_SL_MIN (-1-ORC_SL_MAX)
136 #define ORC_UL_MAX 4294967295U
138 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX)
139 #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX)
140 #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX)
141 #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX)
142 #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX)
143 #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX)
144 #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8))
145 #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24))
146 #define ORC_SWAP_Q(x) ((((x)&ORC_UINT64_C(0xff))<<56) | (((x)&ORC_UINT64_C(0xff00))<<40) | (((x)&ORC_UINT64_C(0xff0000))<<24) | (((x)&ORC_UINT64_C(0xff000000))<<8) | (((x)&ORC_UINT64_C(0xff00000000))>>8) | (((x)&ORC_UINT64_C(0xff0000000000))>>24) | (((x)&ORC_UINT64_C(0xff000000000000))>>40) | (((x)&ORC_UINT64_C(0xff00000000000000))>>56))
147 #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset)))
148 #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff))
149 #define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0))
150 #define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff)))
151 #define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0))
153 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
154 #define ORC_RESTRICT restrict
155 #elif defined(__GNUC__) && __GNUC__ >= 4
156 #define ORC_RESTRICT __restrict__
161 /* end Orc C target preamble */
165 /* orc_merge_linear_u8 */
168 orc_merge_linear_u8 (orc_uint8 * ORC_RESTRICT d1,
169 const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2,
173 orc_int8 *ORC_RESTRICT ptr0;
174 const orc_int8 *ORC_RESTRICT ptr4;
175 const orc_int8 *ORC_RESTRICT ptr5;
189 ptr0 = (orc_int8 *) d1;
190 ptr4 = (orc_int8 *) s1;
191 ptr5 = (orc_int8 *) s2;
196 var39.i = (int) 0x00000080; /* 128 or 6.32404e-322f */
198 for (i = 0; i < n; i++) {
204 var42.i = (orc_uint8) var36;
208 var43.i = (orc_uint8) var37;
210 var44.i = var43.i - var42.i;
212 var45.i = (var44.i * var38.i) & 0xffff;
214 var46.i = var45.i + var39.i;
216 var47 = ((orc_uint16) var46.i) >> 8;
218 var40 = var47 + var41;
227 _backup_orc_merge_linear_u8 (OrcExecutor * ORC_RESTRICT ex)
231 orc_int8 *ORC_RESTRICT ptr0;
232 const orc_int8 *ORC_RESTRICT ptr4;
233 const orc_int8 *ORC_RESTRICT ptr5;
247 ptr0 = (orc_int8 *) ex->arrays[0];
248 ptr4 = (orc_int8 *) ex->arrays[4];
249 ptr5 = (orc_int8 *) ex->arrays[5];
252 var38.i = ex->params[24];
254 var39.i = (int) 0x00000080; /* 128 or 6.32404e-322f */
256 for (i = 0; i < n; i++) {
262 var42.i = (orc_uint8) var36;
266 var43.i = (orc_uint8) var37;
268 var44.i = var43.i - var42.i;
270 var45.i = (var44.i * var38.i) & 0xffff;
272 var46.i = var45.i + var39.i;
274 var47 = ((orc_uint16) var46.i) >> 8;
276 var40 = var47 + var41;
283 static OrcProgram *_orc_program_orc_merge_linear_u8;
285 orc_merge_linear_u8 (orc_uint8 * ORC_RESTRICT d1,
286 const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2,
289 OrcExecutor _ex, *ex = &_ex;
290 OrcProgram *p = _orc_program_orc_merge_linear_u8;
291 void (*func) (OrcExecutor *);
296 ex->arrays[ORC_VAR_D1] = d1;
297 ex->arrays[ORC_VAR_S1] = (void *) s1;
298 ex->arrays[ORC_VAR_S2] = (void *) s2;
299 ex->params[ORC_VAR_P1] = p1;
307 /* orc_merge_linear_u16 */
310 orc_merge_linear_u16 (orc_uint16 * ORC_RESTRICT d1,
311 const orc_uint16 * ORC_RESTRICT s1, const orc_uint16 * ORC_RESTRICT s2,
312 int p1, int p2, int n)
315 orc_union16 *ORC_RESTRICT ptr0;
316 const orc_union16 *ORC_RESTRICT ptr4;
317 const orc_union16 *ORC_RESTRICT ptr5;
328 ptr0 = (orc_union16 *) d1;
329 ptr4 = (orc_union16 *) s1;
330 ptr5 = (orc_union16 *) s2;
337 for (i = 0; i < n; i++) {
341 var39.i = ((orc_uint16) var34.i) * ((orc_uint16) var35.i);
345 var40.i = ((orc_uint16) var36.i) * ((orc_uint16) var37.i);
347 var41.i = var39.i + var40.i;
349 var42.i = ((orc_uint32) var41.i) >> 16;
360 _backup_orc_merge_linear_u16 (OrcExecutor * ORC_RESTRICT ex)
364 orc_union16 *ORC_RESTRICT ptr0;
365 const orc_union16 *ORC_RESTRICT ptr4;
366 const orc_union16 *ORC_RESTRICT ptr5;
377 ptr0 = (orc_union16 *) ex->arrays[0];
378 ptr4 = (orc_union16 *) ex->arrays[4];
379 ptr5 = (orc_union16 *) ex->arrays[5];
382 var35.i = ex->params[24];
384 var37.i = ex->params[25];
386 for (i = 0; i < n; i++) {
390 var39.i = ((orc_uint16) var34.i) * ((orc_uint16) var35.i);
394 var40.i = ((orc_uint16) var36.i) * ((orc_uint16) var37.i);
396 var41.i = var39.i + var40.i;
398 var42.i = ((orc_uint32) var41.i) >> 16;
407 static OrcProgram *_orc_program_orc_merge_linear_u16;
409 orc_merge_linear_u16 (orc_uint16 * ORC_RESTRICT d1,
410 const orc_uint16 * ORC_RESTRICT s1, const orc_uint16 * ORC_RESTRICT s2,
411 int p1, int p2, int n)
413 OrcExecutor _ex, *ex = &_ex;
414 OrcProgram *p = _orc_program_orc_merge_linear_u16;
415 void (*func) (OrcExecutor *);
420 ex->arrays[ORC_VAR_D1] = d1;
421 ex->arrays[ORC_VAR_S1] = (void *) s1;
422 ex->arrays[ORC_VAR_S2] = (void *) s2;
423 ex->params[ORC_VAR_P1] = p1;
424 ex->params[ORC_VAR_P2] = p2;
435 orc_splat_u16 (orc_uint16 * ORC_RESTRICT d1, int p1, int n)
438 orc_union16 *ORC_RESTRICT ptr0;
442 ptr0 = (orc_union16 *) d1;
447 for (i = 0; i < n; i++) {
458 _backup_orc_splat_u16 (OrcExecutor * ORC_RESTRICT ex)
462 orc_union16 *ORC_RESTRICT ptr0;
466 ptr0 = (orc_union16 *) ex->arrays[0];
469 var32.i = ex->params[24];
471 for (i = 0; i < n; i++) {
480 static OrcProgram *_orc_program_orc_splat_u16;
482 orc_splat_u16 (orc_uint16 * ORC_RESTRICT d1, int p1, int n)
484 OrcExecutor _ex, *ex = &_ex;
485 OrcProgram *p = _orc_program_orc_splat_u16;
486 void (*func) (OrcExecutor *);
491 ex->arrays[ORC_VAR_D1] = d1;
492 ex->params[ORC_VAR_P1] = p1;
503 orc_splat_u32 (orc_uint32 * ORC_RESTRICT d1, int p1, int n)
506 orc_union32 *ORC_RESTRICT ptr0;
510 ptr0 = (orc_union32 *) d1;
515 for (i = 0; i < n; i++) {
526 _backup_orc_splat_u32 (OrcExecutor * ORC_RESTRICT ex)
530 orc_union32 *ORC_RESTRICT ptr0;
534 ptr0 = (orc_union32 *) ex->arrays[0];
537 var32.i = ex->params[24];
539 for (i = 0; i < n; i++) {
548 static OrcProgram *_orc_program_orc_splat_u32;
550 orc_splat_u32 (orc_uint32 * ORC_RESTRICT d1, int p1, int n)
552 OrcExecutor _ex, *ex = &_ex;
553 OrcProgram *p = _orc_program_orc_splat_u32;
554 void (*func) (OrcExecutor *);
559 ex->arrays[ORC_VAR_D1] = d1;
560 ex->params[ORC_VAR_P1] = p1;
571 orc_splat_u64 (orc_uint64 * ORC_RESTRICT d1, orc_int64 p1, int n)
574 orc_union64 *ORC_RESTRICT ptr0;
578 ptr0 = (orc_union64 *) d1;
583 for (i = 0; i < n; i++) {
594 _backup_orc_splat_u64 (OrcExecutor * ORC_RESTRICT ex)
598 orc_union64 *ORC_RESTRICT ptr0;
602 ptr0 = (orc_union64 *) ex->arrays[0];
606 (ex->params[24] & 0xffffffff) | ((orc_uint64) (ex->params[24 +
607 (ORC_VAR_T1 - ORC_VAR_P1)]) << 32);
609 for (i = 0; i < n; i++) {
618 static OrcProgram *_orc_program_orc_splat_u64;
620 orc_splat_u64 (orc_uint64 * ORC_RESTRICT d1, orc_int64 p1, int n)
622 OrcExecutor _ex, *ex = &_ex;
623 OrcProgram *p = _orc_program_orc_splat_u64;
624 void (*func) (OrcExecutor *);
629 ex->arrays[ORC_VAR_D1] = d1;
633 ex->params[ORC_VAR_P1] = tmp.x2[0];
634 ex->params[ORC_VAR_T1] = tmp.x2[1];
643 /* orc_downsample_u8 */
646 orc_downsample_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
650 orc_int8 *ORC_RESTRICT ptr0;
651 const orc_union16 *ORC_RESTRICT ptr4;
657 ptr0 = (orc_int8 *) d1;
658 ptr4 = (orc_union16 *) s1;
661 for (i = 0; i < n; i++) {
672 var35 = ((orc_uint8) var36 + (orc_uint8) var37 + 1) >> 1;
681 _backup_orc_downsample_u8 (OrcExecutor * ORC_RESTRICT ex)
685 orc_int8 *ORC_RESTRICT ptr0;
686 const orc_union16 *ORC_RESTRICT ptr4;
692 ptr0 = (orc_int8 *) ex->arrays[0];
693 ptr4 = (orc_union16 *) ex->arrays[4];
696 for (i = 0; i < n; i++) {
707 var35 = ((orc_uint8) var36 + (orc_uint8) var37 + 1) >> 1;
714 static OrcProgram *_orc_program_orc_downsample_u8;
716 orc_downsample_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
719 OrcExecutor _ex, *ex = &_ex;
720 OrcProgram *p = _orc_program_orc_downsample_u8;
721 void (*func) (OrcExecutor *);
726 ex->arrays[ORC_VAR_D1] = d1;
727 ex->arrays[ORC_VAR_S1] = (void *) s1;
735 /* orc_downsample_u16 */
738 orc_downsample_u16 (guint16 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1,
742 orc_union16 *ORC_RESTRICT ptr0;
743 const orc_union32 *ORC_RESTRICT ptr4;
749 ptr0 = (orc_union16 *) d1;
750 ptr4 = (orc_union32 *) s1;
753 for (i = 0; i < n; i++) {
760 var36.i = _src.x2[1];
761 var37.i = _src.x2[0];
764 var35.i = ((orc_uint16) var36.i + (orc_uint16) var37.i + 1) >> 1;
773 _backup_orc_downsample_u16 (OrcExecutor * ORC_RESTRICT ex)
777 orc_union16 *ORC_RESTRICT ptr0;
778 const orc_union32 *ORC_RESTRICT ptr4;
784 ptr0 = (orc_union16 *) ex->arrays[0];
785 ptr4 = (orc_union32 *) ex->arrays[4];
788 for (i = 0; i < n; i++) {
795 var36.i = _src.x2[1];
796 var37.i = _src.x2[0];
799 var35.i = ((orc_uint16) var36.i + (orc_uint16) var37.i + 1) >> 1;
806 static OrcProgram *_orc_program_orc_downsample_u16;
808 orc_downsample_u16 (guint16 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1,
811 OrcExecutor _ex, *ex = &_ex;
812 OrcProgram *p = _orc_program_orc_downsample_u16;
813 void (*func) (OrcExecutor *);
818 ex->arrays[ORC_VAR_D1] = d1;
819 ex->arrays[ORC_VAR_S1] = (void *) s1;
827 /* gst_videoscale_orc_downsample_u32 */
830 gst_videoscale_orc_downsample_u32 (guint8 * ORC_RESTRICT d1,
831 const guint8 * ORC_RESTRICT s1, int n)
834 orc_union32 *ORC_RESTRICT ptr0;
835 const orc_union64 *ORC_RESTRICT ptr4;
841 ptr0 = (orc_union32 *) d1;
842 ptr4 = (orc_union64 *) s1;
845 for (i = 0; i < n; i++) {
852 var36.i = _src.x2[1];
853 var37.i = _src.x2[0];
856 var35.x4[0] = ((orc_uint8) var36.x4[0] + (orc_uint8) var37.x4[0] + 1) >> 1;
857 var35.x4[1] = ((orc_uint8) var36.x4[1] + (orc_uint8) var37.x4[1] + 1) >> 1;
858 var35.x4[2] = ((orc_uint8) var36.x4[2] + (orc_uint8) var37.x4[2] + 1) >> 1;
859 var35.x4[3] = ((orc_uint8) var36.x4[3] + (orc_uint8) var37.x4[3] + 1) >> 1;
868 _backup_gst_videoscale_orc_downsample_u32 (OrcExecutor * ORC_RESTRICT ex)
872 orc_union32 *ORC_RESTRICT ptr0;
873 const orc_union64 *ORC_RESTRICT ptr4;
879 ptr0 = (orc_union32 *) ex->arrays[0];
880 ptr4 = (orc_union64 *) ex->arrays[4];
883 for (i = 0; i < n; i++) {
890 var36.i = _src.x2[1];
891 var37.i = _src.x2[0];
894 var35.x4[0] = ((orc_uint8) var36.x4[0] + (orc_uint8) var37.x4[0] + 1) >> 1;
895 var35.x4[1] = ((orc_uint8) var36.x4[1] + (orc_uint8) var37.x4[1] + 1) >> 1;
896 var35.x4[2] = ((orc_uint8) var36.x4[2] + (orc_uint8) var37.x4[2] + 1) >> 1;
897 var35.x4[3] = ((orc_uint8) var36.x4[3] + (orc_uint8) var37.x4[3] + 1) >> 1;
904 static OrcProgram *_orc_program_gst_videoscale_orc_downsample_u32;
906 gst_videoscale_orc_downsample_u32 (guint8 * ORC_RESTRICT d1,
907 const guint8 * ORC_RESTRICT s1, int n)
909 OrcExecutor _ex, *ex = &_ex;
910 OrcProgram *p = _orc_program_gst_videoscale_orc_downsample_u32;
911 void (*func) (OrcExecutor *);
916 ex->arrays[ORC_VAR_D1] = d1;
917 ex->arrays[ORC_VAR_S1] = (void *) s1;
925 /* gst_videoscale_orc_downsample_yuyv */
928 gst_videoscale_orc_downsample_yuyv (guint8 * ORC_RESTRICT d1,
929 const guint8 * ORC_RESTRICT s1, int n)
932 orc_union32 *ORC_RESTRICT ptr0;
933 const orc_union64 *ORC_RESTRICT ptr4;
945 ptr0 = (orc_union32 *) d1;
946 ptr4 = (orc_union64 *) s1;
949 for (i = 0; i < n; i++) {
955 _src.i = var38.x4[0];
956 var40.x4[0] = _src.x2[1];
957 var41.x4[0] = _src.x2[0];
961 _src.i = var38.x4[1];
962 var40.x4[1] = _src.x2[1];
963 var41.x4[1] = _src.x2[0];
967 _src.i = var38.x4[2];
968 var40.x4[2] = _src.x2[1];
969 var41.x4[2] = _src.x2[0];
973 _src.i = var38.x4[3];
974 var40.x4[3] = _src.x2[1];
975 var41.x4[3] = _src.x2[0];
980 _src.i = var40.x2[0];
981 var42.x2[0] = _src.x2[1];
982 var43.x2[0] = _src.x2[0];
986 _src.i = var40.x2[1];
987 var42.x2[1] = _src.x2[1];
988 var43.x2[1] = _src.x2[0];
991 var44.x2[0] = ((orc_uint8) var42.x2[0] + (orc_uint8) var43.x2[0] + 1) >> 1;
992 var44.x2[1] = ((orc_uint8) var42.x2[1] + (orc_uint8) var43.x2[1] + 1) >> 1;
997 var45.i = _src.x2[1];
998 var46.i = _src.x2[0];
1001 var47.x2[0] = ((orc_uint8) var45.x2[0] + (orc_uint8) var46.x2[0] + 1) >> 1;
1002 var47.x2[1] = ((orc_uint8) var45.x2[1] + (orc_uint8) var46.x2[1] + 1) >> 1;
1006 _dest.x2[0] = var44.x2[0];
1007 _dest.x2[1] = var47.x2[0];
1008 var39.x2[0] = _dest.i;
1012 _dest.x2[0] = var44.x2[1];
1013 _dest.x2[1] = var47.x2[1];
1014 var39.x2[1] = _dest.i;
1024 _backup_gst_videoscale_orc_downsample_yuyv (OrcExecutor * ORC_RESTRICT ex)
1028 orc_union32 *ORC_RESTRICT ptr0;
1029 const orc_union64 *ORC_RESTRICT ptr4;
1041 ptr0 = (orc_union32 *) ex->arrays[0];
1042 ptr4 = (orc_union64 *) ex->arrays[4];
1045 for (i = 0; i < n; i++) {
1051 _src.i = var38.x4[0];
1052 var40.x4[0] = _src.x2[1];
1053 var41.x4[0] = _src.x2[0];
1057 _src.i = var38.x4[1];
1058 var40.x4[1] = _src.x2[1];
1059 var41.x4[1] = _src.x2[0];
1063 _src.i = var38.x4[2];
1064 var40.x4[2] = _src.x2[1];
1065 var41.x4[2] = _src.x2[0];
1069 _src.i = var38.x4[3];
1070 var40.x4[3] = _src.x2[1];
1071 var41.x4[3] = _src.x2[0];
1076 _src.i = var40.x2[0];
1077 var42.x2[0] = _src.x2[1];
1078 var43.x2[0] = _src.x2[0];
1082 _src.i = var40.x2[1];
1083 var42.x2[1] = _src.x2[1];
1084 var43.x2[1] = _src.x2[0];
1087 var44.x2[0] = ((orc_uint8) var42.x2[0] + (orc_uint8) var43.x2[0] + 1) >> 1;
1088 var44.x2[1] = ((orc_uint8) var42.x2[1] + (orc_uint8) var43.x2[1] + 1) >> 1;
1093 var45.i = _src.x2[1];
1094 var46.i = _src.x2[0];
1097 var47.x2[0] = ((orc_uint8) var45.x2[0] + (orc_uint8) var46.x2[0] + 1) >> 1;
1098 var47.x2[1] = ((orc_uint8) var45.x2[1] + (orc_uint8) var46.x2[1] + 1) >> 1;
1102 _dest.x2[0] = var44.x2[0];
1103 _dest.x2[1] = var47.x2[0];
1104 var39.x2[0] = _dest.i;
1108 _dest.x2[0] = var44.x2[1];
1109 _dest.x2[1] = var47.x2[1];
1110 var39.x2[1] = _dest.i;
1118 static OrcProgram *_orc_program_gst_videoscale_orc_downsample_yuyv;
1120 gst_videoscale_orc_downsample_yuyv (guint8 * ORC_RESTRICT d1,
1121 const guint8 * ORC_RESTRICT s1, int n)
1123 OrcExecutor _ex, *ex = &_ex;
1124 OrcProgram *p = _orc_program_gst_videoscale_orc_downsample_yuyv;
1125 void (*func) (OrcExecutor *);
1130 ex->arrays[ORC_VAR_D1] = d1;
1131 ex->arrays[ORC_VAR_S1] = (void *) s1;
1133 func = p->code_exec;
1139 /* gst_videoscale_orc_resample_nearest_u8 */
1142 gst_videoscale_orc_resample_nearest_u8 (guint8 * ORC_RESTRICT d1,
1143 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n)
1146 orc_int8 *ORC_RESTRICT ptr0;
1147 const orc_int8 *ORC_RESTRICT ptr4;
1150 ptr0 = (orc_int8 *) d1;
1151 ptr4 = (orc_int8 *) s1;
1154 for (i = 0; i < n; i++) {
1156 var32 = ptr4[(p1 + i * p2) >> 16];
1165 _backup_gst_videoscale_orc_resample_nearest_u8 (OrcExecutor * ORC_RESTRICT ex)
1169 orc_int8 *ORC_RESTRICT ptr0;
1170 const orc_int8 *ORC_RESTRICT ptr4;
1173 ptr0 = (orc_int8 *) ex->arrays[0];
1174 ptr4 = (orc_int8 *) ex->arrays[4];
1177 for (i = 0; i < n; i++) {
1179 var32 = ptr4[(ex->params[24] + i * ex->params[25]) >> 16];
1186 static OrcProgram *_orc_program_gst_videoscale_orc_resample_nearest_u8;
1188 gst_videoscale_orc_resample_nearest_u8 (guint8 * ORC_RESTRICT d1,
1189 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n)
1191 OrcExecutor _ex, *ex = &_ex;
1192 OrcProgram *p = _orc_program_gst_videoscale_orc_resample_nearest_u8;
1193 void (*func) (OrcExecutor *);
1198 ex->arrays[ORC_VAR_D1] = d1;
1199 ex->arrays[ORC_VAR_S1] = (void *) s1;
1200 ex->params[ORC_VAR_P1] = p1;
1201 ex->params[ORC_VAR_P2] = p2;
1203 func = p->code_exec;
1209 /* gst_videoscale_orc_resample_bilinear_u8 */
1212 gst_videoscale_orc_resample_bilinear_u8 (guint8 * ORC_RESTRICT d1,
1213 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n)
1216 orc_int8 *ORC_RESTRICT ptr0;
1217 const orc_int8 *ORC_RESTRICT ptr4;
1220 ptr0 = (orc_int8 *) d1;
1221 ptr4 = (orc_int8 *) s1;
1224 for (i = 0; i < n; i++) {
1227 int tmp = p1 + i * p2;
1229 ((orc_uint8) ptr4[tmp >> 16] * (256 - ((tmp >> 8) & 0xff)) +
1230 (orc_uint8) ptr4[(tmp >> 16) + 1] * ((tmp >> 8) & 0xff)) >> 8;
1240 _backup_gst_videoscale_orc_resample_bilinear_u8 (OrcExecutor * ORC_RESTRICT ex)
1244 orc_int8 *ORC_RESTRICT ptr0;
1245 const orc_int8 *ORC_RESTRICT ptr4;
1248 ptr0 = (orc_int8 *) ex->arrays[0];
1249 ptr4 = (orc_int8 *) ex->arrays[4];
1252 for (i = 0; i < n; i++) {
1255 int tmp = ex->params[24] + i * ex->params[25];
1257 ((orc_uint8) ptr4[tmp >> 16] * (256 - ((tmp >> 8) & 0xff)) +
1258 (orc_uint8) ptr4[(tmp >> 16) + 1] * ((tmp >> 8) & 0xff)) >> 8;
1266 static OrcProgram *_orc_program_gst_videoscale_orc_resample_bilinear_u8;
1268 gst_videoscale_orc_resample_bilinear_u8 (guint8 * ORC_RESTRICT d1,
1269 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n)
1271 OrcExecutor _ex, *ex = &_ex;
1272 OrcProgram *p = _orc_program_gst_videoscale_orc_resample_bilinear_u8;
1273 void (*func) (OrcExecutor *);
1278 ex->arrays[ORC_VAR_D1] = d1;
1279 ex->arrays[ORC_VAR_S1] = (void *) s1;
1280 ex->params[ORC_VAR_P1] = p1;
1281 ex->params[ORC_VAR_P2] = p2;
1283 func = p->code_exec;
1289 /* gst_videoscale_orc_resample_nearest_u32 */
1292 gst_videoscale_orc_resample_nearest_u32 (guint8 * ORC_RESTRICT d1,
1293 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n)
1296 orc_union32 *ORC_RESTRICT ptr0;
1297 const orc_union32 *ORC_RESTRICT ptr4;
1300 ptr0 = (orc_union32 *) d1;
1301 ptr4 = (orc_union32 *) s1;
1304 for (i = 0; i < n; i++) {
1306 var32 = ptr4[(p1 + i * p2) >> 16];
1315 _backup_gst_videoscale_orc_resample_nearest_u32 (OrcExecutor * ORC_RESTRICT ex)
1319 orc_union32 *ORC_RESTRICT ptr0;
1320 const orc_union32 *ORC_RESTRICT ptr4;
1323 ptr0 = (orc_union32 *) ex->arrays[0];
1324 ptr4 = (orc_union32 *) ex->arrays[4];
1327 for (i = 0; i < n; i++) {
1329 var32 = ptr4[(ex->params[24] + i * ex->params[25]) >> 16];
1336 static OrcProgram *_orc_program_gst_videoscale_orc_resample_nearest_u32;
1338 gst_videoscale_orc_resample_nearest_u32 (guint8 * ORC_RESTRICT d1,
1339 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n)
1341 OrcExecutor _ex, *ex = &_ex;
1342 OrcProgram *p = _orc_program_gst_videoscale_orc_resample_nearest_u32;
1343 void (*func) (OrcExecutor *);
1348 ex->arrays[ORC_VAR_D1] = d1;
1349 ex->arrays[ORC_VAR_S1] = (void *) s1;
1350 ex->params[ORC_VAR_P1] = p1;
1351 ex->params[ORC_VAR_P2] = p2;
1353 func = p->code_exec;
1359 /* gst_videoscale_orc_resample_bilinear_u32 */
1362 gst_videoscale_orc_resample_bilinear_u32 (guint8 * ORC_RESTRICT d1,
1363 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n)
1366 orc_union32 *ORC_RESTRICT ptr0;
1367 const orc_union32 *ORC_RESTRICT ptr4;
1370 ptr0 = (orc_union32 *) d1;
1371 ptr4 = (orc_union32 *) s1;
1374 for (i = 0; i < n; i++) {
1377 int tmp = p1 + i * p2;
1378 orc_union32 a = ptr4[tmp >> 16];
1379 orc_union32 b = ptr4[(tmp >> 16) + 1];
1381 ((orc_uint8) a.x4[0] * (256 - ((tmp >> 8) & 0xff)) +
1382 (orc_uint8) b.x4[0] * ((tmp >> 8) & 0xff)) >> 8;
1384 ((orc_uint8) a.x4[1] * (256 - ((tmp >> 8) & 0xff)) +
1385 (orc_uint8) b.x4[1] * ((tmp >> 8) & 0xff)) >> 8;
1387 ((orc_uint8) a.x4[2] * (256 - ((tmp >> 8) & 0xff)) +
1388 (orc_uint8) b.x4[2] * ((tmp >> 8) & 0xff)) >> 8;
1390 ((orc_uint8) a.x4[3] * (256 - ((tmp >> 8) & 0xff)) +
1391 (orc_uint8) b.x4[3] * ((tmp >> 8) & 0xff)) >> 8;
1401 _backup_gst_videoscale_orc_resample_bilinear_u32 (OrcExecutor * ORC_RESTRICT ex)
1405 orc_union32 *ORC_RESTRICT ptr0;
1406 const orc_union32 *ORC_RESTRICT ptr4;
1409 ptr0 = (orc_union32 *) ex->arrays[0];
1410 ptr4 = (orc_union32 *) ex->arrays[4];
1413 for (i = 0; i < n; i++) {
1416 int tmp = ex->params[24] + i * ex->params[25];
1417 orc_union32 a = ptr4[tmp >> 16];
1418 orc_union32 b = ptr4[(tmp >> 16) + 1];
1420 ((orc_uint8) a.x4[0] * (256 - ((tmp >> 8) & 0xff)) +
1421 (orc_uint8) b.x4[0] * ((tmp >> 8) & 0xff)) >> 8;
1423 ((orc_uint8) a.x4[1] * (256 - ((tmp >> 8) & 0xff)) +
1424 (orc_uint8) b.x4[1] * ((tmp >> 8) & 0xff)) >> 8;
1426 ((orc_uint8) a.x4[2] * (256 - ((tmp >> 8) & 0xff)) +
1427 (orc_uint8) b.x4[2] * ((tmp >> 8) & 0xff)) >> 8;
1429 ((orc_uint8) a.x4[3] * (256 - ((tmp >> 8) & 0xff)) +
1430 (orc_uint8) b.x4[3] * ((tmp >> 8) & 0xff)) >> 8;
1438 static OrcProgram *_orc_program_gst_videoscale_orc_resample_bilinear_u32;
1440 gst_videoscale_orc_resample_bilinear_u32 (guint8 * ORC_RESTRICT d1,
1441 const guint8 * ORC_RESTRICT s1, int p1, int p2, int n)
1443 OrcExecutor _ex, *ex = &_ex;
1444 OrcProgram *p = _orc_program_gst_videoscale_orc_resample_bilinear_u32;
1445 void (*func) (OrcExecutor *);
1450 ex->arrays[ORC_VAR_D1] = d1;
1451 ex->arrays[ORC_VAR_S1] = (void *) s1;
1452 ex->params[ORC_VAR_P1] = p1;
1453 ex->params[ORC_VAR_P2] = p2;
1455 func = p->code_exec;
1461 /* gst_videoscale_orc_resample_merge_bilinear_u32 */
1464 gst_videoscale_orc_resample_merge_bilinear_u32 (guint8 * ORC_RESTRICT d1,
1465 guint8 * ORC_RESTRICT d2, const guint8 * ORC_RESTRICT s1,
1466 const guint8 * ORC_RESTRICT s2, int p1, int p2, int p3, int n)
1469 orc_union32 *ORC_RESTRICT ptr0;
1470 orc_union32 *ORC_RESTRICT ptr1;
1471 const orc_union32 *ORC_RESTRICT ptr4;
1472 const orc_union32 *ORC_RESTRICT ptr5;
1483 ptr0 = (orc_union32 *) d1;
1484 ptr1 = (orc_union32 *) d2;
1485 ptr4 = (orc_union32 *) s1;
1486 ptr5 = (orc_union32 *) s2;
1494 for (i = 0; i < n; i++) {
1497 int tmp = p2 + i * p3;
1498 orc_union32 a = ptr5[tmp >> 16];
1499 orc_union32 b = ptr5[(tmp >> 16) + 1];
1501 ((orc_uint8) a.x4[0] * (256 - ((tmp >> 8) & 0xff)) +
1502 (orc_uint8) b.x4[0] * ((tmp >> 8) & 0xff)) >> 8;
1504 ((orc_uint8) a.x4[1] * (256 - ((tmp >> 8) & 0xff)) +
1505 (orc_uint8) b.x4[1] * ((tmp >> 8) & 0xff)) >> 8;
1507 ((orc_uint8) a.x4[2] * (256 - ((tmp >> 8) & 0xff)) +
1508 (orc_uint8) b.x4[2] * ((tmp >> 8) & 0xff)) >> 8;
1510 ((orc_uint8) a.x4[3] * (256 - ((tmp >> 8) & 0xff)) +
1511 (orc_uint8) b.x4[3] * ((tmp >> 8) & 0xff)) >> 8;
1518 var41.x4[0] = (orc_uint8) var40.x4[0];
1519 var41.x4[1] = (orc_uint8) var40.x4[1];
1520 var41.x4[2] = (orc_uint8) var40.x4[2];
1521 var41.x4[3] = (orc_uint8) var40.x4[3];
1523 var42.x4[0] = (orc_uint8) var39.x4[0];
1524 var42.x4[1] = (orc_uint8) var39.x4[1];
1525 var42.x4[2] = (orc_uint8) var39.x4[2];
1526 var42.x4[3] = (orc_uint8) var39.x4[3];
1528 var43.x4[0] = var42.x4[0] - var41.x4[0];
1529 var43.x4[1] = var42.x4[1] - var41.x4[1];
1530 var43.x4[2] = var42.x4[2] - var41.x4[2];
1531 var43.x4[3] = var42.x4[3] - var41.x4[3];
1533 var44.x4[0] = (var43.x4[0] * var37.x4[0]) & 0xffff;
1534 var44.x4[1] = (var43.x4[1] * var37.x4[1]) & 0xffff;
1535 var44.x4[2] = (var43.x4[2] * var37.x4[2]) & 0xffff;
1536 var44.x4[3] = (var43.x4[3] * var37.x4[3]) & 0xffff;
1538 var45.x4[0] = ((orc_uint16) var44.x4[0]) >> 8;
1539 var45.x4[1] = ((orc_uint16) var44.x4[1]) >> 8;
1540 var45.x4[2] = ((orc_uint16) var44.x4[2]) >> 8;
1541 var45.x4[3] = ((orc_uint16) var44.x4[3]) >> 8;
1543 var38.x4[0] = var45.x4[0] + var40.x4[0];
1544 var38.x4[1] = var45.x4[1] + var40.x4[1];
1545 var38.x4[2] = var45.x4[2] + var40.x4[2];
1546 var38.x4[3] = var45.x4[3] + var40.x4[3];
1555 _backup_gst_videoscale_orc_resample_merge_bilinear_u32 (OrcExecutor *
1560 orc_union32 *ORC_RESTRICT ptr0;
1561 orc_union32 *ORC_RESTRICT ptr1;
1562 const orc_union32 *ORC_RESTRICT ptr4;
1563 const orc_union32 *ORC_RESTRICT ptr5;
1574 ptr0 = (orc_union32 *) ex->arrays[0];
1575 ptr1 = (orc_union32 *) ex->arrays[1];
1576 ptr4 = (orc_union32 *) ex->arrays[4];
1577 ptr5 = (orc_union32 *) ex->arrays[5];
1580 var37.x4[0] = ex->params[24];
1581 var37.x4[1] = ex->params[24];
1582 var37.x4[2] = ex->params[24];
1583 var37.x4[3] = ex->params[24];
1585 for (i = 0; i < n; i++) {
1588 int tmp = ex->params[25] + i * ex->params[26];
1589 orc_union32 a = ptr5[tmp >> 16];
1590 orc_union32 b = ptr5[(tmp >> 16) + 1];
1592 ((orc_uint8) a.x4[0] * (256 - ((tmp >> 8) & 0xff)) +
1593 (orc_uint8) b.x4[0] * ((tmp >> 8) & 0xff)) >> 8;
1595 ((orc_uint8) a.x4[1] * (256 - ((tmp >> 8) & 0xff)) +
1596 (orc_uint8) b.x4[1] * ((tmp >> 8) & 0xff)) >> 8;
1598 ((orc_uint8) a.x4[2] * (256 - ((tmp >> 8) & 0xff)) +
1599 (orc_uint8) b.x4[2] * ((tmp >> 8) & 0xff)) >> 8;
1601 ((orc_uint8) a.x4[3] * (256 - ((tmp >> 8) & 0xff)) +
1602 (orc_uint8) b.x4[3] * ((tmp >> 8) & 0xff)) >> 8;
1609 var41.x4[0] = (orc_uint8) var40.x4[0];
1610 var41.x4[1] = (orc_uint8) var40.x4[1];
1611 var41.x4[2] = (orc_uint8) var40.x4[2];
1612 var41.x4[3] = (orc_uint8) var40.x4[3];
1614 var42.x4[0] = (orc_uint8) var39.x4[0];
1615 var42.x4[1] = (orc_uint8) var39.x4[1];
1616 var42.x4[2] = (orc_uint8) var39.x4[2];
1617 var42.x4[3] = (orc_uint8) var39.x4[3];
1619 var43.x4[0] = var42.x4[0] - var41.x4[0];
1620 var43.x4[1] = var42.x4[1] - var41.x4[1];
1621 var43.x4[2] = var42.x4[2] - var41.x4[2];
1622 var43.x4[3] = var42.x4[3] - var41.x4[3];
1624 var44.x4[0] = (var43.x4[0] * var37.x4[0]) & 0xffff;
1625 var44.x4[1] = (var43.x4[1] * var37.x4[1]) & 0xffff;
1626 var44.x4[2] = (var43.x4[2] * var37.x4[2]) & 0xffff;
1627 var44.x4[3] = (var43.x4[3] * var37.x4[3]) & 0xffff;
1629 var45.x4[0] = ((orc_uint16) var44.x4[0]) >> 8;
1630 var45.x4[1] = ((orc_uint16) var44.x4[1]) >> 8;
1631 var45.x4[2] = ((orc_uint16) var44.x4[2]) >> 8;
1632 var45.x4[3] = ((orc_uint16) var44.x4[3]) >> 8;
1634 var38.x4[0] = var45.x4[0] + var40.x4[0];
1635 var38.x4[1] = var45.x4[1] + var40.x4[1];
1636 var38.x4[2] = var45.x4[2] + var40.x4[2];
1637 var38.x4[3] = var45.x4[3] + var40.x4[3];
1644 static OrcProgram *_orc_program_gst_videoscale_orc_resample_merge_bilinear_u32;
1646 gst_videoscale_orc_resample_merge_bilinear_u32 (guint8 * ORC_RESTRICT d1,
1647 guint8 * ORC_RESTRICT d2, const guint8 * ORC_RESTRICT s1,
1648 const guint8 * ORC_RESTRICT s2, int p1, int p2, int p3, int n)
1650 OrcExecutor _ex, *ex = &_ex;
1651 OrcProgram *p = _orc_program_gst_videoscale_orc_resample_merge_bilinear_u32;
1652 void (*func) (OrcExecutor *);
1657 ex->arrays[ORC_VAR_D1] = d1;
1658 ex->arrays[ORC_VAR_D2] = d2;
1659 ex->arrays[ORC_VAR_S1] = (void *) s1;
1660 ex->arrays[ORC_VAR_S2] = (void *) s2;
1661 ex->params[ORC_VAR_P1] = p1;
1662 ex->params[ORC_VAR_P2] = p2;
1663 ex->params[ORC_VAR_P3] = p3;
1665 func = p->code_exec;
1671 /* gst_videoscale_orc_merge_bicubic_u8 */
1674 gst_videoscale_orc_merge_bicubic_u8 (guint8 * ORC_RESTRICT d1,
1675 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
1676 const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int p1,
1677 int p2, int p3, int p4, int n)
1680 orc_int8 *ORC_RESTRICT ptr0;
1681 const orc_int8 *ORC_RESTRICT ptr4;
1682 const orc_int8 *ORC_RESTRICT ptr5;
1683 const orc_int8 *ORC_RESTRICT ptr6;
1684 const orc_int8 *ORC_RESTRICT ptr7;
1705 ptr0 = (orc_int8 *) d1;
1706 ptr4 = (orc_int8 *) s1;
1707 ptr5 = (orc_int8 *) s2;
1708 ptr6 = (orc_int8 *) s3;
1709 ptr7 = (orc_int8 *) s4;
1720 var42.i = (int) 0x00000020; /* 32 or 1.58101e-322f */
1722 for (i = 0; i < n; i++) {
1726 var44.i = ((orc_uint8) var34) * ((orc_uint8) var35);
1730 var45.i = ((orc_uint8) var36) * ((orc_uint8) var37);
1732 var46.i = var44.i + var45.i;
1736 var47.i = ((orc_uint8) var38) * ((orc_uint8) var39);
1738 var48.i = var46.i - var47.i;
1742 var49.i = ((orc_uint8) var40) * ((orc_uint8) var41);
1744 var50.i = var48.i - var49.i;
1746 var51.i = var50.i + var42.i;
1748 var52.i = var51.i >> 6;
1750 var43 = ORC_CLAMP_UB (var52.i);
1759 _backup_gst_videoscale_orc_merge_bicubic_u8 (OrcExecutor * ORC_RESTRICT ex)
1763 orc_int8 *ORC_RESTRICT ptr0;
1764 const orc_int8 *ORC_RESTRICT ptr4;
1765 const orc_int8 *ORC_RESTRICT ptr5;
1766 const orc_int8 *ORC_RESTRICT ptr6;
1767 const orc_int8 *ORC_RESTRICT ptr7;
1788 ptr0 = (orc_int8 *) ex->arrays[0];
1789 ptr4 = (orc_int8 *) ex->arrays[4];
1790 ptr5 = (orc_int8 *) ex->arrays[5];
1791 ptr6 = (orc_int8 *) ex->arrays[6];
1792 ptr7 = (orc_int8 *) ex->arrays[7];
1795 var35 = ex->params[25];
1797 var37 = ex->params[26];
1799 var39 = ex->params[24];
1801 var41 = ex->params[27];
1803 var42.i = (int) 0x00000020; /* 32 or 1.58101e-322f */
1805 for (i = 0; i < n; i++) {
1809 var44.i = ((orc_uint8) var34) * ((orc_uint8) var35);
1813 var45.i = ((orc_uint8) var36) * ((orc_uint8) var37);
1815 var46.i = var44.i + var45.i;
1819 var47.i = ((orc_uint8) var38) * ((orc_uint8) var39);
1821 var48.i = var46.i - var47.i;
1825 var49.i = ((orc_uint8) var40) * ((orc_uint8) var41);
1827 var50.i = var48.i - var49.i;
1829 var51.i = var50.i + var42.i;
1831 var52.i = var51.i >> 6;
1833 var43 = ORC_CLAMP_UB (var52.i);
1840 static OrcProgram *_orc_program_gst_videoscale_orc_merge_bicubic_u8;
1842 gst_videoscale_orc_merge_bicubic_u8 (guint8 * ORC_RESTRICT d1,
1843 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
1844 const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int p1,
1845 int p2, int p3, int p4, int n)
1847 OrcExecutor _ex, *ex = &_ex;
1848 OrcProgram *p = _orc_program_gst_videoscale_orc_merge_bicubic_u8;
1849 void (*func) (OrcExecutor *);
1854 ex->arrays[ORC_VAR_D1] = d1;
1855 ex->arrays[ORC_VAR_S1] = (void *) s1;
1856 ex->arrays[ORC_VAR_S2] = (void *) s2;
1857 ex->arrays[ORC_VAR_S3] = (void *) s3;
1858 ex->arrays[ORC_VAR_S4] = (void *) s4;
1859 ex->params[ORC_VAR_P1] = p1;
1860 ex->params[ORC_VAR_P2] = p2;
1861 ex->params[ORC_VAR_P3] = p3;
1862 ex->params[ORC_VAR_P4] = p4;
1864 func = p->code_exec;
1871 gst_videoscale_orc_init (void)
1875 /* orc_merge_linear_u8 */
1878 p = orc_program_new ();
1879 orc_program_set_name (p, "orc_merge_linear_u8");
1880 orc_program_set_backup_function (p, _backup_orc_merge_linear_u8);
1881 orc_program_add_destination (p, 1, "d1");
1882 orc_program_add_source (p, 1, "s1");
1883 orc_program_add_source (p, 1, "s2");
1884 orc_program_add_constant (p, 4, 0x00000080, "c1");
1885 orc_program_add_parameter (p, 1, "p1");
1886 orc_program_add_temporary (p, 2, "t1");
1887 orc_program_add_temporary (p, 2, "t2");
1888 orc_program_add_temporary (p, 1, "t3");
1889 orc_program_add_temporary (p, 1, "t4");
1891 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1,
1893 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
1895 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
1897 orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1,
1899 orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P1,
1901 orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1,
1903 orc_program_append_2 (p, "convhwb", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1,
1905 orc_program_append_2 (p, "addb", 0, ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_T3,
1908 orc_program_compile (p);
1910 _orc_program_orc_merge_linear_u8 = p;
1913 /* orc_merge_linear_u16 */
1916 p = orc_program_new ();
1917 orc_program_set_name (p, "orc_merge_linear_u16");
1918 orc_program_set_backup_function (p, _backup_orc_merge_linear_u16);
1919 orc_program_add_destination (p, 2, "d1");
1920 orc_program_add_source (p, 2, "s1");
1921 orc_program_add_source (p, 2, "s2");
1922 orc_program_add_constant (p, 4, 0x00000010, "c1");
1923 orc_program_add_parameter (p, 2, "p1");
1924 orc_program_add_parameter (p, 2, "p2");
1925 orc_program_add_temporary (p, 4, "t1");
1926 orc_program_add_temporary (p, 4, "t2");
1928 orc_program_append_2 (p, "muluwl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1,
1930 orc_program_append_2 (p, "muluwl", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_P2,
1932 orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
1934 orc_program_append_2 (p, "shrul", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
1936 orc_program_append_2 (p, "convlw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
1939 orc_program_compile (p);
1941 _orc_program_orc_merge_linear_u16 = p;
1947 p = orc_program_new ();
1948 orc_program_set_name (p, "orc_splat_u16");
1949 orc_program_set_backup_function (p, _backup_orc_splat_u16);
1950 orc_program_add_destination (p, 2, "d1");
1951 orc_program_add_parameter (p, 2, "p1");
1953 orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1,
1956 orc_program_compile (p);
1958 _orc_program_orc_splat_u16 = p;
1964 p = orc_program_new ();
1965 orc_program_set_name (p, "orc_splat_u32");
1966 orc_program_set_backup_function (p, _backup_orc_splat_u32);
1967 orc_program_add_destination (p, 4, "d1");
1968 orc_program_add_parameter (p, 4, "p1");
1970 orc_program_append_2 (p, "copyl", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1,
1973 orc_program_compile (p);
1975 _orc_program_orc_splat_u32 = p;
1981 p = orc_program_new ();
1982 orc_program_set_name (p, "orc_splat_u64");
1983 orc_program_set_backup_function (p, _backup_orc_splat_u64);
1984 orc_program_add_destination (p, 8, "d1");
1985 orc_program_add_parameter_int64 (p, 8, "p1");
1987 orc_program_append_2 (p, "copyq", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1,
1990 orc_program_compile (p);
1992 _orc_program_orc_splat_u64 = p;
1995 /* orc_downsample_u8 */
1998 p = orc_program_new ();
1999 orc_program_set_name (p, "orc_downsample_u8");
2000 orc_program_set_backup_function (p, _backup_orc_downsample_u8);
2001 orc_program_add_destination (p, 1, "d1");
2002 orc_program_add_source (p, 2, "s1");
2003 orc_program_add_temporary (p, 1, "t1");
2004 orc_program_add_temporary (p, 1, "t2");
2006 orc_program_append_2 (p, "splitwb", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_S1,
2008 orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2,
2011 orc_program_compile (p);
2013 _orc_program_orc_downsample_u8 = p;
2016 /* orc_downsample_u16 */
2019 p = orc_program_new ();
2020 orc_program_set_name (p, "orc_downsample_u16");
2021 orc_program_set_backup_function (p, _backup_orc_downsample_u16);
2022 orc_program_add_destination (p, 2, "d1");
2023 orc_program_add_source (p, 4, "s1");
2024 orc_program_add_temporary (p, 2, "t1");
2025 orc_program_add_temporary (p, 2, "t2");
2027 orc_program_append_2 (p, "splitlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_S1,
2029 orc_program_append_2 (p, "avguw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2,
2032 orc_program_compile (p);
2034 _orc_program_orc_downsample_u16 = p;
2037 /* gst_videoscale_orc_downsample_u32 */
2040 p = orc_program_new ();
2041 orc_program_set_name (p, "gst_videoscale_orc_downsample_u32");
2042 orc_program_set_backup_function (p,
2043 _backup_gst_videoscale_orc_downsample_u32);
2044 orc_program_add_destination (p, 4, "d1");
2045 orc_program_add_source (p, 8, "s1");
2046 orc_program_add_temporary (p, 4, "t1");
2047 orc_program_add_temporary (p, 4, "t2");
2049 orc_program_append_2 (p, "splitql", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_S1,
2051 orc_program_append_2 (p, "avgub", 2, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2,
2054 orc_program_compile (p);
2056 _orc_program_gst_videoscale_orc_downsample_u32 = p;
2059 /* gst_videoscale_orc_downsample_yuyv */
2062 p = orc_program_new ();
2063 orc_program_set_name (p, "gst_videoscale_orc_downsample_yuyv");
2064 orc_program_set_backup_function (p,
2065 _backup_gst_videoscale_orc_downsample_yuyv);
2066 orc_program_add_destination (p, 4, "d1");
2067 orc_program_add_source (p, 8, "s1");
2068 orc_program_add_temporary (p, 4, "t1");
2069 orc_program_add_temporary (p, 4, "t2");
2070 orc_program_add_temporary (p, 2, "t3");
2071 orc_program_add_temporary (p, 2, "t4");
2072 orc_program_add_temporary (p, 2, "t5");
2073 orc_program_add_temporary (p, 2, "t6");
2075 orc_program_append_2 (p, "splitwb", 2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_S1,
2077 orc_program_append_2 (p, "splitwb", 1, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_T1,
2079 orc_program_append_2 (p, "avgub", 1, ORC_VAR_T5, ORC_VAR_T3, ORC_VAR_T4,
2081 orc_program_append_2 (p, "splitlw", 0, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_T2,
2083 orc_program_append_2 (p, "avgub", 1, ORC_VAR_T6, ORC_VAR_T3, ORC_VAR_T4,
2085 orc_program_append_2 (p, "mergebw", 1, ORC_VAR_D1, ORC_VAR_T5, ORC_VAR_T6,
2088 orc_program_compile (p);
2090 _orc_program_gst_videoscale_orc_downsample_yuyv = p;
2093 /* gst_videoscale_orc_resample_nearest_u8 */
2096 p = orc_program_new ();
2097 orc_program_set_name (p, "gst_videoscale_orc_resample_nearest_u8");
2098 orc_program_set_backup_function (p,
2099 _backup_gst_videoscale_orc_resample_nearest_u8);
2100 orc_program_add_destination (p, 1, "d1");
2101 orc_program_add_source (p, 1, "s1");
2102 orc_program_add_parameter (p, 4, "p1");
2103 orc_program_add_parameter (p, 4, "p2");
2105 orc_program_append_2 (p, "ldresnearb", 0, ORC_VAR_D1, ORC_VAR_S1,
2106 ORC_VAR_P1, ORC_VAR_P2);
2108 orc_program_compile (p);
2110 _orc_program_gst_videoscale_orc_resample_nearest_u8 = p;
2113 /* gst_videoscale_orc_resample_bilinear_u8 */
2116 p = orc_program_new ();
2117 orc_program_set_name (p, "gst_videoscale_orc_resample_bilinear_u8");
2118 orc_program_set_backup_function (p,
2119 _backup_gst_videoscale_orc_resample_bilinear_u8);
2120 orc_program_add_destination (p, 1, "d1");
2121 orc_program_add_source (p, 1, "s1");
2122 orc_program_add_parameter (p, 4, "p1");
2123 orc_program_add_parameter (p, 4, "p2");
2125 orc_program_append_2 (p, "ldreslinb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_P1,
2128 orc_program_compile (p);
2130 _orc_program_gst_videoscale_orc_resample_bilinear_u8 = p;
2133 /* gst_videoscale_orc_resample_nearest_u32 */
2136 p = orc_program_new ();
2137 orc_program_set_name (p, "gst_videoscale_orc_resample_nearest_u32");
2138 orc_program_set_backup_function (p,
2139 _backup_gst_videoscale_orc_resample_nearest_u32);
2140 orc_program_add_destination (p, 4, "d1");
2141 orc_program_add_source (p, 4, "s1");
2142 orc_program_add_parameter (p, 4, "p1");
2143 orc_program_add_parameter (p, 4, "p2");
2145 orc_program_append_2 (p, "ldresnearl", 0, ORC_VAR_D1, ORC_VAR_S1,
2146 ORC_VAR_P1, ORC_VAR_P2);
2148 orc_program_compile (p);
2150 _orc_program_gst_videoscale_orc_resample_nearest_u32 = p;
2153 /* gst_videoscale_orc_resample_bilinear_u32 */
2156 p = orc_program_new ();
2157 orc_program_set_name (p, "gst_videoscale_orc_resample_bilinear_u32");
2158 orc_program_set_backup_function (p,
2159 _backup_gst_videoscale_orc_resample_bilinear_u32);
2160 orc_program_add_destination (p, 4, "d1");
2161 orc_program_add_source (p, 4, "s1");
2162 orc_program_add_parameter (p, 4, "p1");
2163 orc_program_add_parameter (p, 4, "p2");
2165 orc_program_append_2 (p, "ldreslinl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_P1,
2168 orc_program_compile (p);
2170 _orc_program_gst_videoscale_orc_resample_bilinear_u32 = p;
2173 /* gst_videoscale_orc_resample_merge_bilinear_u32 */
2176 p = orc_program_new ();
2177 orc_program_set_name (p, "gst_videoscale_orc_resample_merge_bilinear_u32");
2178 orc_program_set_backup_function (p,
2179 _backup_gst_videoscale_orc_resample_merge_bilinear_u32);
2180 orc_program_add_destination (p, 4, "d1");
2181 orc_program_add_destination (p, 4, "d2");
2182 orc_program_add_source (p, 4, "s1");
2183 orc_program_add_source (p, 4, "s2");
2184 orc_program_add_parameter (p, 4, "p1");
2185 orc_program_add_parameter (p, 4, "p2");
2186 orc_program_add_parameter (p, 4, "p3");
2187 orc_program_add_temporary (p, 4, "t1");
2188 orc_program_add_temporary (p, 4, "t2");
2189 orc_program_add_temporary (p, 4, "t3");
2190 orc_program_add_temporary (p, 8, "t4");
2191 orc_program_add_temporary (p, 8, "t5");
2193 orc_program_append_2 (p, "ldreslinl", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_P2,
2195 orc_program_append_2 (p, "storel", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1,
2197 orc_program_append_2 (p, "loadl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
2199 orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_D1,
2201 orc_program_append_2 (p, "convubw", 2, ORC_VAR_T5, ORC_VAR_T2, ORC_VAR_D1,
2203 orc_program_append_2 (p, "subw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_T4,
2205 orc_program_append_2 (p, "mullw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_P1,
2207 orc_program_append_2 (p, "convhwb", 2, ORC_VAR_T3, ORC_VAR_T5, ORC_VAR_D1,
2209 orc_program_append_2 (p, "addb", 2, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T1,
2212 orc_program_compile (p);
2214 _orc_program_gst_videoscale_orc_resample_merge_bilinear_u32 = p;
2217 /* gst_videoscale_orc_merge_bicubic_u8 */
2220 p = orc_program_new ();
2221 orc_program_set_name (p, "gst_videoscale_orc_merge_bicubic_u8");
2222 orc_program_set_backup_function (p,
2223 _backup_gst_videoscale_orc_merge_bicubic_u8);
2224 orc_program_add_destination (p, 1, "d1");
2225 orc_program_add_source (p, 1, "s1");
2226 orc_program_add_source (p, 1, "s2");
2227 orc_program_add_source (p, 1, "s3");
2228 orc_program_add_source (p, 1, "s4");
2229 orc_program_add_constant (p, 4, 0x00000020, "c1");
2230 orc_program_add_constant (p, 4, 0x00000006, "c2");
2231 orc_program_add_parameter (p, 4, "p1");
2232 orc_program_add_parameter (p, 4, "p2");
2233 orc_program_add_parameter (p, 4, "p3");
2234 orc_program_add_parameter (p, 4, "p4");
2235 orc_program_add_temporary (p, 2, "t1");
2236 orc_program_add_temporary (p, 2, "t2");
2238 orc_program_append_2 (p, "mulubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_P2,
2240 orc_program_append_2 (p, "mulubw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_P3,
2242 orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
2244 orc_program_append_2 (p, "mulubw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_P1,
2246 orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
2248 orc_program_append_2 (p, "mulubw", 0, ORC_VAR_T2, ORC_VAR_S4, ORC_VAR_P4,
2250 orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
2252 orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
2254 orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
2256 orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
2259 orc_program_compile (p);
2261 _orc_program_gst_videoscale_orc_merge_bicubic_u8 = p;