| 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_variance8x8_armv6| | 12 EXPORT |vp8_variance8x8_armv6| |
| 13 | 13 |
| 14 ARM | 14 ARM |
| 15 | 15 |
| 16 AREA ||.text||, CODE, READONLY, ALIGN=2 | 16 AREA ||.text||, CODE, READONLY, ALIGN=2 |
| 17 | 17 |
| 18 ; r0 unsigned char *src_ptr | 18 ; r0 unsigned char *src_ptr |
| 19 ; r1 int source_stride | 19 ; r1 int source_stride |
| 20 ; r2 unsigned char *ref_ptr | 20 ; r2 unsigned char *ref_ptr |
| 21 ; r3 int recon_stride | 21 ; r3 int recon_stride |
| 22 ; stack unsigned int *sse | 22 ; stack unsigned int *sse |
| 23 |vp8_variance8x8_armv6| PROC | 23 |vp8_variance8x8_armv6| PROC |
| 24 | 24 |
| 25 push {r4-r10, lr} | 25 push {r4-r10, lr} |
| 26 |
| 27 pld [r0, r1, lsl #0] |
| 28 pld [r2, r3, lsl #0] |
| 29 |
| 26 mov r12, #8 ; set loop counter to 8 (=block height) | 30 mov r12, #8 ; set loop counter to 8 (=block height) |
| 27 mov r4, #0 ; initialize sum = 0 | 31 mov r4, #0 ; initialize sum = 0 |
| 28 mov r5, #0 ; initialize sse = 0 | 32 mov r5, #0 ; initialize sse = 0 |
| 29 | 33 |
| 30 loop | 34 loop |
| 31 ; 1st 4 pixels | 35 ; 1st 4 pixels |
| 32 ldr r6, [r0, #0x0] ; load 4 src pixels | 36 ldr r6, [r0, #0x0] ; load 4 src pixels |
| 33 ldr r7, [r2, #0x0] ; load 4 ref pixels | 37 ldr r7, [r2, #0x0] ; load 4 ref pixels |
| 34 | 38 |
| 35 mov lr, #0 ; constant zero | 39 mov lr, #0 ; constant zero |
| 36 | 40 |
| 37 usub8 r8, r6, r7 ; calculate difference | 41 usub8 r8, r6, r7 ; calculate difference |
| 42 pld [r0, r1, lsl #1] |
| 38 sel r10, r8, lr ; select bytes with positive difference | 43 sel r10, r8, lr ; select bytes with positive difference |
| 39 usub8 r9, r7, r6 ; calculate difference with reversed operands | 44 usub8 r9, r7, r6 ; calculate difference with reversed operands |
| 45 pld [r2, r3, lsl #1] |
| 40 sel r8, r9, lr ; select bytes with negative difference | 46 sel r8, r9, lr ; select bytes with negative difference |
| 41 | 47 |
| 42 ; calculate partial sums | 48 ; calculate partial sums |
| 43 usad8 r6, r10, lr ; calculate sum of positive differences | 49 usad8 r6, r10, lr ; calculate sum of positive differences |
| 44 usad8 r7, r8, lr ; calculate sum of negative differences | 50 usad8 r7, r8, lr ; calculate sum of negative differences |
| 45 orr r8, r8, r10 ; differences of all 4 pixels | 51 orr r8, r8, r10 ; differences of all 4 pixels |
| 46 ; calculate total sum | 52 ; calculate total sum |
| 47 add r4, r4, r6 ; add positive differences to sum | 53 add r4, r4, r6 ; add positive differences to sum |
| 48 sub r4, r4, r7 ; substract negative differences from sum | 54 sub r4, r4, r7 ; substract negative differences from sum |
| 49 | 55 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 ldr r8, [sp, #32] ; get address of sse | 92 ldr r8, [sp, #32] ; get address of sse |
| 87 mul r1, r4, r4 ; sum * sum | 93 mul r1, r4, r4 ; sum * sum |
| 88 str r5, [r8] ; store sse | 94 str r5, [r8] ; store sse |
| 89 sub r0, r5, r1, ASR #6 ; return (sse - ((sum * sum) >> 6)) | 95 sub r0, r5, r1, ASR #6 ; return (sse - ((sum * sum) >> 6)) |
| 90 | 96 |
| 91 pop {r4-r10, pc} | 97 pop {r4-r10, pc} |
| 92 | 98 |
| 93 ENDP | 99 ENDP |
| 94 | 100 |
| 95 END | 101 END |
| OLD | NEW |