tizen 2.3 release
[framework/multimedia/gst-plugins-base0.10.git] / gst-libs / gst / video / videoblendorc.orc
1 .function orc_blend_little
2 .flags 1d
3 .dest 4 d guint8
4 .source 4 s guint8
5 .temp 4 t
6 .temp 2 tw
7 .temp 1 tb
8 .temp 4 a
9 .temp 8 d_wide
10 .temp 8 s_wide
11 .temp 8 a_wide
12 .const 4 a_alpha 0x000000ff
13
14 loadl t, s
15 convlw tw, t
16 convwb tb, tw
17 splatbl a, tb
18 x4 convubw a_wide, a
19 x4 shruw a_wide, a_wide, 8
20 x4 convubw s_wide, t
21 loadl t, d
22 x4 convubw d_wide, t
23 x4 subw s_wide, s_wide, d_wide
24 x4 mullw s_wide, s_wide, a_wide
25 x4 div255w s_wide, s_wide
26 x4 addw d_wide, d_wide, s_wide
27 x4 convwb t, d_wide
28 orl t, t, a_alpha
29 storel d, t
30
31 .function orc_blend_big
32 .flags 1d
33 .dest 4 d guint8
34 .source 4 s guint8
35 .temp 4 t
36 .temp 4 t2
37 .temp 2 tw
38 .temp 1 tb
39 .temp 4 a
40 .temp 8 d_wide
41 .temp 8 s_wide
42 .temp 8 a_wide
43 .const 4 a_alpha 0xff000000
44
45 loadl t, s
46 shrul t2, t, 24
47 convlw tw, t2
48 convwb tb, tw
49 splatbl a, tb
50 x4 convubw a_wide, a
51 x4 shruw a_wide, a_wide, 8
52 x4 convubw s_wide, t
53 loadl t, d
54 x4 convubw d_wide, t
55 x4 subw s_wide, s_wide, d_wide
56 x4 mullw s_wide, s_wide, a_wide
57 x4 div255w s_wide, s_wide
58 x4 addw d_wide, d_wide, s_wide
59 x4 convwb t, d_wide
60 orl t, t, a_alpha
61 storel d, t
62
63 .function cogorc_getline_I420
64 .dest 4 d guint8
65 .source 1 y guint8
66 .source 1 u guint8
67 .source 1 v guint8
68 .const 1 c255 255
69 .temp 2 uv
70 .temp 2 ay
71 .temp 1 tu
72 .temp 1 tv
73
74 loadupdb tu, u
75 loadupdb tv, v
76 mergebw uv, tu, tv
77 mergebw ay, c255, y
78 mergewl d, ay, uv
79
80
81 .function cogorc_putline_I420
82 .dest 2 y guint8
83 .dest 1 u guint8
84 .dest 1 v guint8
85 .source 8 ayuv guint8
86 .temp 4 ay
87 .temp 4 uv
88 .temp 2 uu
89 .temp 2 vv
90 .temp 1 t1
91 .temp 1 t2
92
93 x2 splitlw uv, ay, ayuv
94 x2 select1wb y, ay
95 x2 splitwb vv, uu, uv
96 splitwb t1, t2, uu
97 avgub u, t1, t2
98 splitwb t1, t2, vv
99 avgub v, t1, t2
100
101 .function cogorc_getline_YUY2
102 .dest 8 ayuv guint8
103 .source 4 yuy2 guint8
104 .const 2 c255 0xff
105 .temp 2 yy
106 .temp 2 uv
107 .temp 4 ayay
108 .temp 4 uvuv
109
110 x2 splitwb uv, yy, yuy2
111 x2 mergebw ayay, c255, yy
112 mergewl uvuv, uv, uv
113 x2 mergewl ayuv, ayay, uvuv
114
115
116 .function cogorc_putline_YUY2
117 .dest 4 yuy2 guint8
118 .source 8 ayuv guint8
119 .temp 2 yy
120 .temp 2 uv1
121 .temp 2 uv2
122 .temp 4 ayay
123 .temp 4 uvuv
124
125 x2 splitlw uvuv, ayay, ayuv
126 splitlw uv1, uv2, uvuv
127 x2 avgub uv1, uv1, uv2
128 x2 select1wb yy, ayay
129 x2 mergebw yuy2, yy, uv1
130
131
132 .function cogorc_putline_UYVY
133 .dest 4 yuy2 guint8
134 .source 8 ayuv guint8
135 .temp 2 yy
136 .temp 2 uv1
137 .temp 2 uv2
138 .temp 4 ayay
139 .temp 4 uvuv
140
141 x2 splitlw uvuv, ayay, ayuv
142 splitlw uv1, uv2, uvuv
143 x2 avgub uv1, uv1, uv2
144 x2 select1wb yy, ayay
145 x2 mergebw yuy2, uv1, yy
146
147
148 .function cogorc_getline_UYVY
149 .dest 8 ayuv guint8
150 .source 4 uyvy guint8
151 .const 2 c255 0xff
152 .temp 2 yy
153 .temp 2 uv
154 .temp 4 ayay
155 .temp 4 uvuv
156
157 x2 splitwb yy, uv, uyvy
158 x2 mergebw ayay, c255, yy
159 mergewl uvuv, uv, uv
160 x2 mergewl ayuv, ayay, uvuv
161
162
163 .function cogorc_getline_YUV9
164 .dest 8 d guint8
165 .source 2 y guint8
166 .source 1 u guint8
167 .source 1 v guint8
168 .const 1 c255 255
169 .temp 2 tuv
170 .temp 4 ay
171 .temp 4 uv
172 .temp 1 tu
173 .temp 1 tv
174
175 loadupdb tu, u
176 loadupdb tv, v
177 mergebw tuv, tu, tv
178 mergewl uv, tuv, tuv
179 x2 mergebw ay, c255, y
180 x2 mergewl d, ay, uv
181
182
183 .function cogorc_getline_Y42B
184 .dest 8 ayuv guint8
185 .source 2 yy guint8
186 .source 1 u guint8
187 .source 1 v guint8
188 .const 1 c255 255
189 .temp 2 uv
190 .temp 2 ay
191 .temp 4 uvuv
192 .temp 4 ayay
193
194 mergebw uv, u, v
195 x2 mergebw ayay, c255, yy
196 mergewl uvuv, uv, uv
197 x2 mergewl ayuv, ayay, uvuv
198
199 .function cogorc_putline_Y42B
200 .dest 2 y guint8
201 .dest 1 u guint8
202 .dest 1 v guint8
203 .source 8 ayuv guint8
204 .temp 4 ayay
205 .temp 4 uvuv
206 .temp 2 uv1
207 .temp 2 uv2
208
209 x2 splitlw uvuv, ayay, ayuv
210 splitlw uv1, uv2, uvuv
211 x2 avgub uv1, uv1, uv2
212 splitwb v, u, uv1
213 x2 select1wb y, ayay
214
215
216 .function cogorc_getline_Y444
217 .dest 4 ayuv guint8
218 .source 1 y guint8
219 .source 1 u guint8
220 .source 1 v guint8
221 .const 1 c255 255
222 .temp 2 uv
223 .temp 2 ay
224
225 mergebw uv, u, v
226 mergebw ay, c255, y
227 mergewl ayuv, ay, uv
228
229
230 .function cogorc_putline_Y444
231 .dest 1 y guint8
232 .dest 1 u guint8
233 .dest 1 v guint8
234 .source 4 ayuv guint8
235 .temp 2 ay
236 .temp 2 uv
237
238 splitlw uv, ay, ayuv
239 splitwb v, u, uv
240 select1wb y, ay
241
242 .function cogorc_getline_Y800
243 .dest 4 ayuv guint8
244 .source 1 y guint8
245 .const 1 c255 255
246 .const 2 c0x8080 0x8080
247 .temp 2 ay
248
249 mergebw ay, c255, y
250 mergewl ayuv, ay, c0x8080
251
252
253 .function cogorc_putline_Y800
254 .dest 1 y guint8
255 .source 4 ayuv guint8
256 .temp 2 ay
257
258 select0lw ay, ayuv
259 select1wb y, ay
260
261
262 .function cogorc_putline_Y16
263 .dest 2 y guint8
264 .source 4 ayuv guint8
265 .temp 2 ay
266 .temp 1 yb
267
268 select0lw ay, ayuv
269 select1wb yb, ay
270 convubw ay, yb
271 shlw y, ay, 8
272
273
274 .function cogorc_getline_Y16
275 .dest 4 ayuv guint8
276 .source 2 y guint8
277 .const 1 c255 255
278 .const 2 c0x8080 0x8080
279 .temp 2 ay
280 .temp 1 yb
281
282 convhwb yb, y
283 mergebw ay, c255, yb
284 mergewl ayuv, ay, c0x8080
285
286 .function cogorc_getline_BGRA
287 .dest 4 argb guint8
288 .source 4 bgra guint8
289
290 swapl argb, bgra
291
292 .function cogorc_putline_BGRA
293 .dest 4 bgra guint8
294 .source 4 argb guint8
295
296 swapl bgra, argb
297
298 .function cogorc_putline_RGBA
299 .dest 4 rgba guint8
300 .source 4 argb guint8
301 .temp 1 a
302 .temp 1 r
303 .temp 1 g
304 .temp 1 b
305 .temp 2 rg
306 .temp 2 ba
307 .temp 2 ar
308 .temp 2 gb
309
310 splitlw gb, ar, argb
311 splitwb b, g, gb
312 splitwb r, a, ar
313 mergebw ba, b, a
314 mergebw rg, r, g
315 mergewl rgba, rg, ba
316
317 .function cogorc_getline_RGBA
318 .dest 4 argb guint8
319 .source 4 rgba guint8
320 .temp 1 a
321 .temp 1 r
322 .temp 1 g
323 .temp 1 b
324 .temp 2 rg
325 .temp 2 ba
326 .temp 2 ar
327 .temp 2 gb
328
329 splitlw ba, rg, rgba
330 splitwb g, r, rg
331 splitwb a, b, ba
332 mergebw ar, a, r
333 mergebw gb, g, b
334 mergewl argb, ar, gb
335
336
337 .function cogorc_getline_ABGR
338 .dest 4 argb guint8
339 .source 4 abgr guint8
340 .temp 1 a
341 .temp 1 r
342 .temp 1 g
343 .temp 1 b
344 .temp 2 gr
345 .temp 2 ab
346 .temp 2 ar
347 .temp 2 gb
348
349 splitlw gr, ab, abgr
350 splitwb r, g, gr
351 splitwb b, a, ab
352 mergebw ar, a, r
353 mergebw gb, g, b
354 mergewl argb, ar, gb
355
356
357 .function cogorc_putline_ABGR
358 .dest 4 abgr guint8
359 .source 4 argb guint8
360 .temp 1 a
361 .temp 1 r
362 .temp 1 g
363 .temp 1 b
364 .temp 2 gr
365 .temp 2 ab
366 .temp 2 ar
367 .temp 2 gb
368
369 splitlw gb, ar, argb
370 splitwb b, g, gb
371 splitwb r, a, ar
372 mergebw ab, a, b
373 mergebw gr, g, r
374 mergewl abgr, ab, gr
375
376 .function cogorc_getline_NV12
377 .dest 8 d guint8
378 .source 2 y guint8
379 .source 2 uv guint8
380 .const 1 c255 255
381 .temp 4 ay
382 .temp 4 uvuv
383
384 mergewl uvuv, uv, uv
385 x2 mergebw ay, c255, y
386 x2 mergewl d, ay, uvuv
387
388 .function cogorc_putline_NV12
389 .dest 2 y guint8
390 .dest 2 uv guint8
391 .source 8 ayuv guint8
392 .temp 4 ay
393 .temp 4 uvuv
394 .temp 2 uv1
395 .temp 2 uv2
396
397 x2 splitlw uvuv, ay, ayuv
398 x2 select1wb y, ay
399 splitlw uv1, uv2, uvuv
400 x2 avgub uv, uv1, uv2
401
402 .function cogorc_getline_NV21
403 .dest 8 d guint8
404 .source 2 y guint8
405 .source 2 vu guint8
406 .const 1 c255 255
407 .temp 2 uv
408 .temp 4 ay
409 .temp 4 uvuv
410
411 swapw uv, vu
412 mergewl uvuv, uv, uv
413 x2 mergebw ay, c255, y
414 x2 mergewl d, ay, uvuv
415
416
417 .function cogorc_putline_NV21
418 .dest 2 y guint8
419 .dest 2 vu guint8
420 .source 8 ayuv guint8
421 .temp 4 ay
422 .temp 4 uvuv
423 .temp 2 uv1
424 .temp 2 uv2
425 .temp 2 uv
426
427 x2 splitlw uvuv, ay, ayuv
428 x2 select1wb y, ay
429 splitlw uv1, uv2, uvuv
430 x2 avgub uv, uv1, uv2
431 swapw vu, uv
432
433
434 .function cogorc_getline_A420
435 .dest 4 d guint8
436 .source 1 y guint8
437 .source 1 u guint8
438 .source 1 v guint8
439 .source 1 a guint8
440 .temp 2 uv
441 .temp 2 ay
442 .temp 1 tu
443 .temp 1 tv
444
445 loadupdb tu, u
446 loadupdb tv, v
447 mergebw uv, tu, tv
448 mergebw ay, a, y
449 mergewl d, ay, uv
450
451 .function cogorc_putline_A420
452 .dest 2 y guint8
453 .dest 1 u guint8
454 .dest 1 v guint8
455 .dest 2 a guint8
456 .source 8 ayuv guint8
457 .temp 4 ay
458 .temp 4 uv
459 .temp 2 uu
460 .temp 2 vv
461 .temp 1 t1
462 .temp 1 t2
463
464 x2 splitlw uv, ay, ayuv
465 x2 select1wb y, ay
466 x2 select0wb a, ay
467 x2 splitwb vv, uu, uv
468 splitwb t1, t2, uu
469 avgub u, t1, t2
470 splitwb t1, t2, vv
471 avgub v, t1, t2
472
473 .function orc_resample_bilinear_u32
474 .dest 4 d1 guint8
475 .source 4 s1 guint8
476 .param 4 p1
477 .param 4 p2
478
479 ldreslinl d1, s1, p1, p2
480
481 .function orc_merge_linear_u8
482 .dest 1 d1
483 .source 1 s1
484 .source 1 s2
485 .param 1 p1
486 .temp 2 t1
487 .temp 2 t2
488 .temp 1 a
489 .temp 1 t
490
491 loadb a, s1
492 convubw t1, s1
493 convubw t2, s2
494 subw t2, t2, t1
495 mullw t2, t2, p1
496 addw t2, t2, 128
497 convhwb t, t2
498 addb d1, t, a