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 255
122 #define ORC_SW_MAX 32767
123 #define ORC_SW_MIN (-1-ORC_SW_MAX)
124 #define ORC_UW_MAX 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)&0xff)<<8) | (((x)&0xff00)>>8))
137 #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>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 = (int) 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 = var47.i << 2;
232 var49.i = (orc_uint8) var39;
234 var50.i = 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 = (int) 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 = var47.i << 2;
324 var49.i = (orc_uint8) var39;
326 var50.i = 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, 4, 2, 0, 0, 0,
363 14, 4, 1, 0, 0, 0, 14, 4, 4, 0, 0, 0, 14, 4, 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, 4, 0x00000002, "c1");
382 orc_program_add_constant (p, 4, 0x00000001, "c2");
383 orc_program_add_constant (p, 4, 0x00000004, "c3");
384 orc_program_add_constant (p, 4, 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 = (int) 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 = (int) 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, 4, 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, 4, 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;
800 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
801 volatile orc_int8 var45;
831 ptr0 = (orc_int8 *) d1;
832 ptr4 = (orc_int8 *) s1;
833 ptr5 = (orc_int8 *) s2;
834 ptr6 = (orc_int8 *) s3;
835 ptr7 = (orc_int8 *) s4;
838 var44 = (int) 0x00000080; /* 128 or 6.32404e-322f */
840 var45 = (int) 0x00000080; /* 128 or 6.32404e-322f */
846 for (i = 0; i < n; i++) {
856 var53 = ((orc_uint8) var52 + (orc_uint8) var51 + 1) >> 1;
858 var54 = ORC_MAX ((orc_uint8) var49, (orc_uint8) var53);
860 var55 = ORC_MIN ((orc_uint8) var49, (orc_uint8) var53);
862 var56 = var54 - var55;
864 var57 = ORC_MAX ((orc_uint8) var50, (orc_uint8) var53);
866 var58 = ORC_MIN ((orc_uint8) var50, (orc_uint8) var53);
868 var59 = var57 - var58;
870 var60 = var56 ^ var44;
872 var61 = var59 ^ var45;
874 var62 = (var60 > var61) ? (~0) : 0;
876 var63 = var50 & var62;
878 var64 = (~var62) & var49;
880 var65 = var63 | var64;
882 var66 = ORC_MAX ((orc_uint8) var52, (orc_uint8) var51);
884 var67 = ORC_MIN ((orc_uint8) var52, (orc_uint8) var51);
886 var68 = ORC_CLAMP_UB ((orc_uint8) var66 + (orc_uint8) var46);
888 var69 = ORC_CLAMP_UB ((orc_uint8) var67 - (orc_uint8) var47);
890 var70 = ORC_MIN ((orc_uint8) var65, (orc_uint8) var68);
892 var48 = ORC_MAX ((orc_uint8) var70, (orc_uint8) var69);
901 _backup_deinterlace_line_greedy (OrcExecutor * ORC_RESTRICT ex)
905 orc_int8 *ORC_RESTRICT ptr0;
906 const orc_int8 *ORC_RESTRICT ptr4;
907 const orc_int8 *ORC_RESTRICT ptr5;
908 const orc_int8 *ORC_RESTRICT ptr6;
909 const orc_int8 *ORC_RESTRICT ptr7;
910 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
911 volatile orc_int8 var44;
915 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
916 volatile orc_int8 var45;
946 ptr0 = (orc_int8 *) ex->arrays[0];
947 ptr4 = (orc_int8 *) ex->arrays[4];
948 ptr5 = (orc_int8 *) ex->arrays[5];
949 ptr6 = (orc_int8 *) ex->arrays[6];
950 ptr7 = (orc_int8 *) ex->arrays[7];
953 var44 = (int) 0x00000080; /* 128 or 6.32404e-322f */
955 var45 = (int) 0x00000080; /* 128 or 6.32404e-322f */
957 var46 = ex->params[24];
959 var47 = ex->params[24];
961 for (i = 0; i < n; i++) {
971 var53 = ((orc_uint8) var52 + (orc_uint8) var51 + 1) >> 1;
973 var54 = ORC_MAX ((orc_uint8) var49, (orc_uint8) var53);
975 var55 = ORC_MIN ((orc_uint8) var49, (orc_uint8) var53);
977 var56 = var54 - var55;
979 var57 = ORC_MAX ((orc_uint8) var50, (orc_uint8) var53);
981 var58 = ORC_MIN ((orc_uint8) var50, (orc_uint8) var53);
983 var59 = var57 - var58;
985 var60 = var56 ^ var44;
987 var61 = var59 ^ var45;
989 var62 = (var60 > var61) ? (~0) : 0;
991 var63 = var50 & var62;
993 var64 = (~var62) & var49;
995 var65 = var63 | var64;
997 var66 = ORC_MAX ((orc_uint8) var52, (orc_uint8) var51);
999 var67 = ORC_MIN ((orc_uint8) var52, (orc_uint8) var51);
1001 var68 = ORC_CLAMP_UB ((orc_uint8) var66 + (orc_uint8) var46);
1003 var69 = ORC_CLAMP_UB ((orc_uint8) var67 - (orc_uint8) var47);
1005 var70 = ORC_MIN ((orc_uint8) var65, (orc_uint8) var68);
1007 var48 = ORC_MAX ((orc_uint8) var70, (orc_uint8) var69);
1015 deinterlace_line_greedy (orc_uint8 * ORC_RESTRICT d1,
1016 const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2,
1017 const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4,
1020 OrcExecutor _ex, *ex = &_ex;
1021 static volatile int p_inited = 0;
1022 static OrcCode *c = 0;
1023 void (*func) (OrcExecutor *);
1026 orc_once_mutex_lock ();
1031 static const orc_uint8 bc[] = {
1032 1, 9, 23, 100, 101, 105, 110, 116, 101, 114, 108, 97, 99, 101, 95, 108,
1033 105, 110, 101, 95, 103, 114, 101, 101, 100, 121, 11, 1, 1, 12, 1, 1,
1034 12, 1, 1, 12, 1, 1, 12, 1, 1, 14, 4, 128, 0, 0, 0, 16,
1035 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20,
1036 1, 20, 1, 20, 1, 20, 1, 20, 1, 43, 32, 4, 43, 33, 7, 43,
1037 34, 6, 43, 35, 5, 39, 36, 35, 34, 53, 39, 32, 36, 55, 40, 32,
1038 36, 65, 37, 39, 40, 53, 39, 33, 36, 55, 40, 33, 36, 65, 38, 39,
1039 40, 68, 37, 37, 16, 68, 38, 38, 16, 41, 40, 37, 38, 36, 39, 33,
1040 40, 37, 40, 40, 32, 59, 41, 39, 40, 53, 43, 35, 34, 55, 42, 35,
1041 34, 35, 43, 43, 24, 67, 42, 42, 24, 55, 41, 41, 43, 53, 0, 41,
1044 p = orc_program_new_from_static_bytecode (bc);
1045 orc_program_set_backup_function (p, _backup_deinterlace_line_greedy);
1047 p = orc_program_new ();
1048 orc_program_set_name (p, "deinterlace_line_greedy");
1049 orc_program_set_backup_function (p, _backup_deinterlace_line_greedy);
1050 orc_program_add_destination (p, 1, "d1");
1051 orc_program_add_source (p, 1, "s1");
1052 orc_program_add_source (p, 1, "s2");
1053 orc_program_add_source (p, 1, "s3");
1054 orc_program_add_source (p, 1, "s4");
1055 orc_program_add_constant (p, 4, 0x00000080, "c1");
1056 orc_program_add_parameter (p, 1, "p1");
1057 orc_program_add_temporary (p, 1, "t1");
1058 orc_program_add_temporary (p, 1, "t2");
1059 orc_program_add_temporary (p, 1, "t3");
1060 orc_program_add_temporary (p, 1, "t4");
1061 orc_program_add_temporary (p, 1, "t5");
1062 orc_program_add_temporary (p, 1, "t6");
1063 orc_program_add_temporary (p, 1, "t7");
1064 orc_program_add_temporary (p, 1, "t8");
1065 orc_program_add_temporary (p, 1, "t9");
1066 orc_program_add_temporary (p, 1, "t10");
1067 orc_program_add_temporary (p, 1, "t11");
1068 orc_program_add_temporary (p, 1, "t12");
1070 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
1072 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T2, ORC_VAR_S4, ORC_VAR_D1,
1074 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1,
1076 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T4, ORC_VAR_S2, ORC_VAR_D1,
1078 orc_program_append_2 (p, "avgub", 0, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_T3,
1080 orc_program_append_2 (p, "maxub", 0, ORC_VAR_T8, ORC_VAR_T1, ORC_VAR_T5,
1082 orc_program_append_2 (p, "minub", 0, ORC_VAR_T9, ORC_VAR_T1, ORC_VAR_T5,
1084 orc_program_append_2 (p, "subb", 0, ORC_VAR_T6, ORC_VAR_T8, ORC_VAR_T9,
1086 orc_program_append_2 (p, "maxub", 0, ORC_VAR_T8, ORC_VAR_T2, ORC_VAR_T5,
1088 orc_program_append_2 (p, "minub", 0, ORC_VAR_T9, ORC_VAR_T2, ORC_VAR_T5,
1090 orc_program_append_2 (p, "subb", 0, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_T9,
1092 orc_program_append_2 (p, "xorb", 0, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_C1,
1094 orc_program_append_2 (p, "xorb", 0, ORC_VAR_T7, ORC_VAR_T7, ORC_VAR_C1,
1096 orc_program_append_2 (p, "cmpgtsb", 0, ORC_VAR_T9, ORC_VAR_T6, ORC_VAR_T7,
1098 orc_program_append_2 (p, "andb", 0, ORC_VAR_T8, ORC_VAR_T2, ORC_VAR_T9,
1100 orc_program_append_2 (p, "andnb", 0, ORC_VAR_T9, ORC_VAR_T9, ORC_VAR_T1,
1102 orc_program_append_2 (p, "orb", 0, ORC_VAR_T10, ORC_VAR_T8, ORC_VAR_T9,
1104 orc_program_append_2 (p, "maxub", 0, ORC_VAR_T12, ORC_VAR_T4, ORC_VAR_T3,
1106 orc_program_append_2 (p, "minub", 0, ORC_VAR_T11, ORC_VAR_T4, ORC_VAR_T3,
1108 orc_program_append_2 (p, "addusb", 0, ORC_VAR_T12, ORC_VAR_T12,
1109 ORC_VAR_P1, ORC_VAR_D1);
1110 orc_program_append_2 (p, "subusb", 0, ORC_VAR_T11, ORC_VAR_T11,
1111 ORC_VAR_P1, ORC_VAR_D1);
1112 orc_program_append_2 (p, "minub", 0, ORC_VAR_T10, ORC_VAR_T10,
1113 ORC_VAR_T12, ORC_VAR_D1);
1114 orc_program_append_2 (p, "maxub", 0, ORC_VAR_D1, ORC_VAR_T10, ORC_VAR_T11,
1118 orc_program_compile (p);
1119 c = orc_program_take_code (p);
1120 orc_program_free (p);
1123 orc_once_mutex_unlock ();
1125 ex->arrays[ORC_VAR_A2] = c;
1129 ex->arrays[ORC_VAR_D1] = d1;
1130 ex->arrays[ORC_VAR_S1] = (void *) s1;
1131 ex->arrays[ORC_VAR_S2] = (void *) s2;
1132 ex->arrays[ORC_VAR_S3] = (void *) s3;
1133 ex->arrays[ORC_VAR_S4] = (void *) s4;
1134 ex->params[ORC_VAR_P1] = p1;