| OLD | NEW |
| 1 ; | 1 ; |
| 2 ; Copyright (c) 2011 The WebM project authors. All Rights Reserved. | 2 ; Copyright (c) 2011 The WebM project authors. All Rights Reserved. |
| 3 ; | 3 ; |
| 4 ; Use of this source code is governed by a BSD-style license | 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 | 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 | 6 ; tree. An additional intellectual property rights grant can be found |
| 7 ; in the file PATENTS. All contributing project authors may | 7 ; in the file PATENTS. All contributing project authors may |
| 8 ; be found in the AUTHORS file in the root of the source tree. | 8 ; be found in the AUTHORS file in the root of the source tree. |
| 9 ; | 9 ; |
| 10 | 10 |
| 11 | 11 |
| 12 EXPORT |vp8_variance16x16_armv6| | 12 EXPORT |vp8_variance16x16_armv6| |
| 13 | 13 |
| 14 ARM | 14 ARM |
| 15 REQUIRE8 | 15 REQUIRE8 |
| 16 PRESERVE8 | 16 PRESERVE8 |
| 17 | 17 |
| 18 AREA ||.text||, CODE, READONLY, ALIGN=2 | 18 AREA ||.text||, CODE, READONLY, ALIGN=2 |
| 19 | 19 |
| 20 ; r0 unsigned char *src_ptr | 20 ; r0 unsigned char *src_ptr |
| 21 ; r1 int source_stride | 21 ; r1 int source_stride |
| 22 ; r2 unsigned char *ref_ptr | 22 ; r2 unsigned char *ref_ptr |
| 23 ; r3 int recon_stride | 23 ; r3 int recon_stride |
| 24 ; stack unsigned int *sse | 24 ; stack unsigned int *sse |
| 25 |vp8_variance16x16_armv6| PROC | 25 |vp8_variance16x16_armv6| PROC |
| 26 | 26 |
| 27 stmfd sp!, {r4-r12, lr} | 27 stmfd sp!, {r4-r12, lr} |
| 28 |
| 29 pld [r0, r1, lsl #0] |
| 30 pld [r2, r3, lsl #0] |
| 31 |
| 28 mov r8, #0 ; initialize sum = 0 | 32 mov r8, #0 ; initialize sum = 0 |
| 29 mov r11, #0 ; initialize sse = 0 | 33 mov r11, #0 ; initialize sse = 0 |
| 30 mov r12, #16 ; set loop counter to 16 (=block height) | 34 mov r12, #16 ; set loop counter to 16 (=block height) |
| 31 | 35 |
| 32 loop | 36 loop |
| 33 ; 1st 4 pixels | 37 ; 1st 4 pixels |
| 34 ldr r4, [r0, #0] ; load 4 src pixels | 38 ldr r4, [r0, #0] ; load 4 src pixels |
| 35 ldr r5, [r2, #0] ; load 4 ref pixels | 39 ldr r5, [r2, #0] ; load 4 ref pixels |
| 36 | 40 |
| 37 mov lr, #0 ; constant zero | 41 mov lr, #0 ; constant zero |
| 38 | 42 |
| 39 usub8 r6, r4, r5 ; calculate difference | 43 usub8 r6, r4, r5 ; calculate difference |
| 44 pld [r0, r1, lsl #1] |
| 40 sel r7, r6, lr ; select bytes with positive difference | 45 sel r7, r6, lr ; select bytes with positive difference |
| 41 usub8 r9, r5, r4 ; calculate difference with reversed operands | 46 usub8 r9, r5, r4 ; calculate difference with reversed operands |
| 47 pld [r2, r3, lsl #1] |
| 42 sel r6, r9, lr ; select bytes with negative difference | 48 sel r6, r9, lr ; select bytes with negative difference |
| 43 | 49 |
| 44 ; calculate partial sums | 50 ; calculate partial sums |
| 45 usad8 r4, r7, lr ; calculate sum of positive differences | 51 usad8 r4, r7, lr ; calculate sum of positive differences |
| 46 usad8 r5, r6, lr ; calculate sum of negative differences | 52 usad8 r5, r6, lr ; calculate sum of negative differences |
| 47 orr r6, r6, r7 ; differences of all 4 pixels | 53 orr r6, r6, r7 ; differences of all 4 pixels |
| 48 ; calculate total sum | 54 ; calculate total sum |
| 49 adds r8, r8, r4 ; add positive differences to sum | 55 adds r8, r8, r4 ; add positive differences to sum |
| 50 subs r8, r8, r5 ; substract negative differences from sum | 56 subs r8, r8, r5 ; substract negative differences from sum |
| 51 | 57 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 mul r0, r8, r8 ; sum * sum | 145 mul r0, r8, r8 ; sum * sum |
| 140 str r11, [r6] ; store sse | 146 str r11, [r6] ; store sse |
| 141 sub r0, r11, r0, asr #8 ; return (sse - ((sum * sum) >> 8)) | 147 sub r0, r11, r0, asr #8 ; return (sse - ((sum * sum) >> 8)) |
| 142 | 148 |
| 143 ldmfd sp!, {r4-r12, pc} | 149 ldmfd sp!, {r4-r12, pc} |
| 144 | 150 |
| 145 ENDP | 151 ENDP |
| 146 | 152 |
| 147 END | 153 END |
| 148 | 154 |
| OLD | NEW |