]> git.sesse.net Git - vlc/blob - modules/arm_neon/i420_yuyv.S
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / arm_neon / i420_yuyv.S
1  @*****************************************************************************
2  @ i420_yuyv_neon.S : ARM NEONv1 I420 to YUYV chroma conversion
3  @*****************************************************************************
4  @ Copyright (C) 2009 RĂ©mi Denis-Courmont
5  @
6  @ This program is free software; you can redistribute it and/or modify
7  @ it under the terms of the GNU General Public License as published by
8  @ the Free Software Foundation; either version 2 of the License, or
9  @ (at your option) any later version.
10  @
11  @ This program is distributed in the hope that it will be useful,
12  @ but WITHOUT ANY WARRANTY; without even the implied warranty of
13  @ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  @ GNU General Public License for more details.
15  @
16  @ You should have received a copy of the GNU General Public License
17  @ along with this program; if not, write to the Free Software Foundation,
18  @ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19  @****************************************************************************/
20
21         .fpu neon
22         .text
23
24 #define O1      r0
25 #define O2      r1
26 #define PITCH   r2
27 #define S_OFF   r3
28 #define Y1      r4
29 #define Y2      r5
30 #define U       r6
31 #define V       r7
32 #define HEIGHT  r8
33 #define END_O1  r12
34
35         .align
36         .global i420_yuyv_neon
37         .type   i420_yuyv_neon, %function
38 i420_yuyv_neon:
39         push            {r4-r8, lr}
40         ldr             HEIGHT, [sp, #(4*6)]
41         ldmia           r1,     {Y1, U, V}
42         add             O2,     O1,     PITCH, lsl #1
43         add             Y2,     Y1,     PITCH
44         add             Y2,     S_OFF
45 1:
46         mov             END_O1, O2
47         pld             [Y2]
48 2:
49         pld             [U, #64]
50         vld1.u8         {d2},           [U,:64]!
51         pld             [V, #64]
52         vld1.u8         {d3},           [V,:64]!
53         pld             [Y1, #64]
54         vzip.u8         d2,     d3
55         vld1.u8         {q0},           [Y1,:128]!
56         pld             [Y2, #64]
57         vmov            q3,     q1
58         vzip.u8         q0,     q1
59         vld1.u8         {q2},           [Y2,:128]!
60         vzip.u8         q2,     q3
61         vst1.u8         {q0-q1},        [O1,:128]!
62         vst1.u8         {q2-q3},        [O2,:128]!
63
64         cmp             O1,     END_O1
65         bne             2b
66
67         sub             HEIGHT, #2
68         mov             O1,     O2
69         add             O2,     PITCH,  lsl #1
70         add             Y2,     S_OFF
71         mov             Y1,     Y2
72         add             Y2,     PITCH
73         add             Y2,     S_OFF
74         add             U,      S_OFF,  lsr #1
75         add             V,      S_OFF,  lsr #1
76
77         cmp             HEIGHT, #0
78         bne             1b
79
80         pop             {r4-r8, pc}
81
82         .global i420_uyvy_neon
83         .type   i420_uyvy_neon, %function
84 i420_uyvy_neon:
85         push            {r4-r8, lr}
86         ldr             HEIGHT, [sp, #(4*6)]
87         ldmia           r1,     {Y1, U, V}
88         add             O2,     O1,     PITCH, lsl #1
89         add             Y2,     Y1,     PITCH
90         add             Y2,     S_OFF
91 1:
92         mov             END_O1, O2
93 2:
94         pld             [U, #64]
95         vld1.u8         {d0},           [U,:64]!
96         pld             [V, #64]
97         vld1.u8         {d1},           [V,:64]!
98         pld             [Y1, #64]
99         vzip.u8         d0,     d1
100         vld1.u8         {q1},           [Y1,:128]!
101         pld             [Y2, #64]
102         vmov            q2,     q0
103         vzip.u8         q0,     q1
104         vld1.u8         {q3},           [Y2,:128]!
105         vzip.u8         q2,     q3
106         vst1.u8         {q0-q1},        [O1,:128]!
107         vst1.u8         {q2-q3},        [O2,:128]!
108
109         cmp             O1,     END_O1
110         bne             2b
111
112         sub             HEIGHT, #2
113         mov             O1,     O2
114         add             O2,     PITCH,  lsl #1
115         add             Y2,     S_OFF
116         mov             Y1,     Y2
117         add             Y2,     PITCH
118         add             Y2,     S_OFF
119         add             U,      S_OFF,  lsr #1
120         add             V,      S_OFF,  lsr #1
121
122         cmp             HEIGHT, #0
123         bne             1b
124
125         pop             {r4-r8, pc}