2 /* autogenerated from tvtime.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__
83 #if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
84 #define ORC_INTERNAL __attribute__((visibility("hidden")))
85 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
86 #define ORC_INTERNAL __hidden
87 #elif defined (__GNUC__)
88 #define ORC_INTERNAL __attribute__((visibility("hidden")))
98 void deinterlace_line_vfir (guint8 * ORC_RESTRICT d1,
99 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
100 const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4,
101 const guint8 * ORC_RESTRICT s5, int n);
102 void deinterlace_line_linear (guint8 * ORC_RESTRICT d1,
103 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n);
104 void deinterlace_line_linear_blend (guint8 * ORC_RESTRICT d1,
105 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
106 const guint8 * ORC_RESTRICT s3, int n);
107 void deinterlace_line_greedy (orc_uint8 * ORC_RESTRICT d1,
108 const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2,
109 const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4,
113 /* begin Orc C target preamble */
114 #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))
115 #define ORC_ABS(a) ((a)<0 ? -(a) : (a))
116 #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b))
117 #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b))
118 #define ORC_SB_MAX 127
119 #define ORC_SB_MIN (-1-ORC_SB_MAX)
120 #define ORC_UB_MAX (orc_uint8) 255
122 #define ORC_SW_MAX 32767
123 #define ORC_SW_MIN (-1-ORC_SW_MAX)
124 #define ORC_UW_MAX (orc_uint16)65535
126 #define ORC_SL_MAX 2147483647
127 #define ORC_SL_MIN (-1-ORC_SL_MAX)
128 #define ORC_UL_MAX 4294967295U
130 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX)
131 #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX)
132 #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX)
133 #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX)
134 #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX)
135 #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX)
136 #define ORC_SWAP_W(x) ((((x)&0xffU)<<8) | (((x)&0xff00U)>>8))
137 #define ORC_SWAP_L(x) ((((x)&0xffU)<<24) | (((x)&0xff00U)<<8) | (((x)&0xff0000U)>>8) | (((x)&0xff000000U)>>24))
138 #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))
139 #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset)))
140 #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff))
141 #define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0))
142 #define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff)))
143 #define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0))
145 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
146 #define ORC_RESTRICT restrict
147 #elif defined(__GNUC__) && __GNUC__ >= 4
148 #define ORC_RESTRICT __restrict__
153 /* end Orc C target preamble */
157 /* deinterlace_line_vfir */
160 deinterlace_line_vfir (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
161 const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3,
162 const guint8 * ORC_RESTRICT s4, const guint8 * ORC_RESTRICT s5, int n)
165 orc_int8 *ORC_RESTRICT ptr0;
166 const orc_int8 *ORC_RESTRICT ptr4;
167 const orc_int8 *ORC_RESTRICT ptr5;
168 const orc_int8 *ORC_RESTRICT ptr6;
169 const orc_int8 *ORC_RESTRICT ptr7;
170 const orc_int8 *ORC_RESTRICT ptr8;
176 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
177 volatile orc_union16 var40;
196 ptr0 = (orc_int8 *) d1;
197 ptr4 = (orc_int8 *) s1;
198 ptr5 = (orc_int8 *) s2;
199 ptr6 = (orc_int8 *) s3;
200 ptr7 = (orc_int8 *) s4;
201 ptr8 = (orc_int8 *) s5;
204 var40.i = 0x00000004; /* 4 or 1.97626e-323f */
206 for (i = 0; i < n; i++) {
210 var42.i = (orc_uint8) var35;
214 var43.i = (orc_uint8) var36;
216 var44.i = var42.i + var43.i;
220 var45.i = (orc_uint8) var37;
224 var46.i = (orc_uint8) var38;
226 var47.i = var45.i + var46.i;
228 var48.i = ((orc_uint16) var47.i) << 2;
232 var49.i = (orc_uint8) var39;
234 var50.i = ((orc_uint16) var49.i) << 1;
236 var51.i = var48.i - var44.i;
238 var52.i = var51.i + var50.i;
240 var53.i = var52.i + var40.i;
242 var54.i = var53.i >> 3;
244 var41 = ORC_CLAMP_UB (var54.i);
253 _backup_deinterlace_line_vfir (OrcExecutor * ORC_RESTRICT ex)
257 orc_int8 *ORC_RESTRICT ptr0;
258 const orc_int8 *ORC_RESTRICT ptr4;
259 const orc_int8 *ORC_RESTRICT ptr5;
260 const orc_int8 *ORC_RESTRICT ptr6;
261 const orc_int8 *ORC_RESTRICT ptr7;
262 const orc_int8 *ORC_RESTRICT ptr8;
268 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
269 volatile orc_union16 var40;
288 ptr0 = (orc_int8 *) ex->arrays[0];
289 ptr4 = (orc_int8 *) ex->arrays[4];
290 ptr5 = (orc_int8 *) ex->arrays[5];
291 ptr6 = (orc_int8 *) ex->arrays[6];
292 ptr7 = (orc_int8 *) ex->arrays[7];
293 ptr8 = (orc_int8 *) ex->arrays[8];
296 var40.i = 0x00000004; /* 4 or 1.97626e-323f */
298 for (i = 0; i < n; i++) {
302 var42.i = (orc_uint8) var35;
306 var43.i = (orc_uint8) var36;
308 var44.i = var42.i + var43.i;
312 var45.i = (orc_uint8) var37;
316 var46.i = (orc_uint8) var38;
318 var47.i = var45.i + var46.i;
320 var48.i = ((orc_uint16) var47.i) << 2;
324 var49.i = (orc_uint8) var39;
326 var50.i = ((orc_uint16) var49.i) << 1;
328 var51.i = var48.i - var44.i;
330 var52.i = var51.i + var50.i;
332 var53.i = var52.i + var40.i;
334 var54.i = var53.i >> 3;
336 var41 = ORC_CLAMP_UB (var54.i);
344 deinterlace_line_vfir (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
345 const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3,
346 const guint8 * ORC_RESTRICT s4, const guint8 * ORC_RESTRICT s5, int n)
348 OrcExecutor _ex, *ex = &_ex;
349 static volatile int p_inited = 0;
350 static OrcCode *c = 0;
351 void (*func) (OrcExecutor *);
354 orc_once_mutex_lock ();
359 static const orc_uint8 bc[] = {
360 1, 9, 21, 100, 101, 105, 110, 116, 101, 114, 108, 97, 99, 101, 95, 108,
361 105, 110, 101, 95, 118, 102, 105, 114, 11, 1, 1, 12, 1, 1, 12, 1,
362 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 14, 2, 2, 0, 0, 0,
363 14, 2, 1, 0, 0, 0, 14, 2, 4, 0, 0, 0, 14, 2, 3, 0,
364 0, 0, 20, 2, 20, 2, 20, 2, 150, 32, 4, 150, 33, 8, 70, 32,
365 32, 33, 150, 33, 5, 150, 34, 7, 70, 33, 33, 34, 93, 33, 33, 16,
366 150, 34, 6, 93, 34, 34, 17, 98, 33, 33, 32, 70, 33, 33, 34, 70,
367 33, 33, 18, 94, 33, 33, 19, 160, 0, 33, 2, 0,
369 p = orc_program_new_from_static_bytecode (bc);
370 orc_program_set_backup_function (p, _backup_deinterlace_line_vfir);
372 p = orc_program_new ();
373 orc_program_set_name (p, "deinterlace_line_vfir");
374 orc_program_set_backup_function (p, _backup_deinterlace_line_vfir);
375 orc_program_add_destination (p, 1, "d1");
376 orc_program_add_source (p, 1, "s1");
377 orc_program_add_source (p, 1, "s2");
378 orc_program_add_source (p, 1, "s3");
379 orc_program_add_source (p, 1, "s4");
380 orc_program_add_source (p, 1, "s5");
381 orc_program_add_constant (p, 2, 0x00000002, "c1");
382 orc_program_add_constant (p, 2, 0x00000001, "c2");
383 orc_program_add_constant (p, 2, 0x00000004, "c3");
384 orc_program_add_constant (p, 2, 0x00000003, "c4");
385 orc_program_add_temporary (p, 2, "t1");
386 orc_program_add_temporary (p, 2, "t2");
387 orc_program_add_temporary (p, 2, "t3");
389 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
391 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S5, ORC_VAR_D1,
393 orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
395 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
397 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S4, ORC_VAR_D1,
399 orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3,
401 orc_program_append_2 (p, "shlw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1,
403 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1,
405 orc_program_append_2 (p, "shlw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C2,
407 orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1,
409 orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3,
411 orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C3,
413 orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C4,
415 orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2,
416 ORC_VAR_D1, ORC_VAR_D1);
419 orc_program_compile (p);
420 c = orc_program_take_code (p);
421 orc_program_free (p);
424 orc_once_mutex_unlock ();
426 ex->arrays[ORC_VAR_A2] = c;
430 ex->arrays[ORC_VAR_D1] = d1;
431 ex->arrays[ORC_VAR_S1] = (void *) s1;
432 ex->arrays[ORC_VAR_S2] = (void *) s2;
433 ex->arrays[ORC_VAR_S3] = (void *) s3;
434 ex->arrays[ORC_VAR_S4] = (void *) s4;
435 ex->arrays[ORC_VAR_S5] = (void *) s5;
443 /* deinterlace_line_linear */
446 deinterlace_line_linear (guint8 * ORC_RESTRICT d1,
447 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n)
450 orc_int8 *ORC_RESTRICT ptr0;
451 const orc_int8 *ORC_RESTRICT ptr4;
452 const orc_int8 *ORC_RESTRICT ptr5;
457 ptr0 = (orc_int8 *) d1;
458 ptr4 = (orc_int8 *) s1;
459 ptr5 = (orc_int8 *) s2;
462 for (i = 0; i < n; i++) {
468 var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1;
477 _backup_deinterlace_line_linear (OrcExecutor * ORC_RESTRICT ex)
481 orc_int8 *ORC_RESTRICT ptr0;
482 const orc_int8 *ORC_RESTRICT ptr4;
483 const orc_int8 *ORC_RESTRICT ptr5;
488 ptr0 = (orc_int8 *) ex->arrays[0];
489 ptr4 = (orc_int8 *) ex->arrays[4];
490 ptr5 = (orc_int8 *) ex->arrays[5];
493 for (i = 0; i < n; i++) {
499 var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1;
507 deinterlace_line_linear (guint8 * ORC_RESTRICT d1,
508 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n)
510 OrcExecutor _ex, *ex = &_ex;
511 static volatile int p_inited = 0;
512 static OrcCode *c = 0;
513 void (*func) (OrcExecutor *);
516 orc_once_mutex_lock ();
521 static const orc_uint8 bc[] = {
522 1, 9, 23, 100, 101, 105, 110, 116, 101, 114, 108, 97, 99, 101, 95, 108,
523 105, 110, 101, 95, 108, 105, 110, 101, 97, 114, 11, 1, 1, 12, 1, 1,
524 12, 1, 1, 39, 0, 4, 5, 2, 0,
526 p = orc_program_new_from_static_bytecode (bc);
527 orc_program_set_backup_function (p, _backup_deinterlace_line_linear);
529 p = orc_program_new ();
530 orc_program_set_name (p, "deinterlace_line_linear");
531 orc_program_set_backup_function (p, _backup_deinterlace_line_linear);
532 orc_program_add_destination (p, 1, "d1");
533 orc_program_add_source (p, 1, "s1");
534 orc_program_add_source (p, 1, "s2");
536 orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2,
540 orc_program_compile (p);
541 c = orc_program_take_code (p);
542 orc_program_free (p);
545 orc_once_mutex_unlock ();
547 ex->arrays[ORC_VAR_A2] = c;
551 ex->arrays[ORC_VAR_D1] = d1;
552 ex->arrays[ORC_VAR_S1] = (void *) s1;
553 ex->arrays[ORC_VAR_S2] = (void *) s2;
561 /* deinterlace_line_linear_blend */
564 deinterlace_line_linear_blend (guint8 * ORC_RESTRICT d1,
565 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
566 const guint8 * ORC_RESTRICT s3, int n)
569 orc_int8 *ORC_RESTRICT ptr0;
570 const orc_int8 *ORC_RESTRICT ptr4;
571 const orc_int8 *ORC_RESTRICT ptr5;
572 const orc_int8 *ORC_RESTRICT ptr6;
576 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
577 volatile orc_union16 var38;
591 ptr0 = (orc_int8 *) d1;
592 ptr4 = (orc_int8 *) s1;
593 ptr5 = (orc_int8 *) s2;
594 ptr6 = (orc_int8 *) s3;
597 var38.i = 0x00000002; /* 2 or 9.88131e-324f */
599 for (i = 0; i < n; i++) {
603 var40.i = (orc_uint8) var35;
607 var41.i = (orc_uint8) var36;
611 var42.i = (orc_uint8) var37;
613 var43.i = var40.i + var41.i;
615 var44.i = var42.i + var42.i;
617 var45.i = var43.i + var44.i;
619 var46.i = var45.i + var38.i;
621 var47.i = var46.i >> 2;
623 var39 = ORC_CLAMP_UB (var47.i);
632 _backup_deinterlace_line_linear_blend (OrcExecutor * ORC_RESTRICT ex)
636 orc_int8 *ORC_RESTRICT ptr0;
637 const orc_int8 *ORC_RESTRICT ptr4;
638 const orc_int8 *ORC_RESTRICT ptr5;
639 const orc_int8 *ORC_RESTRICT ptr6;
643 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
644 volatile orc_union16 var38;
658 ptr0 = (orc_int8 *) ex->arrays[0];
659 ptr4 = (orc_int8 *) ex->arrays[4];
660 ptr5 = (orc_int8 *) ex->arrays[5];
661 ptr6 = (orc_int8 *) ex->arrays[6];
664 var38.i = 0x00000002; /* 2 or 9.88131e-324f */
666 for (i = 0; i < n; i++) {
670 var40.i = (orc_uint8) var35;
674 var41.i = (orc_uint8) var36;
678 var42.i = (orc_uint8) var37;
680 var43.i = var40.i + var41.i;
682 var44.i = var42.i + var42.i;
684 var45.i = var43.i + var44.i;
686 var46.i = var45.i + var38.i;
688 var47.i = var46.i >> 2;
690 var39 = ORC_CLAMP_UB (var47.i);
698 deinterlace_line_linear_blend (guint8 * ORC_RESTRICT d1,
699 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
700 const guint8 * ORC_RESTRICT s3, int n)
702 OrcExecutor _ex, *ex = &_ex;
703 static volatile int p_inited = 0;
704 static OrcCode *c = 0;
705 void (*func) (OrcExecutor *);
708 orc_once_mutex_lock ();
713 static const orc_uint8 bc[] = {
714 1, 9, 29, 100, 101, 105, 110, 116, 101, 114, 108, 97, 99, 101, 95, 108,
715 105, 110, 101, 95, 108, 105, 110, 101, 97, 114, 95, 98, 108, 101, 110,
717 11, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 14, 2, 2, 0,
718 0, 0, 20, 2, 20, 2, 20, 2, 150, 32, 4, 150, 33, 5, 150, 34,
719 6, 70, 32, 32, 33, 70, 34, 34, 34, 70, 32, 32, 34, 70, 32, 32,
720 16, 94, 32, 32, 16, 160, 0, 32, 2, 0,
722 p = orc_program_new_from_static_bytecode (bc);
723 orc_program_set_backup_function (p,
724 _backup_deinterlace_line_linear_blend);
726 p = orc_program_new ();
727 orc_program_set_name (p, "deinterlace_line_linear_blend");
728 orc_program_set_backup_function (p,
729 _backup_deinterlace_line_linear_blend);
730 orc_program_add_destination (p, 1, "d1");
731 orc_program_add_source (p, 1, "s1");
732 orc_program_add_source (p, 1, "s2");
733 orc_program_add_source (p, 1, "s3");
734 orc_program_add_constant (p, 2, 0x00000002, "c1");
735 orc_program_add_temporary (p, 2, "t1");
736 orc_program_add_temporary (p, 2, "t2");
737 orc_program_add_temporary (p, 2, "t3");
739 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
741 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
743 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1,
745 orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
747 orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T3,
749 orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T3,
751 orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
753 orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
755 orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1,
756 ORC_VAR_D1, ORC_VAR_D1);
759 orc_program_compile (p);
760 c = orc_program_take_code (p);
761 orc_program_free (p);
764 orc_once_mutex_unlock ();
766 ex->arrays[ORC_VAR_A2] = c;
770 ex->arrays[ORC_VAR_D1] = d1;
771 ex->arrays[ORC_VAR_S1] = (void *) s1;
772 ex->arrays[ORC_VAR_S2] = (void *) s2;
773 ex->arrays[ORC_VAR_S3] = (void *) s3;
781 /* deinterlace_line_greedy */
784 deinterlace_line_greedy (orc_uint8 * ORC_RESTRICT d1,
785 const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2,
786 const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4,
790 orc_int8 *ORC_RESTRICT ptr0;
791 const orc_int8 *ORC_RESTRICT ptr4;
792 const orc_int8 *ORC_RESTRICT ptr5;
793 const orc_int8 *ORC_RESTRICT ptr6;
794 const orc_int8 *ORC_RESTRICT ptr7;
795 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
796 volatile orc_int8 var44;
825 ptr0 = (orc_int8 *) d1;
826 ptr4 = (orc_int8 *) s1;
827 ptr5 = (orc_int8 *) s2;
828 ptr6 = (orc_int8 *) s3;
829 ptr7 = (orc_int8 *) s4;
832 var44 = 0x00000080; /* 128 or 6.32404e-322f */
836 for (i = 0; i < n; i++) {
846 var51 = ((orc_uint8) var50 + (orc_uint8) var49 + 1) >> 1;
848 var52 = ORC_MAX ((orc_uint8) var47, (orc_uint8) var51);
850 var53 = ORC_MIN ((orc_uint8) var47, (orc_uint8) var51);
852 var54 = var52 - var53;
854 var55 = ORC_MAX ((orc_uint8) var48, (orc_uint8) var51);
856 var56 = ORC_MIN ((orc_uint8) var48, (orc_uint8) var51);
858 var57 = var55 - var56;
860 var58 = var54 ^ var44;
862 var59 = var57 ^ var44;
864 var60 = (var58 > var59) ? (~0) : 0;
866 var61 = var48 & var60;
868 var62 = (~var60) & var47;
870 var63 = var61 | var62;
872 var64 = ORC_MAX ((orc_uint8) var50, (orc_uint8) var49);
874 var65 = ORC_MIN ((orc_uint8) var50, (orc_uint8) var49);
876 var66 = ORC_CLAMP_UB ((orc_uint8) var64 + (orc_uint8) var45);
878 var67 = ORC_CLAMP_UB ((orc_uint8) var65 - (orc_uint8) var45);
880 var68 = ORC_MIN ((orc_uint8) var63, (orc_uint8) var66);
882 var46 = ORC_MAX ((orc_uint8) var68, (orc_uint8) var67);
891 _backup_deinterlace_line_greedy (OrcExecutor * ORC_RESTRICT ex)
895 orc_int8 *ORC_RESTRICT ptr0;
896 const orc_int8 *ORC_RESTRICT ptr4;
897 const orc_int8 *ORC_RESTRICT ptr5;
898 const orc_int8 *ORC_RESTRICT ptr6;
899 const orc_int8 *ORC_RESTRICT ptr7;
900 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
901 volatile orc_int8 var44;
930 ptr0 = (orc_int8 *) ex->arrays[0];
931 ptr4 = (orc_int8 *) ex->arrays[4];
932 ptr5 = (orc_int8 *) ex->arrays[5];
933 ptr6 = (orc_int8 *) ex->arrays[6];
934 ptr7 = (orc_int8 *) ex->arrays[7];
937 var44 = 0x00000080; /* 128 or 6.32404e-322f */
939 var45 = ex->params[24];
941 for (i = 0; i < n; i++) {
951 var51 = ((orc_uint8) var50 + (orc_uint8) var49 + 1) >> 1;
953 var52 = ORC_MAX ((orc_uint8) var47, (orc_uint8) var51);
955 var53 = ORC_MIN ((orc_uint8) var47, (orc_uint8) var51);
957 var54 = var52 - var53;
959 var55 = ORC_MAX ((orc_uint8) var48, (orc_uint8) var51);
961 var56 = ORC_MIN ((orc_uint8) var48, (orc_uint8) var51);
963 var57 = var55 - var56;
965 var58 = var54 ^ var44;
967 var59 = var57 ^ var44;
969 var60 = (var58 > var59) ? (~0) : 0;
971 var61 = var48 & var60;
973 var62 = (~var60) & var47;
975 var63 = var61 | var62;
977 var64 = ORC_MAX ((orc_uint8) var50, (orc_uint8) var49);
979 var65 = ORC_MIN ((orc_uint8) var50, (orc_uint8) var49);
981 var66 = ORC_CLAMP_UB ((orc_uint8) var64 + (orc_uint8) var45);
983 var67 = ORC_CLAMP_UB ((orc_uint8) var65 - (orc_uint8) var45);
985 var68 = ORC_MIN ((orc_uint8) var63, (orc_uint8) var66);
987 var46 = ORC_MAX ((orc_uint8) var68, (orc_uint8) var67);
995 deinterlace_line_greedy (orc_uint8 * ORC_RESTRICT d1,
996 const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2,
997 const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4,
1000 OrcExecutor _ex, *ex = &_ex;
1001 static volatile int p_inited = 0;
1002 static OrcCode *c = 0;
1003 void (*func) (OrcExecutor *);
1006 orc_once_mutex_lock ();
1011 static const orc_uint8 bc[] = {
1012 1, 9, 23, 100, 101, 105, 110, 116, 101, 114, 108, 97, 99, 101, 95, 108,
1013 105, 110, 101, 95, 103, 114, 101, 101, 100, 121, 11, 1, 1, 12, 1, 1,
1014 12, 1, 1, 12, 1, 1, 12, 1, 1, 14, 1, 128, 0, 0, 0, 16,
1015 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20,
1016 1, 20, 1, 20, 1, 20, 1, 20, 1, 43, 32, 4, 43, 33, 7, 43,
1017 34, 6, 43, 35, 5, 39, 36, 35, 34, 53, 39, 32, 36, 55, 40, 32,
1018 36, 65, 37, 39, 40, 53, 39, 33, 36, 55, 40, 33, 36, 65, 38, 39,
1019 40, 68, 37, 37, 16, 68, 38, 38, 16, 41, 40, 37, 38, 36, 39, 33,
1020 40, 37, 40, 40, 32, 59, 41, 39, 40, 53, 43, 35, 34, 55, 42, 35,
1021 34, 35, 43, 43, 24, 67, 42, 42, 24, 55, 41, 41, 43, 53, 0, 41,
1024 p = orc_program_new_from_static_bytecode (bc);
1025 orc_program_set_backup_function (p, _backup_deinterlace_line_greedy);
1027 p = orc_program_new ();
1028 orc_program_set_name (p, "deinterlace_line_greedy");
1029 orc_program_set_backup_function (p, _backup_deinterlace_line_greedy);
1030 orc_program_add_destination (p, 1, "d1");
1031 orc_program_add_source (p, 1, "s1");
1032 orc_program_add_source (p, 1, "s2");
1033 orc_program_add_source (p, 1, "s3");
1034 orc_program_add_source (p, 1, "s4");
1035 orc_program_add_constant (p, 1, 0x00000080, "c1");
1036 orc_program_add_parameter (p, 1, "p1");
1037 orc_program_add_temporary (p, 1, "t1");
1038 orc_program_add_temporary (p, 1, "t2");
1039 orc_program_add_temporary (p, 1, "t3");
1040 orc_program_add_temporary (p, 1, "t4");
1041 orc_program_add_temporary (p, 1, "t5");
1042 orc_program_add_temporary (p, 1, "t6");
1043 orc_program_add_temporary (p, 1, "t7");
1044 orc_program_add_temporary (p, 1, "t8");
1045 orc_program_add_temporary (p, 1, "t9");
1046 orc_program_add_temporary (p, 1, "t10");
1047 orc_program_add_temporary (p, 1, "t11");
1048 orc_program_add_temporary (p, 1, "t12");
1050 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
1052 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T2, ORC_VAR_S4, ORC_VAR_D1,
1054 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1,
1056 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T4, ORC_VAR_S2, ORC_VAR_D1,
1058 orc_program_append_2 (p, "avgub", 0, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_T3,
1060 orc_program_append_2 (p, "maxub", 0, ORC_VAR_T8, ORC_VAR_T1, ORC_VAR_T5,
1062 orc_program_append_2 (p, "minub", 0, ORC_VAR_T9, ORC_VAR_T1, ORC_VAR_T5,
1064 orc_program_append_2 (p, "subb", 0, ORC_VAR_T6, ORC_VAR_T8, ORC_VAR_T9,
1066 orc_program_append_2 (p, "maxub", 0, ORC_VAR_T8, ORC_VAR_T2, ORC_VAR_T5,
1068 orc_program_append_2 (p, "minub", 0, ORC_VAR_T9, ORC_VAR_T2, ORC_VAR_T5,
1070 orc_program_append_2 (p, "subb", 0, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_T9,
1072 orc_program_append_2 (p, "xorb", 0, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_C1,
1074 orc_program_append_2 (p, "xorb", 0, ORC_VAR_T7, ORC_VAR_T7, ORC_VAR_C1,
1076 orc_program_append_2 (p, "cmpgtsb", 0, ORC_VAR_T9, ORC_VAR_T6, ORC_VAR_T7,
1078 orc_program_append_2 (p, "andb", 0, ORC_VAR_T8, ORC_VAR_T2, ORC_VAR_T9,
1080 orc_program_append_2 (p, "andnb", 0, ORC_VAR_T9, ORC_VAR_T9, ORC_VAR_T1,
1082 orc_program_append_2 (p, "orb", 0, ORC_VAR_T10, ORC_VAR_T8, ORC_VAR_T9,
1084 orc_program_append_2 (p, "maxub", 0, ORC_VAR_T12, ORC_VAR_T4, ORC_VAR_T3,
1086 orc_program_append_2 (p, "minub", 0, ORC_VAR_T11, ORC_VAR_T4, ORC_VAR_T3,
1088 orc_program_append_2 (p, "addusb", 0, ORC_VAR_T12, ORC_VAR_T12,
1089 ORC_VAR_P1, ORC_VAR_D1);
1090 orc_program_append_2 (p, "subusb", 0, ORC_VAR_T11, ORC_VAR_T11,
1091 ORC_VAR_P1, ORC_VAR_D1);
1092 orc_program_append_2 (p, "minub", 0, ORC_VAR_T10, ORC_VAR_T10,
1093 ORC_VAR_T12, ORC_VAR_D1);
1094 orc_program_append_2 (p, "maxub", 0, ORC_VAR_D1, ORC_VAR_T10, ORC_VAR_T11,
1098 orc_program_compile (p);
1099 c = orc_program_take_code (p);
1100 orc_program_free (p);
1103 orc_once_mutex_unlock ();
1105 ex->arrays[ORC_VAR_A2] = c;
1109 ex->arrays[ORC_VAR_D1] = d1;
1110 ex->arrays[ORC_VAR_S1] = (void *) s1;
1111 ex->arrays[ORC_VAR_S2] = (void *) s2;
1112 ex->arrays[ORC_VAR_S3] = (void *) s3;
1113 ex->arrays[ORC_VAR_S4] = (void *) s4;
1114 ex->params[ORC_VAR_P1] = p1;