qt: playlist: use item title if available
[vlc.git] / modules / arm_neon / i420_yuyv.S
blob22355e0b6140270052b797e37f78e113b658ca1f
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  @****************************************************************************/
21 #include "asm.S"
23         .syntax unified
24 #if HAVE_AS_FPU_DIRECTIVE
25         .fpu    neon
26 #endif
27         .text
29 #define O1      r0
30 #define O2      r1
31 #define WIDTH   r2
32 #define HEIGHT  r3
33 #define Y1      r4
34 #define Y2      r5
35 #define U       r6
36 #define V       r7
37 #define YPITCH  r8
38 #define OPAD    r10
39 #define YPAD    r11
40 #define COUNT   ip
41 #define OPITCH  lr
43         .align 2
44 function i420_yuyv_neon
45         push            {r4-r8,r10-r11,lr}
46         ldmia           r0,     {O1, OPITCH}
47         ldmia           r1,     {Y1, U, V, YPITCH}
48         cmp             HEIGHT, #0
49         sub             OPAD,   OPITCH, WIDTH,  lsl #1
50         sub             YPAD,   YPITCH, WIDTH
52         it              gt
53         movsgt          COUNT,  WIDTH
54         add             O2,     O1,     OPITCH
55         add             Y2,     Y1,     YPITCH
56         it              le
57         pople           {r4-r8,r10-r11,pc}
59         pld             [U, #64]
60         vld1.u8         {d2},           [U,:64]!
61         pld             [V, #64]
62         vld1.u8         {d3},           [V,:64]!
63         pld             [Y1, #64]
64         vzip.u8         d2,     d3
65         subs            COUNT,  COUNT,  #16
66         vld1.u8         {q0},           [Y1,:128]!
67         pld             [Y2, #64]
68         vmov            q3,     q1
69         vzip.u8         q0,     q1
70         vld1.u8         {q2},           [Y2,:128]!
71         vzip.u8         q2,     q3
72         vst1.u8         {q0-q1},        [O1,:128]!
73         vst1.u8         {q2-q3},        [O2,:128]!
74         bgt             2b
76         subs            HEIGHT, #2
77         add             O1,     O2,     OPAD
78         add             Y1,     Y2,     YPAD
79         add             U,      U,      YPAD,   lsr #1
80         add             V,      V,      YPAD,   lsr #1
81         b               1b
83 function i420_uyvy_neon
84         push            {r4-r8,r10-r11,lr}
85         ldmia           r0,     {O1, OPITCH}
86         ldmia           r1,     {Y1, U, V, YPITCH}
87         cmp             HEIGHT, #0
88         sub             OPAD,   OPITCH, WIDTH,  lsl #1
89         sub             YPAD,   YPITCH, WIDTH
91         it              gt
92         movsgt          COUNT,  WIDTH
93         add             O2,     O1,     OPITCH
94         add             Y2,     Y1,     YPITCH
95         it              le
96         pople           {r4-r8,r10-r11,pc}
98         pld             [U, #64]
99         vld1.u8         {d0},           [U,:64]!
100         pld             [V, #64]
101         vld1.u8         {d1},           [V,:64]!
102         pld             [Y1, #64]
103         vzip.u8         d0,     d1
104         subs            COUNT,  COUNT,  #16
105         vld1.u8         {q1},           [Y1,:128]!
106         pld             [Y2, #64]
107         vmov            q2,     q0
108         vzip.u8         q0,     q1
109         vld1.u8         {q3},           [Y2,:128]!
110         vzip.u8         q2,     q3
111         vst1.u8         {q0-q1},        [O1,:128]!
112         vst1.u8         {q2-q3},        [O2,:128]!
113         bgt             2b
115         subs            HEIGHT, #2
116         add             O1,     O2,     OPAD
117         add             Y1,     Y2,     YPAD
118         add             U,      U,      YPAD,   lsr #1
119         add             V,      V,      YPAD,   lsr #1
120         b               1b