audiotestsrc: fix rounding errors that might cause segments to be one sample too...
[platform/upstream/gstreamer.git] / gst / videoconvert / gstvideoconvertorc.orc
1
2 .function video_convert_orc_memcpy_2d
3 .flags 2d
4 .dest 1 d1 guint8
5 .source 1 s1 guint8
6
7 copyb d1, s1
8
9 .function video_convert_orc_convert_I420_UYVY
10 .dest 4 d1 guint8
11 .dest 4 d2 guint8
12 .source 2 y1 guint8
13 .source 2 y2 guint8
14 .source 1 u guint8
15 .source 1 v guint8
16 .temp 2 uv
17
18 mergebw uv, u, v
19 x2 mergebw d1, uv, y1
20 x2 mergebw d2, uv, y2
21
22
23 .function video_convert_orc_convert_I420_YUY2
24 .dest 4 d1 guint8
25 .dest 4 d2 guint8
26 .source 2 y1 guint8
27 .source 2 y2 guint8
28 .source 1 u guint8
29 .source 1 v guint8
30 .temp 2 uv
31
32 mergebw uv, u, v
33 x2 mergebw d1, y1, uv
34 x2 mergebw d2, y2, uv
35
36
37
38 .function video_convert_orc_convert_I420_AYUV
39 .dest 4 d1 guint8
40 .dest 4 d2 guint8
41 .source 1 y1 guint8
42 .source 1 y2 guint8
43 .source 1 u guint8
44 .source 1 v guint8
45 .const 1 c255 255
46 .temp 2 uv
47 .temp 2 ay
48 .temp 1 tu
49 .temp 1 tv
50
51 loadupdb tu, u
52 loadupdb tv, v
53 mergebw uv, tu, tv
54 mergebw ay, c255, y1
55 mergewl d1, ay, uv
56 mergebw ay, c255, y2
57 mergewl d2, ay, uv
58
59
60 .function video_convert_orc_convert_YUY2_I420
61 .dest 2 y1 guint8
62 .dest 2 y2 guint8
63 .dest 1 u guint8
64 .dest 1 v guint8
65 .source 4 yuv1 guint8
66 .source 4 yuv2 guint8
67 .temp 2 t1
68 .temp 2 t2
69 .temp 2 ty
70
71 x2 splitwb t1, ty, yuv1
72 storew y1, ty
73 x2 splitwb t2, ty, yuv2
74 storew y2, ty
75 x2 avgub t1, t1, t2
76 splitwb v, u, t1
77
78
79 .function video_convert_orc_convert_UYVY_YUY2
80 .flags 2d
81 .dest 4 yuy2 guint8
82 .source 4 uyvy guint8
83
84 x2 swapw yuy2, uyvy
85
86
87 .function video_convert_orc_planar_chroma_420_422
88 .flags 2d
89 .dest 1 d1 guint8
90 .dest 1 d2 guint8
91 .source 1 s guint8
92
93 copyb d1, s
94 copyb d2, s
95
96
97 .function video_convert_orc_planar_chroma_420_444
98 .flags 2d
99 .dest 2 d1 guint8
100 .dest 2 d2 guint8
101 .source 1 s guint8
102 .temp 2 t
103
104 splatbw t, s
105 storew d1, t
106 storew d2, t
107
108
109 .function video_convert_orc_planar_chroma_422_444
110 .flags 2d
111 .dest 2 d1 guint8
112 .source 1 s guint8
113 .temp 2 t
114
115 splatbw t, s
116 storew d1, t
117
118
119 .function video_convert_orc_planar_chroma_444_422
120 .flags 2d
121 .dest 1 d guint8
122 .source 2 s guint8
123 .temp 1 t1
124 .temp 1 t2
125
126 splitwb t1, t2, s
127 avgub d, t1, t2
128
129
130 .function video_convert_orc_planar_chroma_444_420
131 .flags 2d
132 .dest 1 d guint8
133 .source 2 s1 guint8
134 .source 2 s2 guint8
135 .temp 2 t
136 .temp 1 t1
137 .temp 1 t2
138
139 x2 avgub t, s1, s2
140 splitwb t1, t2, t
141 avgub d, t1, t2
142
143
144 .function video_convert_orc_planar_chroma_422_420
145 .flags 2d
146 .dest 1 d guint8
147 .source 1 s1 guint8
148 .source 1 s2 guint8
149
150 avgub d, s1, s2
151
152
153 .function video_convert_orc_convert_YUY2_AYUV
154 .flags 2d
155 .dest 8 ayuv guint8
156 .source 4 yuy2 guint8
157 .const 2 c255 0xff
158 .temp 2 yy
159 .temp 2 uv
160 .temp 4 ayay
161 .temp 4 uvuv
162
163 x2 splitwb uv, yy, yuy2
164 x2 mergebw ayay, c255, yy
165 mergewl uvuv, uv, uv
166 x2 mergewl ayuv, ayay, uvuv
167
168
169 .function video_convert_orc_convert_UYVY_AYUV
170 .flags 2d
171 .dest 8 ayuv guint8
172 .source 4 uyvy guint8
173 .const 2 c255 0xff
174 .temp 2 yy
175 .temp 2 uv
176 .temp 4 ayay
177 .temp 4 uvuv
178
179 x2 splitwb yy, uv, uyvy
180 x2 mergebw ayay, c255, yy
181 mergewl uvuv, uv, uv
182 x2 mergewl ayuv, ayay, uvuv
183
184
185 .function video_convert_orc_convert_YUY2_Y42B
186 .flags 2d
187 .dest 2 y guint8
188 .dest 1 u guint8
189 .dest 1 v guint8
190 .source 4 yuy2 guint8
191 .temp 2 uv
192
193 x2 splitwb uv, y, yuy2
194 splitwb v, u, uv
195
196
197 .function video_convert_orc_convert_UYVY_Y42B
198 .flags 2d
199 .dest 2 y guint8
200 .dest 1 u guint8
201 .dest 1 v guint8
202 .source 4 uyvy guint8
203 .temp 2 uv
204
205 x2 splitwb y, uv, uyvy
206 splitwb v, u, uv
207
208
209 .function video_convert_orc_convert_YUY2_Y444
210 .flags 2d
211 .dest 2 y guint8
212 .dest 2 uu guint8
213 .dest 2 vv guint8
214 .source 4 yuy2 guint8
215 .temp 2 uv
216 .temp 1 u
217 .temp 1 v
218
219 x2 splitwb uv, y, yuy2
220 splitwb v, u, uv
221 splatbw uu, u
222 splatbw vv, v
223
224
225 .function video_convert_orc_convert_UYVY_Y444
226 .flags 2d
227 .dest 2 y guint8
228 .dest 2 uu guint8
229 .dest 2 vv guint8
230 .source 4 uyvy guint8
231 .temp 2 uv
232 .temp 1 u
233 .temp 1 v
234
235 x2 splitwb y, uv, uyvy
236 splitwb v, u, uv
237 splatbw uu, u
238 splatbw vv, v
239
240
241 .function video_convert_orc_convert_UYVY_I420
242 .dest 2 y1 guint8
243 .dest 2 y2 guint8
244 .dest 1 u guint8
245 .dest 1 v guint8
246 .source 4 yuv1 guint8
247 .source 4 yuv2 guint8
248 .temp 2 t1
249 .temp 2 t2
250 .temp 2 ty
251
252 x2 splitwb ty, t1, yuv1
253 storew y1, ty
254 x2 splitwb ty, t2, yuv2
255 storew y2, ty
256 x2 avgub t1, t1, t2
257 splitwb v, u, t1
258
259
260
261 .function video_convert_orc_convert_AYUV_I420
262 .flags 2d
263 .dest 2 y1 guint8
264 .dest 2 y2 guint8
265 .dest 1 u guint8
266 .dest 1 v guint8
267 .source 8 ayuv1 guint8
268 .source 8 ayuv2 guint8
269 .temp 4 ay
270 .temp 4 uv1
271 .temp 4 uv2
272 .temp 4 uv
273 .temp 2 uu
274 .temp 2 vv
275 .temp 1 t1
276 .temp 1 t2
277
278 x2 splitlw uv1, ay, ayuv1
279 x2 select1wb y1, ay
280 x2 splitlw uv2, ay, ayuv2
281 x2 select1wb y2, ay
282 x4 avgub uv, uv1, uv2
283 x2 splitwb vv, uu, uv
284 splitwb t1, t2, uu
285 avgub u, t1, t2
286 splitwb t1, t2, vv
287 avgub v, t1, t2
288
289
290
291 .function video_convert_orc_convert_AYUV_YUY2
292 .flags 2d
293 .dest 4 yuy2 guint8
294 .source 8 ayuv guint8
295 .temp 2 yy
296 .temp 2 uv1
297 .temp 2 uv2
298 .temp 4 ayay
299 .temp 4 uvuv
300
301 x2 splitlw uvuv, ayay, ayuv
302 splitlw uv1, uv2, uvuv
303 x2 avgub uv1, uv1, uv2
304 x2 select1wb yy, ayay
305 x2 mergebw yuy2, yy, uv1
306
307
308 .function video_convert_orc_convert_AYUV_UYVY
309 .flags 2d
310 .dest 4 yuy2 guint8
311 .source 8 ayuv guint8
312 .temp 2 yy
313 .temp 2 uv1
314 .temp 2 uv2
315 .temp 4 ayay
316 .temp 4 uvuv
317
318 x2 splitlw uvuv, ayay, ayuv
319 splitlw uv1, uv2, uvuv
320 x2 avgub uv1, uv1, uv2
321 x2 select1wb yy, ayay
322 x2 mergebw yuy2, uv1, yy
323
324
325
326 .function video_convert_orc_convert_AYUV_Y42B
327 .flags 2d
328 .dest 2 y guint8
329 .dest 1 u guint8
330 .dest 1 v guint8
331 .source 8 ayuv guint8
332 .temp 4 ayay
333 .temp 4 uvuv
334 .temp 2 uv1
335 .temp 2 uv2
336
337 x2 splitlw uvuv, ayay, ayuv
338 splitlw uv1, uv2, uvuv
339 x2 avgub uv1, uv1, uv2
340 splitwb v, u, uv1
341 x2 select1wb y, ayay
342
343
344 .function video_convert_orc_convert_AYUV_Y444
345 .flags 2d
346 .dest 1 y guint8
347 .dest 1 u guint8
348 .dest 1 v guint8
349 .source 4 ayuv guint8
350 .temp 2 ay
351 .temp 2 uv
352
353 splitlw uv, ay, ayuv
354 splitwb v, u, uv
355 select1wb y, ay
356
357
358 .function video_convert_orc_convert_Y42B_YUY2
359 .flags 2d
360 .dest 4 yuy2 guint8
361 .source 2 y guint8
362 .source 1 u guint8
363 .source 1 v guint8
364 .temp 2 uv
365
366 mergebw uv, u, v
367 x2 mergebw yuy2, y, uv
368
369
370 .function video_convert_orc_convert_Y42B_UYVY
371 .flags 2d
372 .dest 4 uyvy guint8
373 .source 2 y guint8
374 .source 1 u guint8
375 .source 1 v guint8
376 .temp 2 uv
377
378 mergebw uv, u, v
379 x2 mergebw uyvy, uv, y
380
381
382 .function video_convert_orc_convert_Y42B_AYUV
383 .flags 2d
384 .dest 8 ayuv guint8
385 .source 2 yy guint8
386 .source 1 u guint8
387 .source 1 v guint8
388 .const 1 c255 255
389 .temp 2 uv
390 .temp 2 ay
391 .temp 4 uvuv
392 .temp 4 ayay
393
394 mergebw uv, u, v
395 x2 mergebw ayay, c255, yy
396 mergewl uvuv, uv, uv
397 x2 mergewl ayuv, ayay, uvuv
398
399
400 .function video_convert_orc_convert_Y444_YUY2
401 .flags 2d
402 .dest 4 yuy2 guint8
403 .source 2 y guint8
404 .source 2 u guint8
405 .source 2 v guint8
406 .temp 2 uv
407 .temp 4 uvuv
408 .temp 2 uv1
409 .temp 2 uv2
410
411 x2 mergebw uvuv, u, v
412 splitlw uv1, uv2, uvuv
413 x2 avgub uv, uv1, uv2
414 x2 mergebw yuy2, y, uv
415
416
417 .function video_convert_orc_convert_Y444_UYVY
418 .flags 2d
419 .dest 4 uyvy guint8
420 .source 2 y guint8
421 .source 2 u guint8
422 .source 2 v guint8
423 .temp 2 uv
424 .temp 4 uvuv
425 .temp 2 uv1
426 .temp 2 uv2
427
428 x2 mergebw uvuv, u, v
429 splitlw uv1, uv2, uvuv
430 x2 avgub uv, uv1, uv2
431 x2 mergebw uyvy, uv, y
432
433
434 .function video_convert_orc_convert_Y444_AYUV
435 .flags 2d
436 .dest 4 ayuv guint8
437 .source 1 yy guint8
438 .source 1 u guint8
439 .source 1 v guint8
440 .const 1 c255 255
441 .temp 2 uv
442 .temp 2 ay
443
444 mergebw uv, u, v
445 mergebw ay, c255, yy
446 mergewl ayuv, ay, uv
447
448
449
450 .function video_convert_orc_convert_AYUV_ARGB
451 .flags 2d
452 .dest 4 argb guint8
453 .source 4 ayuv guint8
454 .temp 2 t1
455 .temp 2 t2
456 .temp 1 a
457 .temp 1 y
458 .temp 1 u
459 .temp 1 v
460 .temp 2 wy
461 .temp 2 wu
462 .temp 2 wv
463 .temp 2 wr
464 .temp 2 wg
465 .temp 2 wb
466 .temp 1 r
467 .temp 1 g
468 .temp 1 b
469 .temp 4 x
470 .const 1 c8 8
471
472 x4 subb x, ayuv, 128
473 splitlw t1, t2, x
474 splitwb y, a, t2
475 splitwb v, u, t1
476 convsbw wy, y
477 convsbw wu, u
478 convsbw wv, v
479
480 mullw t1, wy, 42
481 shrsw t1, t1, c8
482 addssw wy, wy, t1
483
484 addssw wr, wy, wv
485 mullw t1, wv, 103
486 shrsw t1, t1, c8
487 subssw wr, wr, t1
488 addssw wr, wr, wv
489
490 addssw wb, wy, wu
491 addssw wb, wb, wu
492 mullw t1, wu, 4
493 shrsw t1, t1, c8
494 addssw wb, wb, t1
495
496 mullw t1, wu, 100
497 shrsw t1, t1, c8
498 subssw wg, wy, t1
499 mullw t1, wv, 104
500 shrsw t1, t1, c8
501 subssw wg, wg, t1
502 subssw wg, wg, t1
503
504 convssswb r, wr
505 convssswb g, wg
506 convssswb b, wb
507
508 mergebw t1, a, r
509 mergebw t2, g, b
510 mergewl x, t1, t2
511 x4 addb argb, x, 128
512
513
514
515 .function video_convert_orc_convert_AYUV_BGRA
516 .flags 2d
517 .dest 4 argb guint8
518 .source 4 ayuv guint8
519 .temp 2 t1
520 .temp 2 t2
521 .temp 1 a
522 .temp 1 y
523 .temp 1 u
524 .temp 1 v
525 .temp 2 wy
526 .temp 2 wu
527 .temp 2 wv
528 .temp 2 wr
529 .temp 2 wg
530 .temp 2 wb
531 .temp 1 r
532 .temp 1 g
533 .temp 1 b
534 .temp 4 x
535 .const 1 c8 8
536
537 x4 subb x, ayuv, 128
538 splitlw t1, t2, x
539 splitwb y, a, t2
540 splitwb v, u, t1
541 convsbw wy, y
542 convsbw wu, u
543 convsbw wv, v
544
545 mullw t1, wy, 42
546 shrsw t1, t1, c8
547 addssw wy, wy, t1
548
549 addssw wr, wy, wv
550 mullw t1, wv, 103
551 shrsw t1, t1, c8
552 subssw wr, wr, t1
553 addssw wr, wr, wv
554
555 addssw wb, wy, wu
556 addssw wb, wb, wu
557 mullw t1, wu, 4
558 shrsw t1, t1, c8
559 addssw wb, wb, t1
560
561 mullw t1, wu, 100
562 shrsw t1, t1, c8
563 subssw wg, wy, t1
564 mullw t1, wv, 104
565 shrsw t1, t1, c8
566 subssw wg, wg, t1
567 subssw wg, wg, t1
568
569 convssswb r, wr
570 convssswb g, wg
571 convssswb b, wb
572
573 mergebw t1, b, g
574 mergebw t2, r, a
575 mergewl x, t1, t2
576 x4 addb argb, x, 128
577
578
579
580
581 .function video_convert_orc_convert_AYUV_ABGR
582 .flags 2d
583 .dest 4 argb guint8
584 .source 4 ayuv guint8
585 .temp 2 t1
586 .temp 2 t2
587 .temp 1 a
588 .temp 1 y
589 .temp 1 u
590 .temp 1 v
591 .temp 2 wy
592 .temp 2 wu
593 .temp 2 wv
594 .temp 2 wr
595 .temp 2 wg
596 .temp 2 wb
597 .temp 1 r
598 .temp 1 g
599 .temp 1 b
600 .temp 4 x
601 .const 1 c8 8
602
603 x4 subb x, ayuv, 128
604 splitlw t1, t2, x
605 splitwb y, a, t2
606 splitwb v, u, t1
607 convsbw wy, y
608 convsbw wu, u
609 convsbw wv, v
610
611 mullw t1, wy, 42
612 shrsw t1, t1, c8
613 addssw wy, wy, t1
614
615 addssw wr, wy, wv
616 mullw t1, wv, 103
617 shrsw t1, t1, c8
618 subssw wr, wr, t1
619 addssw wr, wr, wv
620
621 addssw wb, wy, wu
622 addssw wb, wb, wu
623 mullw t1, wu, 4
624 shrsw t1, t1, c8
625 addssw wb, wb, t1
626
627 mullw t1, wu, 100
628 shrsw t1, t1, c8
629 subssw wg, wy, t1
630 mullw t1, wv, 104
631 shrsw t1, t1, c8
632 subssw wg, wg, t1
633 subssw wg, wg, t1
634
635 convssswb r, wr
636 convssswb g, wg
637 convssswb b, wb
638
639 mergebw t1, a, b
640 mergebw t2, g, r
641 mergewl x, t1, t2
642 x4 addb argb, x, 128
643
644
645
646 .function video_convert_orc_convert_AYUV_RGBA
647 .flags 2d
648 .dest 4 argb guint8
649 .source 4 ayuv guint8
650 .temp 2 t1
651 .temp 2 t2
652 .temp 1 a
653 .temp 1 y
654 .temp 1 u
655 .temp 1 v
656 .temp 2 wy
657 .temp 2 wu
658 .temp 2 wv
659 .temp 2 wr
660 .temp 2 wg
661 .temp 2 wb
662 .temp 1 r
663 .temp 1 g
664 .temp 1 b
665 .temp 4 x
666 .const 1 c8 8
667
668 x4 subb x, ayuv, 128
669 splitlw t1, t2, x
670 splitwb y, a, t2
671 splitwb v, u, t1
672 convsbw wy, y
673 convsbw wu, u
674 convsbw wv, v
675
676 mullw t1, wy, 42
677 shrsw t1, t1, c8
678 addssw wy, wy, t1
679
680 addssw wr, wy, wv
681 mullw t1, wv, 103
682 shrsw t1, t1, c8
683 subssw wr, wr, t1
684 addssw wr, wr, wv
685
686 addssw wb, wy, wu
687 addssw wb, wb, wu
688 mullw t1, wu, 4
689 shrsw t1, t1, c8
690 addssw wb, wb, t1
691
692 mullw t1, wu, 100
693 shrsw t1, t1, c8
694 subssw wg, wy, t1
695 mullw t1, wv, 104
696 shrsw t1, t1, c8
697 subssw wg, wg, t1
698 subssw wg, wg, t1
699
700 convssswb r, wr
701 convssswb g, wg
702 convssswb b, wb
703
704 mergebw t1, r, g
705 mergebw t2, b, a
706 mergewl x, t1, t2
707 x4 addb argb, x, 128
708
709
710
711 .function video_convert_orc_convert_I420_BGRA
712 .dest 4 argb guint8
713 .source 1 y guint8
714 .source 1 u guint8
715 .source 1 v guint8
716 .temp 2 t1
717 .temp 2 t2
718 .temp 1 t3
719 .temp 2 wy
720 .temp 2 wu
721 .temp 2 wv
722 .temp 2 wr
723 .temp 2 wg
724 .temp 2 wb
725 .temp 1 r
726 .temp 1 g
727 .temp 1 b
728 .temp 4 x
729 .const 1 c8 8
730 .const 1 c128 128
731
732 subb t3, y, c128
733 convsbw wy, t3
734 loadupib t3, u
735 subb t3, t3, c128
736 convsbw wu, t3
737 loadupib t3, v
738 subb t3, t3, c128
739 convsbw wv, t3
740
741 mullw t1, wy, 42
742 shrsw t1, t1, c8
743 addssw wy, wy, t1
744
745 addssw wr, wy, wv
746 mullw t1, wv, 103
747 shrsw t1, t1, c8
748 subssw wr, wr, t1
749 addssw wr, wr, wv
750
751 addssw wb, wy, wu
752 addssw wb, wb, wu
753 mullw t1, wu, 4
754 shrsw t1, t1, c8
755 addssw wb, wb, t1
756
757 mullw t1, wu, 100
758 shrsw t1, t1, c8
759 subssw wg, wy, t1
760 mullw t1, wv, 104
761 shrsw t1, t1, c8
762 subssw wg, wg, t1
763 subssw wg, wg, t1
764
765 convssswb r, wr
766 convssswb g, wg
767 convssswb b, wb
768
769 mergebw t1, b, g
770 mergebw t2, r, 255
771 mergewl x, t1, t2
772 x4 addb argb, x, c128
773
774
775
776 .function video_convert_orc_convert_I420_BGRA_avg
777 .dest 4 argb guint8
778 .source 1 y guint8
779 .source 1 u1 guint8
780 .source 1 u2 guint8
781 .source 1 v1 guint8
782 .source 1 v2 guint8
783 .temp 2 t1
784 .temp 2 t2
785 .temp 1 t3
786 .temp 1 t4
787 .temp 2 wy
788 .temp 2 wu
789 .temp 2 wv
790 .temp 2 wr
791 .temp 2 wg
792 .temp 2 wb
793 .temp 1 r
794 .temp 1 g
795 .temp 1 b
796 .temp 4 x
797 .const 1 c8 8
798 .const 1 c128 128
799
800 subb t3, y, c128
801 convsbw wy, t3
802 loadupib t3, u1
803 loadupib t4, u2
804 avgub t3, t3, t4
805 subb t3, t3, c128
806 convsbw wu, t3
807 loadupib t3, v1
808 loadupib t4, v2
809 avgub t3, t3, t4
810 subb t3, t3, c128
811 convsbw wv, t3
812
813 mullw t1, wy, 42
814 shrsw t1, t1, c8
815 addssw wy, wy, t1
816
817 addssw wr, wy, wv
818 mullw t1, wv, 103
819 shrsw t1, t1, c8
820 subssw wr, wr, t1
821 addssw wr, wr, wv
822
823 addssw wb, wy, wu
824 addssw wb, wb, wu
825 mullw t1, wu, 4
826 shrsw t1, t1, c8
827 addssw wb, wb, t1
828
829 mullw t1, wu, 100
830 shrsw t1, t1, c8
831 subssw wg, wy, t1
832 mullw t1, wv, 104
833 shrsw t1, t1, c8
834 subssw wg, wg, t1
835 subssw wg, wg, t1
836
837 convssswb r, wr
838 convssswb g, wg
839 convssswb b, wb
840
841 mergebw t1, b, g
842 mergebw t2, r, 255
843 mergewl x, t1, t2
844 x4 addb argb, x, c128
845
846
847
848 .function video_convert_orc_getline_I420
849 .dest 4 d guint8
850 .source 1 y guint8
851 .source 1 u guint8
852 .source 1 v guint8
853 .const 1 c255 255
854 .temp 2 uv
855 .temp 2 ay
856 .temp 1 tu
857 .temp 1 tv
858
859 loadupdb tu, u
860 loadupdb tv, v
861 mergebw uv, tu, tv
862 mergebw ay, c255, y
863 mergewl d, ay, uv
864
865 .function video_convert_orc_getline_YUV9
866 .dest 8 d guint8
867 .source 2 y guint8
868 .source 1 u guint8
869 .source 1 v guint8
870 .const 1 c255 255
871 .temp 2 tuv
872 .temp 4 ay
873 .temp 4 uv
874 .temp 1 tu
875 .temp 1 tv
876
877 loadupdb tu, u
878 loadupdb tv, v
879 mergebw tuv, tu, tv
880 mergewl uv, tuv, tuv
881 x2 mergebw ay, c255, y
882 x2 mergewl d, ay, uv
883
884 .function video_convert_orc_getline_YUY2
885 .dest 8 ayuv guint8
886 .source 4 yuy2 guint8
887 .const 2 c255 0xff
888 .temp 2 yy
889 .temp 2 uv
890 .temp 4 ayay
891 .temp 4 uvuv
892
893 x2 splitwb uv, yy, yuy2
894 x2 mergebw ayay, c255, yy
895 mergewl uvuv, uv, uv
896 x2 mergewl ayuv, ayay, uvuv
897
898
899 .function video_convert_orc_getline_UYVY
900 .dest 8 ayuv guint8
901 .source 4 uyvy guint8
902 .const 2 c255 0xff
903 .temp 2 yy
904 .temp 2 uv
905 .temp 4 ayay
906 .temp 4 uvuv
907
908 x2 splitwb yy, uv, uyvy
909 x2 mergebw ayay, c255, yy
910 mergewl uvuv, uv, uv
911 x2 mergewl ayuv, ayay, uvuv
912
913
914 .function video_convert_orc_getline_YVYU
915 .dest 8 ayuv guint8
916 .source 4 uyvy guint8
917 .const 2 c255 0xff
918 .temp 2 yy
919 .temp 2 uv
920 .temp 4 ayay
921 .temp 4 uvuv
922
923 x2 splitwb uv, yy, uyvy
924 swapw uv, uv
925 x2 mergebw ayay, c255, yy
926 mergewl uvuv, uv, uv
927 x2 mergewl ayuv, ayay, uvuv
928
929
930 .function video_convert_orc_getline_Y42B
931 .dest 8 ayuv guint8
932 .source 2 yy guint8
933 .source 1 u guint8
934 .source 1 v guint8
935 .const 1 c255 255
936 .temp 2 uv
937 .temp 2 ay
938 .temp 4 uvuv
939 .temp 4 ayay
940
941 mergebw uv, u, v
942 x2 mergebw ayay, c255, yy
943 mergewl uvuv, uv, uv
944 x2 mergewl ayuv, ayay, uvuv
945
946
947 .function video_convert_orc_getline_Y444
948 .dest 4 ayuv guint8
949 .source 1 y guint8
950 .source 1 u guint8
951 .source 1 v guint8
952 .const 1 c255 255
953 .temp 2 uv
954 .temp 2 ay
955
956 mergebw uv, u, v
957 mergebw ay, c255, y
958 mergewl ayuv, ay, uv
959
960
961 .function video_convert_orc_getline_Y800
962 .dest 4 ayuv guint8
963 .source 1 y guint8
964 .const 1 c255 255
965 .const 2 c0x8080 0x8080
966 .temp 2 ay
967
968 mergebw ay, c255, y
969 mergewl ayuv, ay, c0x8080
970
971 .function video_convert_orc_getline_Y16
972 .dest 4 ayuv guint8
973 .source 2 y guint8
974 .const 1 c255 255
975 .const 2 c0x8080 0x8080
976 .temp 2 ay
977 .temp 1 yb
978
979 convhwb yb, y
980 mergebw ay, c255, yb
981 mergewl ayuv, ay, c0x8080
982
983 .function video_convert_orc_getline_BGRA
984 .dest 4 argb guint8
985 .source 4 bgra guint8
986
987 swapl argb, bgra
988
989
990 .function video_convert_orc_getline_ABGR
991 .dest 4 argb guint8
992 .source 4 abgr guint8
993 .temp 1 a
994 .temp 1 r
995 .temp 1 g
996 .temp 1 b
997 .temp 2 gr
998 .temp 2 ab
999 .temp 2 ar
1000 .temp 2 gb
1001
1002 splitlw gr, ab, abgr
1003 splitwb r, g, gr
1004 splitwb b, a, ab
1005 mergebw ar, a, r
1006 mergebw gb, g, b
1007 mergewl argb, ar, gb
1008
1009
1010 .function video_convert_orc_getline_RGBA
1011 .dest 4 argb guint8
1012 .source 4 rgba guint8
1013 .temp 1 a
1014 .temp 1 r
1015 .temp 1 g
1016 .temp 1 b
1017 .temp 2 rg
1018 .temp 2 ba
1019 .temp 2 ar
1020 .temp 2 gb
1021
1022 splitlw ba, rg, rgba
1023 splitwb g, r, rg
1024 splitwb a, b, ba
1025 mergebw ar, a, r
1026 mergebw gb, g, b
1027 mergewl argb, ar, gb
1028
1029
1030 .function video_convert_orc_getline_NV12
1031 .dest 8 d guint8
1032 .source 2 y guint8
1033 .source 2 uv guint8
1034 .const 1 c255 255
1035 .temp 4 ay
1036 .temp 4 uvuv
1037
1038 mergewl uvuv, uv, uv
1039 x2 mergebw ay, c255, y
1040 x2 mergewl d, ay, uvuv
1041
1042
1043 .function video_convert_orc_getline_NV21
1044 .dest 8 d guint8
1045 .source 2 y guint8
1046 .source 2 vu guint8
1047 .const 1 c255 255
1048 .temp 2 uv
1049 .temp 4 ay
1050 .temp 4 uvuv
1051
1052 swapw uv, vu
1053 mergewl uvuv, uv, uv
1054 x2 mergebw ay, c255, y
1055 x2 mergewl d, ay, uvuv
1056
1057 .function video_convert_orc_getline_A420
1058 .dest 4 d guint8
1059 .source 1 y guint8
1060 .source 1 u guint8
1061 .source 1 v guint8
1062 .source 1 a guint8
1063 .temp 2 uv
1064 .temp 2 ay
1065 .temp 1 tu
1066 .temp 1 tv
1067
1068 loadupdb tu, u
1069 loadupdb tv, v
1070 mergebw uv, tu, tv
1071 mergebw ay, a, y
1072 mergewl d, ay, uv
1073
1074 .function video_convert_orc_putline_I420
1075 .dest 2 y guint8
1076 .dest 1 u guint8
1077 .dest 1 v guint8
1078 .source 8 ayuv guint8
1079 .temp 4 ay
1080 .temp 4 uv
1081 .temp 2 uu
1082 .temp 2 vv
1083 .temp 1 t1
1084 .temp 1 t2
1085
1086 x2 splitlw uv, ay, ayuv
1087 x2 select1wb y, ay
1088 x2 splitwb vv, uu, uv
1089 splitwb t1, t2, uu
1090 avgub u, t1, t2
1091 splitwb t1, t2, vv
1092 avgub v, t1, t2
1093
1094
1095
1096 .function video_convert_orc_putline_YUY2
1097 .dest 4 yuy2 guint8
1098 .source 8 ayuv guint8
1099 .temp 2 yy
1100 .temp 2 uv1
1101 .temp 2 uv2
1102 .temp 4 ayay
1103 .temp 4 uvuv
1104
1105 x2 splitlw uvuv, ayay, ayuv
1106 splitlw uv1, uv2, uvuv
1107 x2 avgub uv1, uv1, uv2
1108 x2 select1wb yy, ayay
1109 x2 mergebw yuy2, yy, uv1
1110
1111
1112 .function video_convert_orc_putline_YVYU
1113 .dest 4 yuy2 guint8
1114 .source 8 ayuv guint8
1115 .temp 2 yy
1116 .temp 2 uv1
1117 .temp 2 uv2
1118 .temp 4 ayay
1119 .temp 4 uvuv
1120
1121 x2 splitlw uvuv, ayay, ayuv
1122 splitlw uv1, uv2, uvuv
1123 x2 avgub uv1, uv1, uv2
1124 x2 select1wb yy, ayay
1125 swapw uv1, uv1
1126 x2 mergebw yuy2, yy, uv1
1127
1128
1129 .function video_convert_orc_putline_UYVY
1130 .dest 4 yuy2 guint8
1131 .source 8 ayuv guint8
1132 .temp 2 yy
1133 .temp 2 uv1
1134 .temp 2 uv2
1135 .temp 4 ayay
1136 .temp 4 uvuv
1137
1138 x2 splitlw uvuv, ayay, ayuv
1139 splitlw uv1, uv2, uvuv
1140 x2 avgub uv1, uv1, uv2
1141 x2 select1wb yy, ayay
1142 x2 mergebw yuy2, uv1, yy
1143
1144
1145
1146 .function video_convert_orc_putline_Y42B
1147 .dest 2 y guint8
1148 .dest 1 u guint8
1149 .dest 1 v guint8
1150 .source 8 ayuv guint8
1151 .temp 4 ayay
1152 .temp 4 uvuv
1153 .temp 2 uv1
1154 .temp 2 uv2
1155
1156 x2 splitlw uvuv, ayay, ayuv
1157 splitlw uv1, uv2, uvuv
1158 x2 avgub uv1, uv1, uv2
1159 splitwb v, u, uv1
1160 x2 select1wb y, ayay
1161
1162
1163 .function video_convert_orc_putline_Y444
1164 .dest 1 y guint8
1165 .dest 1 u guint8
1166 .dest 1 v guint8
1167 .source 4 ayuv guint8
1168 .temp 2 ay
1169 .temp 2 uv
1170
1171 splitlw uv, ay, ayuv
1172 splitwb v, u, uv
1173 select1wb y, ay
1174
1175
1176 .function video_convert_orc_putline_Y800
1177 .dest 1 y guint8
1178 .source 4 ayuv guint8
1179 .temp 2 ay
1180
1181 select0lw ay, ayuv
1182 select1wb y, ay
1183
1184 .function video_convert_orc_putline_Y16
1185 .dest 2 y guint8
1186 .source 4 ayuv guint8
1187 .temp 2 ay
1188 .temp 1 yb
1189
1190 select0lw ay, ayuv
1191 select1wb yb, ay
1192 convubw ay, yb
1193 shlw y, ay, 8
1194
1195 .function video_convert_orc_putline_BGRA
1196 .dest 4 bgra guint8
1197 .source 4 argb guint8
1198
1199 swapl bgra, argb
1200
1201
1202 .function video_convert_orc_putline_ABGR
1203 .dest 4 abgr guint8
1204 .source 4 argb guint8
1205 .temp 1 a
1206 .temp 1 r
1207 .temp 1 g
1208 .temp 1 b
1209 .temp 2 gr
1210 .temp 2 ab
1211 .temp 2 ar
1212 .temp 2 gb
1213
1214 splitlw gb, ar, argb
1215 splitwb b, g, gb
1216 splitwb r, a, ar
1217 mergebw ab, a, b
1218 mergebw gr, g, r
1219 mergewl abgr, ab, gr
1220
1221
1222 .function video_convert_orc_putline_RGBA
1223 .dest 4 rgba guint8
1224 .source 4 argb guint8
1225 .temp 1 a
1226 .temp 1 r
1227 .temp 1 g
1228 .temp 1 b
1229 .temp 2 rg
1230 .temp 2 ba
1231 .temp 2 ar
1232 .temp 2 gb
1233
1234 splitlw gb, ar, argb
1235 splitwb b, g, gb
1236 splitwb r, a, ar
1237 mergebw ba, b, a
1238 mergebw rg, r, g
1239 mergewl rgba, rg, ba
1240
1241
1242 .function video_convert_orc_putline_NV12
1243 .dest 2 y guint8
1244 .dest 2 uv guint8
1245 .source 8 ayuv guint8
1246 .temp 4 ay
1247 .temp 4 uvuv
1248 .temp 2 uv1
1249 .temp 2 uv2
1250
1251 x2 splitlw uvuv, ay, ayuv
1252 x2 select1wb y, ay
1253 splitlw uv1, uv2, uvuv
1254 x2 avgub uv, uv1, uv2
1255
1256
1257 .function video_convert_orc_putline_NV21
1258 .dest 2 y guint8
1259 .dest 2 vu guint8
1260 .source 8 ayuv guint8
1261 .temp 4 ay
1262 .temp 4 uvuv
1263 .temp 2 uv1
1264 .temp 2 uv2
1265 .temp 2 uv
1266
1267 x2 splitlw uvuv, ay, ayuv
1268 x2 select1wb y, ay
1269 splitlw uv1, uv2, uvuv
1270 x2 avgub uv, uv1, uv2
1271 swapw vu, uv
1272
1273 .function video_convert_orc_putline_A420
1274 .dest 2 y guint8
1275 .dest 1 u guint8
1276 .dest 1 v guint8
1277 .dest 2 a guint8
1278 .source 8 ayuv guint8
1279 .temp 4 ay
1280 .temp 4 uv
1281 .temp 2 uu
1282 .temp 2 vv
1283 .temp 1 t1
1284 .temp 1 t2
1285
1286 x2 splitlw uv, ay, ayuv
1287 x2 select1wb y, ay
1288 x2 select0wb a, ay
1289 x2 splitwb vv, uu, uv
1290 splitwb t1, t2, uu
1291 avgub u, t1, t2
1292 splitwb t1, t2, vv
1293 avgub v, t1, t2