]> git.sesse.net Git - vlc/blob - modules/arm_neon/i420_yuyv.S
enable the macosx GUI to handle negative stop-time
[vlc] / modules / arm_neon / i420_yuyv.S
1  @*****************************************************************************
2  @ i420_yuyv.S : ARM NEONv1 I420 to YUYV chroma conversion
3  @*****************************************************************************
4  @ Copyright (C) 2009-2011 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 Lesser General Public License as published by
8  @ the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
15  @
16  @ You should have received a copy of the GNU Lesser 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         .syntax unified
22         .fpu neon
23         .text
24
25 #define O1      r0
26 #define O2      r1
27 #define WIDTH   r2
28 #define HEIGHT  r3
29 #define Y1      r4
30 #define Y2      r5
31 #define U       r6
32 #define V       r7
33 #define YPITCH  r8
34 #define OPAD    r10
35 #define YPAD    r11
36 #define COUNT   ip
37 #define OPITCH  lr
38
39         .align 2
40         .global i420_yuyv_neon
41         .type   i420_yuyv_neon, %function
42 i420_yuyv_neon:
43         push            {r4-r8,r10-r11,lr}
44         ldmia           r0,     {O1, OPITCH}
45         ldmia           r1,     {Y1, U, V, YPITCH}
46         cmp             HEIGHT, #0
47         sub             OPAD,   OPITCH, WIDTH,  lsl #1
48         sub             YPAD,   YPITCH, WIDTH
49 1:
50         movsgt          COUNT,  WIDTH
51         add             O2,     O1,     OPITCH
52         add             Y2,     Y1,     YPITCH
53         pople           {r4-r8,r10-r11,pc}
54 2:
55         pld             [U, #64]
56         vld1.u8         {d2},           [U,:64]!
57         pld             [V, #64]
58         vld1.u8         {d3},           [V,:64]!
59         pld             [Y1, #64]
60         vzip.u8         d2,     d3
61         subs            COUNT,  COUNT,  #16
62         vld1.u8         {q0},           [Y1,:128]!
63         pld             [Y2, #64]
64         vmov            q3,     q1
65         vzip.u8         q0,     q1
66         vld1.u8         {q2},           [Y2,:128]!
67         vzip.u8         q2,     q3
68         vst1.u8         {q0-q1},        [O1,:128]!
69         vst1.u8         {q2-q3},        [O2,:128]!
70         bgt             2b
71
72         subs            HEIGHT, #2
73         add             O1,     O2,     OPAD
74         add             Y1,     Y2,     YPAD
75         add             U,      U,      YPAD,   lsr #1
76         add             V,      V,      YPAD,   lsr #1
77         b               1b
78
79         .global i420_uyvy_neon
80         .type   i420_uyvy_neon, %function
81 i420_uyvy_neon:
82         push            {r4-r8,r10-r11,lr}
83         ldmia           r0,     {O1, OPITCH}
84         ldmia           r1,     {Y1, U, V, YPITCH}
85         cmp             HEIGHT, #0
86         sub             OPAD,   OPITCH, WIDTH,  lsl #1
87         sub             YPAD,   YPITCH, WIDTH
88 1:
89         movsgt          COUNT,  WIDTH
90         add             O2,     O1,     OPITCH
91         add             Y2,     Y1,     YPITCH
92         pople           {r4-r8,r10-r11,pc}
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         subs            COUNT,  COUNT,  #16
101         vld1.u8         {q1},           [Y1,:128]!
102         pld             [Y2, #64]
103         vmov            q2,     q0
104         vzip.u8         q0,     q1
105         vld1.u8         {q3},           [Y2,:128]!
106         vzip.u8         q2,     q3
107         vst1.u8         {q0-q1},        [O1,:128]!
108         vst1.u8         {q2-q3},        [O2,:128]!
109         bgt             2b
110
111         subs            HEIGHT, #2
112         add             O1,     O2,     OPAD
113         add             Y1,     Y2,     YPAD
114         add             U,      U,      YPAD,   lsr #1
115         add             V,      V,      YPAD,   lsr #1
116         b               1b