1
2 /* autogenerated from tvtime.orc */
3
4 #ifdef HAVE_CONFIG_H
5 #include "config.h"
6 #endif
7 #include <glib.h>
8
9 #ifndef _ORC_INTEGER_TYPEDEFS_
10 #define _ORC_INTEGER_TYPEDEFS_
11 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
12 #include <stdint.h>
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
33 #else
34 #include <limits.h>
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)
45 #else
46 typedef long orc_int64;
47 typedef unsigned long orc_uint64;
48 #define ORC_UINT64_C(x) (x##UL)
49 #endif
50 #endif
51 typedef union
52 {
53 orc_int16 i;
54 orc_int8 x2[2];
55 } orc_union16;
56 typedef union
57 {
58 orc_int32 i;
59 float f;
60 orc_int16 x2[2];
61 orc_int8 x4[4];
62 } orc_union32;
63 typedef union
64 {
65 orc_int64 i;
66 double f;
67 orc_int32 x2[2];
68 float x2f[2];
69 orc_int16 x4[4];
70 } orc_union64;
71 #endif
72 #ifndef ORC_RESTRICT
73 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
74 #define ORC_RESTRICT restrict
75 #elif defined(__GNUC__) && __GNUC__ >= 4
76 #define ORC_RESTRICT __restrict__
77 #else
78 #define ORC_RESTRICT
79 #endif
80 #endif
81
82 #ifndef ORC_INTERNAL
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")))
89 #else
90 #define ORC_INTERNAL
91 #endif
92 #endif
93
94
95 #ifndef DISABLE_ORC
96 #include <orc/orc.h>
97 #endif
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,
110 int p1, int n);
111
112
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
121 #define ORC_UB_MIN 0
122 #define ORC_SW_MAX 32767
123 #define ORC_SW_MIN (-1-ORC_SW_MAX)
124 #define ORC_UW_MAX (orc_uint16)65535
125 #define ORC_UW_MIN 0
126 #define ORC_SL_MAX 2147483647
127 #define ORC_SL_MIN (-1-ORC_SL_MAX)
128 #define ORC_UL_MAX 4294967295U
129 #define ORC_UL_MIN 0
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))
144 #ifndef ORC_RESTRICT
145 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
146 #define ORC_RESTRICT restrict
147 #elif defined(__GNUC__) && __GNUC__ >= 4
148 #define ORC_RESTRICT __restrict__
149 #else
150 #define ORC_RESTRICT
151 #endif
152 #endif
153 /* end Orc C target preamble */
154
155
156
157 /* deinterlace_line_vfir */
158 #ifdef DISABLE_ORC
159 void
deinterlace_line_vfir(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,const guint8 * ORC_RESTRICT s2,const guint8 * ORC_RESTRICT s3,const guint8 * ORC_RESTRICT s4,const guint8 * ORC_RESTRICT s5,int n)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)
163 {
164 int i;
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;
171 orc_int8 var35;
172 orc_int8 var36;
173 orc_int8 var37;
174 orc_int8 var38;
175 orc_int8 var39;
176 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
177 volatile orc_union16 var40;
178 #else
179 orc_union16 var40;
180 #endif
181 orc_int8 var41;
182 orc_union16 var42;
183 orc_union16 var43;
184 orc_union16 var44;
185 orc_union16 var45;
186 orc_union16 var46;
187 orc_union16 var47;
188 orc_union16 var48;
189 orc_union16 var49;
190 orc_union16 var50;
191 orc_union16 var51;
192 orc_union16 var52;
193 orc_union16 var53;
194 orc_union16 var54;
195
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;
202
203 /* 16: loadpw */
204 var40.i = 0x00000004; /* 4 or 1.97626e-323f */
205
206 for (i = 0; i < n; i++) {
207 /* 0: loadb */
208 var35 = ptr4[i];
209 /* 1: convubw */
210 var42.i = (orc_uint8) var35;
211 /* 2: loadb */
212 var36 = ptr8[i];
213 /* 3: convubw */
214 var43.i = (orc_uint8) var36;
215 /* 4: addw */
216 var44.i = var42.i + var43.i;
217 /* 5: loadb */
218 var37 = ptr5[i];
219 /* 6: convubw */
220 var45.i = (orc_uint8) var37;
221 /* 7: loadb */
222 var38 = ptr7[i];
223 /* 8: convubw */
224 var46.i = (orc_uint8) var38;
225 /* 9: addw */
226 var47.i = var45.i + var46.i;
227 /* 10: shlw */
228 var48.i = ((orc_uint16) var47.i) << 2;
229 /* 11: loadb */
230 var39 = ptr6[i];
231 /* 12: convubw */
232 var49.i = (orc_uint8) var39;
233 /* 13: shlw */
234 var50.i = ((orc_uint16) var49.i) << 1;
235 /* 14: subw */
236 var51.i = var48.i - var44.i;
237 /* 15: addw */
238 var52.i = var51.i + var50.i;
239 /* 17: addw */
240 var53.i = var52.i + var40.i;
241 /* 18: shrsw */
242 var54.i = var53.i >> 3;
243 /* 19: convsuswb */
244 var41 = ORC_CLAMP_UB (var54.i);
245 /* 20: storeb */
246 ptr0[i] = var41;
247 }
248
249 }
250
251 #else
252 static void
_backup_deinterlace_line_vfir(OrcExecutor * ORC_RESTRICT ex)253 _backup_deinterlace_line_vfir (OrcExecutor * ORC_RESTRICT ex)
254 {
255 int i;
256 int n = ex->n;
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;
263 orc_int8 var35;
264 orc_int8 var36;
265 orc_int8 var37;
266 orc_int8 var38;
267 orc_int8 var39;
268 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
269 volatile orc_union16 var40;
270 #else
271 orc_union16 var40;
272 #endif
273 orc_int8 var41;
274 orc_union16 var42;
275 orc_union16 var43;
276 orc_union16 var44;
277 orc_union16 var45;
278 orc_union16 var46;
279 orc_union16 var47;
280 orc_union16 var48;
281 orc_union16 var49;
282 orc_union16 var50;
283 orc_union16 var51;
284 orc_union16 var52;
285 orc_union16 var53;
286 orc_union16 var54;
287
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];
294
295 /* 16: loadpw */
296 var40.i = 0x00000004; /* 4 or 1.97626e-323f */
297
298 for (i = 0; i < n; i++) {
299 /* 0: loadb */
300 var35 = ptr4[i];
301 /* 1: convubw */
302 var42.i = (orc_uint8) var35;
303 /* 2: loadb */
304 var36 = ptr8[i];
305 /* 3: convubw */
306 var43.i = (orc_uint8) var36;
307 /* 4: addw */
308 var44.i = var42.i + var43.i;
309 /* 5: loadb */
310 var37 = ptr5[i];
311 /* 6: convubw */
312 var45.i = (orc_uint8) var37;
313 /* 7: loadb */
314 var38 = ptr7[i];
315 /* 8: convubw */
316 var46.i = (orc_uint8) var38;
317 /* 9: addw */
318 var47.i = var45.i + var46.i;
319 /* 10: shlw */
320 var48.i = ((orc_uint16) var47.i) << 2;
321 /* 11: loadb */
322 var39 = ptr6[i];
323 /* 12: convubw */
324 var49.i = (orc_uint8) var39;
325 /* 13: shlw */
326 var50.i = ((orc_uint16) var49.i) << 1;
327 /* 14: subw */
328 var51.i = var48.i - var44.i;
329 /* 15: addw */
330 var52.i = var51.i + var50.i;
331 /* 17: addw */
332 var53.i = var52.i + var40.i;
333 /* 18: shrsw */
334 var54.i = var53.i >> 3;
335 /* 19: convsuswb */
336 var41 = ORC_CLAMP_UB (var54.i);
337 /* 20: storeb */
338 ptr0[i] = var41;
339 }
340
341 }
342
343 void
deinterlace_line_vfir(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,const guint8 * ORC_RESTRICT s2,const guint8 * ORC_RESTRICT s3,const guint8 * ORC_RESTRICT s4,const guint8 * ORC_RESTRICT s5,int n)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)
347 {
348 OrcExecutor _ex, *ex = &_ex;
349 static volatile int p_inited = 0;
350 static OrcCode *c = 0;
351 void (*func) (OrcExecutor *);
352
353 if (!p_inited) {
354 orc_once_mutex_lock ();
355 if (!p_inited) {
356 OrcProgram *p;
357
358 #if 1
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,
368 };
369 p = orc_program_new_from_static_bytecode (bc);
370 orc_program_set_backup_function (p, _backup_deinterlace_line_vfir);
371 #else
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");
388
389 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
390 ORC_VAR_D1);
391 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S5, ORC_VAR_D1,
392 ORC_VAR_D1);
393 orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
394 ORC_VAR_D1);
395 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
396 ORC_VAR_D1);
397 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S4, ORC_VAR_D1,
398 ORC_VAR_D1);
399 orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3,
400 ORC_VAR_D1);
401 orc_program_append_2 (p, "shlw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1,
402 ORC_VAR_D1);
403 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1,
404 ORC_VAR_D1);
405 orc_program_append_2 (p, "shlw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C2,
406 ORC_VAR_D1);
407 orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1,
408 ORC_VAR_D1);
409 orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3,
410 ORC_VAR_D1);
411 orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C3,
412 ORC_VAR_D1);
413 orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C4,
414 ORC_VAR_D1);
415 orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2,
416 ORC_VAR_D1, ORC_VAR_D1);
417 #endif
418
419 orc_program_compile (p);
420 c = orc_program_take_code (p);
421 orc_program_free (p);
422 }
423 p_inited = TRUE;
424 orc_once_mutex_unlock ();
425 }
426 ex->arrays[ORC_VAR_A2] = c;
427 ex->program = 0;
428
429 ex->n = n;
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;
436
437 func = c->exec;
438 func (ex);
439 }
440 #endif
441
442
443 /* deinterlace_line_linear */
444 #ifdef DISABLE_ORC
445 void
deinterlace_line_linear(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,const guint8 * ORC_RESTRICT s2,int n)446 deinterlace_line_linear (guint8 * ORC_RESTRICT d1,
447 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n)
448 {
449 int i;
450 orc_int8 *ORC_RESTRICT ptr0;
451 const orc_int8 *ORC_RESTRICT ptr4;
452 const orc_int8 *ORC_RESTRICT ptr5;
453 orc_int8 var32;
454 orc_int8 var33;
455 orc_int8 var34;
456
457 ptr0 = (orc_int8 *) d1;
458 ptr4 = (orc_int8 *) s1;
459 ptr5 = (orc_int8 *) s2;
460
461
462 for (i = 0; i < n; i++) {
463 /* 0: loadb */
464 var32 = ptr4[i];
465 /* 1: loadb */
466 var33 = ptr5[i];
467 /* 2: avgub */
468 var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1;
469 /* 3: storeb */
470 ptr0[i] = var34;
471 }
472
473 }
474
475 #else
476 static void
_backup_deinterlace_line_linear(OrcExecutor * ORC_RESTRICT ex)477 _backup_deinterlace_line_linear (OrcExecutor * ORC_RESTRICT ex)
478 {
479 int i;
480 int n = ex->n;
481 orc_int8 *ORC_RESTRICT ptr0;
482 const orc_int8 *ORC_RESTRICT ptr4;
483 const orc_int8 *ORC_RESTRICT ptr5;
484 orc_int8 var32;
485 orc_int8 var33;
486 orc_int8 var34;
487
488 ptr0 = (orc_int8 *) ex->arrays[0];
489 ptr4 = (orc_int8 *) ex->arrays[4];
490 ptr5 = (orc_int8 *) ex->arrays[5];
491
492
493 for (i = 0; i < n; i++) {
494 /* 0: loadb */
495 var32 = ptr4[i];
496 /* 1: loadb */
497 var33 = ptr5[i];
498 /* 2: avgub */
499 var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1;
500 /* 3: storeb */
501 ptr0[i] = var34;
502 }
503
504 }
505
506 void
deinterlace_line_linear(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,const guint8 * ORC_RESTRICT s2,int n)507 deinterlace_line_linear (guint8 * ORC_RESTRICT d1,
508 const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n)
509 {
510 OrcExecutor _ex, *ex = &_ex;
511 static volatile int p_inited = 0;
512 static OrcCode *c = 0;
513 void (*func) (OrcExecutor *);
514
515 if (!p_inited) {
516 orc_once_mutex_lock ();
517 if (!p_inited) {
518 OrcProgram *p;
519
520 #if 1
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,
525 };
526 p = orc_program_new_from_static_bytecode (bc);
527 orc_program_set_backup_function (p, _backup_deinterlace_line_linear);
528 #else
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");
535
536 orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2,
537 ORC_VAR_D1);
538 #endif
539
540 orc_program_compile (p);
541 c = orc_program_take_code (p);
542 orc_program_free (p);
543 }
544 p_inited = TRUE;
545 orc_once_mutex_unlock ();
546 }
547 ex->arrays[ORC_VAR_A2] = c;
548 ex->program = 0;
549
550 ex->n = n;
551 ex->arrays[ORC_VAR_D1] = d1;
552 ex->arrays[ORC_VAR_S1] = (void *) s1;
553 ex->arrays[ORC_VAR_S2] = (void *) s2;
554
555 func = c->exec;
556 func (ex);
557 }
558 #endif
559
560
561 /* deinterlace_line_linear_blend */
562 #ifdef DISABLE_ORC
563 void
deinterlace_line_linear_blend(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,const guint8 * ORC_RESTRICT s2,const guint8 * ORC_RESTRICT s3,int n)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)
567 {
568 int i;
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;
573 orc_int8 var35;
574 orc_int8 var36;
575 orc_int8 var37;
576 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
577 volatile orc_union16 var38;
578 #else
579 orc_union16 var38;
580 #endif
581 orc_int8 var39;
582 orc_union16 var40;
583 orc_union16 var41;
584 orc_union16 var42;
585 orc_union16 var43;
586 orc_union16 var44;
587 orc_union16 var45;
588 orc_union16 var46;
589 orc_union16 var47;
590
591 ptr0 = (orc_int8 *) d1;
592 ptr4 = (orc_int8 *) s1;
593 ptr5 = (orc_int8 *) s2;
594 ptr6 = (orc_int8 *) s3;
595
596 /* 9: loadpw */
597 var38.i = 0x00000002; /* 2 or 9.88131e-324f */
598
599 for (i = 0; i < n; i++) {
600 /* 0: loadb */
601 var35 = ptr4[i];
602 /* 1: convubw */
603 var40.i = (orc_uint8) var35;
604 /* 2: loadb */
605 var36 = ptr5[i];
606 /* 3: convubw */
607 var41.i = (orc_uint8) var36;
608 /* 4: loadb */
609 var37 = ptr6[i];
610 /* 5: convubw */
611 var42.i = (orc_uint8) var37;
612 /* 6: addw */
613 var43.i = var40.i + var41.i;
614 /* 7: addw */
615 var44.i = var42.i + var42.i;
616 /* 8: addw */
617 var45.i = var43.i + var44.i;
618 /* 10: addw */
619 var46.i = var45.i + var38.i;
620 /* 11: shrsw */
621 var47.i = var46.i >> 2;
622 /* 12: convsuswb */
623 var39 = ORC_CLAMP_UB (var47.i);
624 /* 13: storeb */
625 ptr0[i] = var39;
626 }
627
628 }
629
630 #else
631 static void
_backup_deinterlace_line_linear_blend(OrcExecutor * ORC_RESTRICT ex)632 _backup_deinterlace_line_linear_blend (OrcExecutor * ORC_RESTRICT ex)
633 {
634 int i;
635 int n = ex->n;
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;
640 orc_int8 var35;
641 orc_int8 var36;
642 orc_int8 var37;
643 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
644 volatile orc_union16 var38;
645 #else
646 orc_union16 var38;
647 #endif
648 orc_int8 var39;
649 orc_union16 var40;
650 orc_union16 var41;
651 orc_union16 var42;
652 orc_union16 var43;
653 orc_union16 var44;
654 orc_union16 var45;
655 orc_union16 var46;
656 orc_union16 var47;
657
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];
662
663 /* 9: loadpw */
664 var38.i = 0x00000002; /* 2 or 9.88131e-324f */
665
666 for (i = 0; i < n; i++) {
667 /* 0: loadb */
668 var35 = ptr4[i];
669 /* 1: convubw */
670 var40.i = (orc_uint8) var35;
671 /* 2: loadb */
672 var36 = ptr5[i];
673 /* 3: convubw */
674 var41.i = (orc_uint8) var36;
675 /* 4: loadb */
676 var37 = ptr6[i];
677 /* 5: convubw */
678 var42.i = (orc_uint8) var37;
679 /* 6: addw */
680 var43.i = var40.i + var41.i;
681 /* 7: addw */
682 var44.i = var42.i + var42.i;
683 /* 8: addw */
684 var45.i = var43.i + var44.i;
685 /* 10: addw */
686 var46.i = var45.i + var38.i;
687 /* 11: shrsw */
688 var47.i = var46.i >> 2;
689 /* 12: convsuswb */
690 var39 = ORC_CLAMP_UB (var47.i);
691 /* 13: storeb */
692 ptr0[i] = var39;
693 }
694
695 }
696
697 void
deinterlace_line_linear_blend(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,const guint8 * ORC_RESTRICT s2,const guint8 * ORC_RESTRICT s3,int n)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)
701 {
702 OrcExecutor _ex, *ex = &_ex;
703 static volatile int p_inited = 0;
704 static OrcCode *c = 0;
705 void (*func) (OrcExecutor *);
706
707 if (!p_inited) {
708 orc_once_mutex_lock ();
709 if (!p_inited) {
710 OrcProgram *p;
711
712 #if 1
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,
716 100,
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,
721 };
722 p = orc_program_new_from_static_bytecode (bc);
723 orc_program_set_backup_function (p,
724 _backup_deinterlace_line_linear_blend);
725 #else
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");
738
739 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
740 ORC_VAR_D1);
741 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
742 ORC_VAR_D1);
743 orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1,
744 ORC_VAR_D1);
745 orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
746 ORC_VAR_D1);
747 orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T3,
748 ORC_VAR_D1);
749 orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T3,
750 ORC_VAR_D1);
751 orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
752 ORC_VAR_D1);
753 orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
754 ORC_VAR_D1);
755 orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1,
756 ORC_VAR_D1, ORC_VAR_D1);
757 #endif
758
759 orc_program_compile (p);
760 c = orc_program_take_code (p);
761 orc_program_free (p);
762 }
763 p_inited = TRUE;
764 orc_once_mutex_unlock ();
765 }
766 ex->arrays[ORC_VAR_A2] = c;
767 ex->program = 0;
768
769 ex->n = n;
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;
774
775 func = c->exec;
776 func (ex);
777 }
778 #endif
779
780
781 /* deinterlace_line_greedy */
782 #ifdef DISABLE_ORC
783 void
deinterlace_line_greedy(orc_uint8 * ORC_RESTRICT d1,const orc_uint8 * ORC_RESTRICT s1,const orc_uint8 * ORC_RESTRICT s2,const orc_uint8 * ORC_RESTRICT s3,const orc_uint8 * ORC_RESTRICT s4,int p1,int n)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,
787 int p1, int n)
788 {
789 int i;
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;
797 #else
798 orc_int8 var44;
799 #endif
800 orc_int8 var45;
801 orc_int8 var46;
802 orc_int8 var47;
803 orc_int8 var48;
804 orc_int8 var49;
805 orc_int8 var50;
806 orc_int8 var51;
807 orc_int8 var52;
808 orc_int8 var53;
809 orc_int8 var54;
810 orc_int8 var55;
811 orc_int8 var56;
812 orc_int8 var57;
813 orc_int8 var58;
814 orc_int8 var59;
815 orc_int8 var60;
816 orc_int8 var61;
817 orc_int8 var62;
818 orc_int8 var63;
819 orc_int8 var64;
820 orc_int8 var65;
821 orc_int8 var66;
822 orc_int8 var67;
823 orc_int8 var68;
824
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;
830
831 /* 11: loadpb */
832 var44 = 0x00000080; /* 128 or 6.32404e-322f */
833 /* 20: loadpb */
834 var45 = p1;
835
836 for (i = 0; i < n; i++) {
837 /* 0: loadb */
838 var47 = ptr4[i];
839 /* 1: loadb */
840 var48 = ptr7[i];
841 /* 2: loadb */
842 var49 = ptr6[i];
843 /* 3: loadb */
844 var50 = ptr5[i];
845 /* 4: avgub */
846 var51 = ((orc_uint8) var50 + (orc_uint8) var49 + 1) >> 1;
847 /* 5: maxub */
848 var52 = ORC_MAX ((orc_uint8) var47, (orc_uint8) var51);
849 /* 6: minub */
850 var53 = ORC_MIN ((orc_uint8) var47, (orc_uint8) var51);
851 /* 7: subb */
852 var54 = var52 - var53;
853 /* 8: maxub */
854 var55 = ORC_MAX ((orc_uint8) var48, (orc_uint8) var51);
855 /* 9: minub */
856 var56 = ORC_MIN ((orc_uint8) var48, (orc_uint8) var51);
857 /* 10: subb */
858 var57 = var55 - var56;
859 /* 12: xorb */
860 var58 = var54 ^ var44;
861 /* 13: xorb */
862 var59 = var57 ^ var44;
863 /* 14: cmpgtsb */
864 var60 = (var58 > var59) ? (~0) : 0;
865 /* 15: andb */
866 var61 = var48 & var60;
867 /* 16: andnb */
868 var62 = (~var60) & var47;
869 /* 17: orb */
870 var63 = var61 | var62;
871 /* 18: maxub */
872 var64 = ORC_MAX ((orc_uint8) var50, (orc_uint8) var49);
873 /* 19: minub */
874 var65 = ORC_MIN ((orc_uint8) var50, (orc_uint8) var49);
875 /* 21: addusb */
876 var66 = ORC_CLAMP_UB ((orc_uint8) var64 + (orc_uint8) var45);
877 /* 22: subusb */
878 var67 = ORC_CLAMP_UB ((orc_uint8) var65 - (orc_uint8) var45);
879 /* 23: minub */
880 var68 = ORC_MIN ((orc_uint8) var63, (orc_uint8) var66);
881 /* 24: maxub */
882 var46 = ORC_MAX ((orc_uint8) var68, (orc_uint8) var67);
883 /* 25: storeb */
884 ptr0[i] = var46;
885 }
886
887 }
888
889 #else
890 static void
_backup_deinterlace_line_greedy(OrcExecutor * ORC_RESTRICT ex)891 _backup_deinterlace_line_greedy (OrcExecutor * ORC_RESTRICT ex)
892 {
893 int i;
894 int n = ex->n;
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;
902 #else
903 orc_int8 var44;
904 #endif
905 orc_int8 var45;
906 orc_int8 var46;
907 orc_int8 var47;
908 orc_int8 var48;
909 orc_int8 var49;
910 orc_int8 var50;
911 orc_int8 var51;
912 orc_int8 var52;
913 orc_int8 var53;
914 orc_int8 var54;
915 orc_int8 var55;
916 orc_int8 var56;
917 orc_int8 var57;
918 orc_int8 var58;
919 orc_int8 var59;
920 orc_int8 var60;
921 orc_int8 var61;
922 orc_int8 var62;
923 orc_int8 var63;
924 orc_int8 var64;
925 orc_int8 var65;
926 orc_int8 var66;
927 orc_int8 var67;
928 orc_int8 var68;
929
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];
935
936 /* 11: loadpb */
937 var44 = 0x00000080; /* 128 or 6.32404e-322f */
938 /* 20: loadpb */
939 var45 = ex->params[24];
940
941 for (i = 0; i < n; i++) {
942 /* 0: loadb */
943 var47 = ptr4[i];
944 /* 1: loadb */
945 var48 = ptr7[i];
946 /* 2: loadb */
947 var49 = ptr6[i];
948 /* 3: loadb */
949 var50 = ptr5[i];
950 /* 4: avgub */
951 var51 = ((orc_uint8) var50 + (orc_uint8) var49 + 1) >> 1;
952 /* 5: maxub */
953 var52 = ORC_MAX ((orc_uint8) var47, (orc_uint8) var51);
954 /* 6: minub */
955 var53 = ORC_MIN ((orc_uint8) var47, (orc_uint8) var51);
956 /* 7: subb */
957 var54 = var52 - var53;
958 /* 8: maxub */
959 var55 = ORC_MAX ((orc_uint8) var48, (orc_uint8) var51);
960 /* 9: minub */
961 var56 = ORC_MIN ((orc_uint8) var48, (orc_uint8) var51);
962 /* 10: subb */
963 var57 = var55 - var56;
964 /* 12: xorb */
965 var58 = var54 ^ var44;
966 /* 13: xorb */
967 var59 = var57 ^ var44;
968 /* 14: cmpgtsb */
969 var60 = (var58 > var59) ? (~0) : 0;
970 /* 15: andb */
971 var61 = var48 & var60;
972 /* 16: andnb */
973 var62 = (~var60) & var47;
974 /* 17: orb */
975 var63 = var61 | var62;
976 /* 18: maxub */
977 var64 = ORC_MAX ((orc_uint8) var50, (orc_uint8) var49);
978 /* 19: minub */
979 var65 = ORC_MIN ((orc_uint8) var50, (orc_uint8) var49);
980 /* 21: addusb */
981 var66 = ORC_CLAMP_UB ((orc_uint8) var64 + (orc_uint8) var45);
982 /* 22: subusb */
983 var67 = ORC_CLAMP_UB ((orc_uint8) var65 - (orc_uint8) var45);
984 /* 23: minub */
985 var68 = ORC_MIN ((orc_uint8) var63, (orc_uint8) var66);
986 /* 24: maxub */
987 var46 = ORC_MAX ((orc_uint8) var68, (orc_uint8) var67);
988 /* 25: storeb */
989 ptr0[i] = var46;
990 }
991
992 }
993
994 void
deinterlace_line_greedy(orc_uint8 * ORC_RESTRICT d1,const orc_uint8 * ORC_RESTRICT s1,const orc_uint8 * ORC_RESTRICT s2,const orc_uint8 * ORC_RESTRICT s3,const orc_uint8 * ORC_RESTRICT s4,int p1,int n)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,
998 int p1, int n)
999 {
1000 OrcExecutor _ex, *ex = &_ex;
1001 static volatile int p_inited = 0;
1002 static OrcCode *c = 0;
1003 void (*func) (OrcExecutor *);
1004
1005 if (!p_inited) {
1006 orc_once_mutex_lock ();
1007 if (!p_inited) {
1008 OrcProgram *p;
1009
1010 #if 1
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,
1022 42, 2, 0,
1023 };
1024 p = orc_program_new_from_static_bytecode (bc);
1025 orc_program_set_backup_function (p, _backup_deinterlace_line_greedy);
1026 #else
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");
1049
1050 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
1051 ORC_VAR_D1);
1052 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T2, ORC_VAR_S4, ORC_VAR_D1,
1053 ORC_VAR_D1);
1054 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1,
1055 ORC_VAR_D1);
1056 orc_program_append_2 (p, "loadb", 0, ORC_VAR_T4, ORC_VAR_S2, ORC_VAR_D1,
1057 ORC_VAR_D1);
1058 orc_program_append_2 (p, "avgub", 0, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_T3,
1059 ORC_VAR_D1);
1060 orc_program_append_2 (p, "maxub", 0, ORC_VAR_T8, ORC_VAR_T1, ORC_VAR_T5,
1061 ORC_VAR_D1);
1062 orc_program_append_2 (p, "minub", 0, ORC_VAR_T9, ORC_VAR_T1, ORC_VAR_T5,
1063 ORC_VAR_D1);
1064 orc_program_append_2 (p, "subb", 0, ORC_VAR_T6, ORC_VAR_T8, ORC_VAR_T9,
1065 ORC_VAR_D1);
1066 orc_program_append_2 (p, "maxub", 0, ORC_VAR_T8, ORC_VAR_T2, ORC_VAR_T5,
1067 ORC_VAR_D1);
1068 orc_program_append_2 (p, "minub", 0, ORC_VAR_T9, ORC_VAR_T2, ORC_VAR_T5,
1069 ORC_VAR_D1);
1070 orc_program_append_2 (p, "subb", 0, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_T9,
1071 ORC_VAR_D1);
1072 orc_program_append_2 (p, "xorb", 0, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_C1,
1073 ORC_VAR_D1);
1074 orc_program_append_2 (p, "xorb", 0, ORC_VAR_T7, ORC_VAR_T7, ORC_VAR_C1,
1075 ORC_VAR_D1);
1076 orc_program_append_2 (p, "cmpgtsb", 0, ORC_VAR_T9, ORC_VAR_T6, ORC_VAR_T7,
1077 ORC_VAR_D1);
1078 orc_program_append_2 (p, "andb", 0, ORC_VAR_T8, ORC_VAR_T2, ORC_VAR_T9,
1079 ORC_VAR_D1);
1080 orc_program_append_2 (p, "andnb", 0, ORC_VAR_T9, ORC_VAR_T9, ORC_VAR_T1,
1081 ORC_VAR_D1);
1082 orc_program_append_2 (p, "orb", 0, ORC_VAR_T10, ORC_VAR_T8, ORC_VAR_T9,
1083 ORC_VAR_D1);
1084 orc_program_append_2 (p, "maxub", 0, ORC_VAR_T12, ORC_VAR_T4, ORC_VAR_T3,
1085 ORC_VAR_D1);
1086 orc_program_append_2 (p, "minub", 0, ORC_VAR_T11, ORC_VAR_T4, ORC_VAR_T3,
1087 ORC_VAR_D1);
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,
1095 ORC_VAR_D1);
1096 #endif
1097
1098 orc_program_compile (p);
1099 c = orc_program_take_code (p);
1100 orc_program_free (p);
1101 }
1102 p_inited = TRUE;
1103 orc_once_mutex_unlock ();
1104 }
1105 ex->arrays[ORC_VAR_A2] = c;
1106 ex->program = 0;
1107
1108 ex->n = n;
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;
1115
1116 func = c->exec;
1117 func (ex);
1118 }
1119 #endif
1120