]> git.sesse.net Git - vlc/blob - modules/arm_neon/deinterleave_chroma.S
direct3d11: give enough room for the \0 in the string
[vlc] / modules / arm_neon / deinterleave_chroma.S
1  @*****************************************************************************
2  @ deinterleave_chroma.S : ARM NEONv1 conversion of interleaved to planar chroma
3  @*****************************************************************************
4  @ Copyright (C) 2009-2011 Rémi Denis-Courmont
5  @ Copyright (C) 2013 Martin Storsjö
6  @
7  @ This program is free software; you can redistribute it and/or modify
8  @ it under the terms of the GNU Lesser General Public License as published by
9  @ the Free Software Foundation; either version 2.1 of the License, or
10  @ (at your option) any later version.
11  @
12  @ This program is distributed in the hope that it will be useful,
13  @ but WITHOUT ANY WARRANTY; without even the implied warranty of
14  @ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  @ GNU Lesser General Public License for more details.
16  @
17  @ You should have received a copy of the GNU Lesser General Public License
18  @ along with this program; if not, write to the Free Software Foundation,
19  @ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20  @****************************************************************************/
21
22         .syntax unified
23         .fpu neon
24         .text
25
26 #define UV      r0
27 #define COUNT   r1
28 #define WIDTH   r2
29 #define HEIGHT  r3
30 #define IPITCH  r4
31 #define IPAD    r4
32 #define U       r5
33 #define V       r6
34 #define OPITCH  lr
35 #define OPAD    lr
36
37         .align 2
38         .global deinterleave_chroma_neon
39         .type   deinterleave_chroma_neon, %function
40 deinterleave_chroma_neon:
41         push            {r4-r6,lr}
42         ldmia           r0,     {U, V, OPITCH}
43         ldmia           r1,     {UV, IPITCH}
44         cmp             HEIGHT, #0
45
46         @ round the width up to a multiple of 8
47         add             WIDTH,  WIDTH, #7
48         bic             WIDTH,  WIDTH, #7
49
50         sub             IPAD,   IPITCH, WIDTH, lsl #1
51         sub             OPAD,   OPITCH, WIDTH
52 1:
53         movsgt          COUNT,  WIDTH
54         pople           {r4-r6,pc}
55 2:
56         pld             [UV, #64]
57         vld2.u8         {d0, d1},       [UV,:128]!
58         subs            COUNT,  COUNT,  #8
59         vst1.u8         {d0},           [U,:64]!
60         vst1.u8         {d1},           [V,:64]!
61         bgt             2b
62
63         subs            HEIGHT, #1
64         add             UV,     UV,     IPAD
65         add             U,      U,      OPAD
66         add             V,      V,      OPAD
67         b               1b