qml: Create MediaGroupDisplay
[vlc.git] / modules / arm_neon / i422_yuyv.S
blob9a5b8fc4b8c4d13c67a3619594ab7aeec061cbe2
1  @*****************************************************************************
2  @ i422_yuyv.S : ARM NEONv1 I422 to YUYV chroma conversion
3  @*****************************************************************************
4  @ Copyright (C) 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 O       r0
30 #define OPAD    r1
31 #define WIDTH   r2
32 #define HEIGHT  r3
33 #define Y       r4
34 #define U       r5
35 #define V       r6
36 #define COUNT   ip
37 #define YPAD    lr
39         .align 2
40 function i422_yuyv_neon
41         push            {r4-r6,lr}
42         ldmia           r1,     {Y, U, V, YPAD}
43         ldmia           r0,     {O, OPAD}
44         cmp             HEIGHT, #0
45         sub             OPAD,   OPAD,   WIDTH,  lsl #1
46         sub             YPAD,   YPAD,   WIDTH
48         ite             gt
49         movsgt          COUNT,  WIDTH
50         pople           {r4-r6,pc}
52         pld             [U, #64]
53         vld1.u8         {d2},           [U,:64]!
54         pld             [V, #64]
55         vld1.u8         {d3},           [V,:64]!
56         pld             [Y, #64]
57         vzip.u8         d2,     d3
58         subs            COUNT,  COUNT,  #16
59         vld1.u8         {q0},           [Y,:128]!
60         vzip.u8         q0,     q1
61         @ TODO: unroll (1 cycle stall)
62         vst1.u8         {q0-q1},        [O,:128]!
63         bgt             2b
65         subs            HEIGHT, #1
66         add             U,      U,      YPAD,   lsr #1
67         add             V,      V,      YPAD,   lsr #1
68         add             Y,      Y,      YPAD
69         add             O,      O,      OPAD
70         b               1b
72 function i422_uyvy_neon
73         push            {r4-r6,lr}
74         ldmia           r1,     {Y, U, V, YPAD}
75         ldmia           r0,     {O, OPAD}
76         cmp             HEIGHT, #0
77         sub             OPAD,   OPAD,   WIDTH,  lsl #1
78         sub             YPAD,   YPAD,   WIDTH
80         ite             gt
81         movsgt          COUNT,  WIDTH
82         pople           {r4-r6,pc}
84         pld             [U, #64]
85         vld1.u8         {d0},           [U,:64]!
86         pld             [V, #64]
87         vld1.u8         {d1},           [V,:64]!
88         pld             [Y, #64]
89         vzip.u8         d0,     d1
90         subs            COUNT,  COUNT,  #16
91         vld1.u8         {q1},           [Y,:128]!
92         vzip.u8         q0,     q1
93         vst1.u8         {q0-q1},        [O,:128]!
94         bgt             2b
96         subs            HEIGHT, #1
97         add             U,      U,      YPAD,   lsr #1
98         add             V,      V,      YPAD,   lsr #1
99         add             Y,      Y,      YPAD
100         add             O,      O,      OPAD
101         b               1b