Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / third_party / libvpx / source / libvpx / vpx_scale / arm / neon / vp8_vpxyv12_copy_y_neon.asm
1 ;
2 ;  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 ;
4 ;  Use of this source code is governed by a BSD-style license
5 ;  that can be found in the LICENSE file in the root of the source
6 ;  tree. An additional intellectual property rights grant can be found
7 ;  in the file PATENTS.  All contributing project authors may
8 ;  be found in the AUTHORS file in the root of the source tree.
9 ;
10
11
12     EXPORT  |vpx_yv12_copy_y_neon|
13
14     ARM
15     REQUIRE8
16     PRESERVE8
17
18     INCLUDE vpx_scale_asm_offsets.asm
19
20     AREA ||.text||, CODE, READONLY, ALIGN=2
21
22 ;void vpx_yv12_copy_y_neon(const YV12_BUFFER_CONFIG *src_ybc,
23 ;                          YV12_BUFFER_CONFIG *dst_ybc)
24 |vpx_yv12_copy_y_neon| PROC
25     push            {r4 - r11, lr}
26     vpush           {d8-d15}
27
28     ldr             r4, [r0, #yv12_buffer_config_y_height]
29     ldr             r5, [r0, #yv12_buffer_config_y_width]
30     ldr             r6, [r0, #yv12_buffer_config_y_stride]
31     ldr             r7, [r1, #yv12_buffer_config_y_stride]
32     ldr             r2, [r0, #yv12_buffer_config_y_buffer]       ;srcptr1
33     ldr             r3, [r1, #yv12_buffer_config_y_buffer]       ;dstptr1
34
35     ; copy two rows at one time
36     mov             lr, r4, lsr #1
37
38 cp_src_to_dst_height_loop1
39     mov             r8, r2
40     mov             r9, r3
41     add             r10, r2, r6
42     add             r11, r3, r7
43     movs            r12, r5, lsr #7
44     ble             extra_copy_needed   ; y_width < 128
45
46 cp_src_to_dst_width_loop1
47     vld1.8          {q0, q1}, [r8]!
48     vld1.8          {q8, q9}, [r10]!
49     vld1.8          {q2, q3}, [r8]!
50     vld1.8          {q10, q11}, [r10]!
51     vld1.8          {q4, q5}, [r8]!
52     vld1.8          {q12, q13}, [r10]!
53     vld1.8          {q6, q7}, [r8]!
54     vld1.8          {q14, q15}, [r10]!
55
56     subs            r12, r12, #1
57
58     vst1.8          {q0, q1}, [r9]!
59     vst1.8          {q8, q9}, [r11]!
60     vst1.8          {q2, q3}, [r9]!
61     vst1.8          {q10, q11}, [r11]!
62     vst1.8          {q4, q5}, [r9]!
63     vst1.8          {q12, q13}, [r11]!
64     vst1.8          {q6, q7}, [r9]!
65     vst1.8          {q14, q15}, [r11]!
66
67     bne             cp_src_to_dst_width_loop1
68
69     subs            lr, lr, #1
70     add             r2, r2, r6, lsl #1
71     add             r3, r3, r7, lsl #1
72
73     bne             cp_src_to_dst_height_loop1
74
75 extra_copy_needed
76     ands            r10, r5, #0x7f                  ;check to see if extra copy is needed
77     sub             r11, r5, r10
78     ldr             r2, [r0, #yv12_buffer_config_y_buffer]       ;srcptr1
79     ldr             r3, [r1, #yv12_buffer_config_y_buffer]       ;dstptr1
80     bne             extra_cp_src_to_dst_width1
81 end_of_cp_src_to_dst1
82
83     vpop            {d8 - d15}
84     pop             {r4-r11, pc}
85
86 ;=============================
87 extra_cp_src_to_dst_width1
88     add             r2, r2, r11
89     add             r3, r3, r11
90     add             r0, r8, r6
91     add             r11, r9, r7
92
93     mov             lr, r4, lsr #1
94 extra_cp_src_to_dst_height_loop1
95     mov             r8, r2
96     mov             r9, r3
97     add             r0, r8, r6
98     add             r11, r9, r7
99
100     mov             r12, r10
101
102 extra_cp_src_to_dst_width_loop1
103     vld1.8          {q0}, [r8]!
104     vld1.8          {q1}, [r0]!
105
106     subs            r12, r12, #16
107
108     vst1.8          {q0}, [r9]!
109     vst1.8          {q1}, [r11]!
110     bne             extra_cp_src_to_dst_width_loop1
111
112     subs            lr, lr, #1
113
114     add             r2, r2, r6, lsl #1
115     add             r3, r3, r7, lsl #1
116
117     bne             extra_cp_src_to_dst_height_loop1
118
119     b               end_of_cp_src_to_dst1
120
121     ENDP
122
123     END