2 ; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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.
12 EXPORT |vp8_yv12_copy_src_frame_func_neon|
17 INCLUDE vpx_scale_asm_offsets.asm
19 AREA ||.text||, CODE, READONLY, ALIGN=2
20 ;Note: This function is used to copy source data in src_buffer[i] at beginning
21 ;of the encoding. The buffer has a width and height of cpi->oxcf.Width and
22 ;cpi->oxcf.Height, which can be ANY numbers(NOT always multiples of 16 or 4).
24 ;void vp8_yv12_copy_src_frame_func_neon(const YV12_BUFFER_CONFIG *src_ybc,
25 ; YV12_BUFFER_CONFIG *dst_ybc);
27 |vp8_yv12_copy_src_frame_func_neon| PROC
32 ldr r4, [r0, #yv12_buffer_config_y_height]
33 ldr r5, [r0, #yv12_buffer_config_y_width]
34 ldr r6, [r0, #yv12_buffer_config_y_stride]
35 ldr r7, [r1, #yv12_buffer_config_y_stride]
36 ldr r2, [r0, #yv12_buffer_config_y_buffer] ;srcptr1
37 ldr r3, [r1, #yv12_buffer_config_y_buffer] ;dstptr1
39 add r10, r2, r6 ;second row src
40 add r11, r3, r7 ;second row dst
43 sub r6, r6, r5 ;adjust stride
46 ; copy two rows at one time
49 cp_src_to_dst_height_loop
53 vld1.8 {q0, q1}, [r2]!
54 vld1.8 {q4, q5}, [r10]!
55 vld1.8 {q2, q3}, [r2]!
56 vld1.8 {q6, q7}, [r10]!
57 vld1.8 {q8, q9}, [r2]!
58 vld1.8 {q12, q13}, [r10]!
59 vld1.8 {q10, q11}, [r2]!
60 vld1.8 {q14, q15}, [r10]!
63 vst1.8 {q0, q1}, [r3]!
64 vst1.8 {q4, q5}, [r11]!
65 vst1.8 {q2, q3}, [r3]!
66 vst1.8 {q6, q7}, [r11]!
67 vst1.8 {q8, q9}, [r3]!
68 vst1.8 {q12, q13}, [r11]!
69 vst1.8 {q10, q11}, [r3]!
70 vst1.8 {q14, q15}, [r11]!
102 bne cp_src_to_dst_height_loop
104 ;copy last line for Y if y_height is odd
110 vld1.8 {q0, q1}, [r2]!
111 vld1.8 {q2, q3}, [r2]!
112 vld1.8 {q8, q9}, [r2]!
113 vld1.8 {q10, q11}, [r2]!
116 vst1.8 {q0, q1}, [r3]!
117 vst1.8 {q2, q3}, [r3]!
118 vst1.8 {q8, q9}, [r3]!
119 vst1.8 {q10, q11}, [r3]!
120 bhs cp_width_128_loop_1
130 bhs cp_width_8_loop_1
139 bne cp_width_1_loop_1
143 ldr r4, [r0, #yv12_buffer_config_uv_height]
144 ldr r5, [r0, #yv12_buffer_config_uv_width]
145 ldr r6, [r0, #yv12_buffer_config_uv_stride]
146 ldr r7, [r1, #yv12_buffer_config_uv_stride]
147 ldr r2, [r0, #yv12_buffer_config_u_buffer] ;srcptr1
148 ldr r3, [r1, #yv12_buffer_config_u_buffer] ;dstptr1
150 add r10, r2, r6 ;second row src
151 add r11, r3, r7 ;second row dst
154 sub r6, r6, r5 ;adjust stride
160 ;copy two rows at one time
163 cp_src_to_dst_height_uv_loop
167 vld1.8 {q0, q1}, [r2]!
168 vld1.8 {q4, q5}, [r10]!
169 vld1.8 {q2, q3}, [r2]!
170 vld1.8 {q6, q7}, [r10]!
173 vst1.8 {q0, q1}, [r3]!
174 vst1.8 {q4, q5}, [r11]!
175 vst1.8 {q2, q3}, [r3]!
176 vst1.8 {q6, q7}, [r11]!
177 bhs cp_width_uv_64_loop
189 bhs cp_width_uv_8_loop
200 bne cp_width_uv_1_loop
208 bne cp_src_to_dst_height_uv_loop
210 ;copy last line for U & V if uv_height is odd
212 beq cp_width_uv_done_1
215 cp_width_uv_64_loop_1
216 vld1.8 {q0, q1}, [r2]!
217 vld1.8 {q2, q3}, [r2]!
220 vst1.8 {q0, q1}, [r3]!
221 vst1.8 {q2, q3}, [r3]!
222 bhs cp_width_uv_64_loop_1
225 beq cp_width_uv_done_1
232 bhs cp_width_uv_8_loop_1
235 beq cp_width_uv_done_1
241 bne cp_width_uv_1_loop_1
245 ldrne r2, [r0, #yv12_buffer_config_v_buffer] ;srcptr1
246 ldrne r3, [r1, #yv12_buffer_config_v_buffer] ;dstptr1
247 ldrne r10, [r0, #yv12_buffer_config_uv_stride]
248 ldrne r11, [r1, #yv12_buffer_config_uv_stride]
250 addne r10, r2, r10 ;second row src
251 addne r11, r3, r11 ;second row dst