| 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 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 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] | 47 pld [r2, r3, lsl #1] |
| 48 sel r6, r9, lr ; select bytes with negative difference | 48 sel r6, r9, lr ; select bytes with negative difference |
| 49 | 49 |
| 50 ; calculate partial sums | 50 ; calculate partial sums |
| 51 usad8 r4, r7, lr ; calculate sum of positive differences | 51 usad8 r4, r7, lr ; calculate sum of positive differences |
| 52 usad8 r5, r6, lr ; calculate sum of negative differences | 52 usad8 r5, r6, lr ; calculate sum of negative differences |
| 53 orr r6, r6, r7 ; differences of all 4 pixels | 53 orr r6, r6, r7 ; differences of all 4 pixels |
| 54 ; calculate total sum | 54 ; calculate total sum |
| 55 adds r8, r8, r4 ; add positive differences to sum | 55 adds r8, r8, r4 ; add positive differences to sum |
| 56 subs r8, r8, r5 ; substract negative differences from sum | 56 subs r8, r8, r5 ; subtract negative differences from sum |
| 57 | 57 |
| 58 ; calculate sse | 58 ; calculate sse |
| 59 uxtb16 r5, r6 ; byte (two pixels) to halfwords | 59 uxtb16 r5, r6 ; byte (two pixels) to halfwords |
| 60 uxtb16 r10, r6, ror #8 ; another two pixels to halfwords | 60 uxtb16 r10, r6, ror #8 ; another two pixels to halfwords |
| 61 smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) | 61 smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) |
| 62 | 62 |
| 63 ; 2nd 4 pixels | 63 ; 2nd 4 pixels |
| 64 ldr r4, [r0, #4] ; load 4 src pixels | 64 ldr r4, [r0, #4] ; load 4 src pixels |
| 65 ldr r5, [r2, #4] ; load 4 ref pixels | 65 ldr r5, [r2, #4] ; load 4 ref pixels |
| 66 smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) | 66 smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) |
| 67 | 67 |
| 68 usub8 r6, r4, r5 ; calculate difference | 68 usub8 r6, r4, r5 ; calculate difference |
| 69 sel r7, r6, lr ; select bytes with positive difference | 69 sel r7, r6, lr ; select bytes with positive difference |
| 70 usub8 r9, r5, r4 ; calculate difference with reversed operands | 70 usub8 r9, r5, r4 ; calculate difference with reversed operands |
| 71 sel r6, r9, lr ; select bytes with negative difference | 71 sel r6, r9, lr ; select bytes with negative difference |
| 72 | 72 |
| 73 ; calculate partial sums | 73 ; calculate partial sums |
| 74 usad8 r4, r7, lr ; calculate sum of positive differences | 74 usad8 r4, r7, lr ; calculate sum of positive differences |
| 75 usad8 r5, r6, lr ; calculate sum of negative differences | 75 usad8 r5, r6, lr ; calculate sum of negative differences |
| 76 orr r6, r6, r7 ; differences of all 4 pixels | 76 orr r6, r6, r7 ; differences of all 4 pixels |
| 77 | 77 |
| 78 ; calculate total sum | 78 ; calculate total sum |
| 79 add r8, r8, r4 ; add positive differences to sum | 79 add r8, r8, r4 ; add positive differences to sum |
| 80 sub r8, r8, r5 ; substract negative differences from sum | 80 sub r8, r8, r5 ; subtract negative differences from sum |
| 81 | 81 |
| 82 ; calculate sse | 82 ; calculate sse |
| 83 uxtb16 r5, r6 ; byte (two pixels) to halfwords | 83 uxtb16 r5, r6 ; byte (two pixels) to halfwords |
| 84 uxtb16 r10, r6, ror #8 ; another two pixels to halfwords | 84 uxtb16 r10, r6, ror #8 ; another two pixels to halfwords |
| 85 smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) | 85 smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) |
| 86 | 86 |
| 87 ; 3rd 4 pixels | 87 ; 3rd 4 pixels |
| 88 ldr r4, [r0, #8] ; load 4 src pixels | 88 ldr r4, [r0, #8] ; load 4 src pixels |
| 89 ldr r5, [r2, #8] ; load 4 ref pixels | 89 ldr r5, [r2, #8] ; load 4 ref pixels |
| 90 smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) | 90 smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) |
| 91 | 91 |
| 92 usub8 r6, r4, r5 ; calculate difference | 92 usub8 r6, r4, r5 ; calculate difference |
| 93 sel r7, r6, lr ; select bytes with positive difference | 93 sel r7, r6, lr ; select bytes with positive difference |
| 94 usub8 r9, r5, r4 ; calculate difference with reversed operands | 94 usub8 r9, r5, r4 ; calculate difference with reversed operands |
| 95 sel r6, r9, lr ; select bytes with negative difference | 95 sel r6, r9, lr ; select bytes with negative difference |
| 96 | 96 |
| 97 ; calculate partial sums | 97 ; calculate partial sums |
| 98 usad8 r4, r7, lr ; calculate sum of positive differences | 98 usad8 r4, r7, lr ; calculate sum of positive differences |
| 99 usad8 r5, r6, lr ; calculate sum of negative differences | 99 usad8 r5, r6, lr ; calculate sum of negative differences |
| 100 orr r6, r6, r7 ; differences of all 4 pixels | 100 orr r6, r6, r7 ; differences of all 4 pixels |
| 101 | 101 |
| 102 ; calculate total sum | 102 ; calculate total sum |
| 103 add r8, r8, r4 ; add positive differences to sum | 103 add r8, r8, r4 ; add positive differences to sum |
| 104 sub r8, r8, r5 ; substract negative differences from sum | 104 sub r8, r8, r5 ; subtract negative differences from sum |
| 105 | 105 |
| 106 ; calculate sse | 106 ; calculate sse |
| 107 uxtb16 r5, r6 ; byte (two pixels) to halfwords | 107 uxtb16 r5, r6 ; byte (two pixels) to halfwords |
| 108 uxtb16 r10, r6, ror #8 ; another two pixels to halfwords | 108 uxtb16 r10, r6, ror #8 ; another two pixels to halfwords |
| 109 smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) | 109 smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) |
| 110 | 110 |
| 111 ; 4th 4 pixels | 111 ; 4th 4 pixels |
| 112 ldr r4, [r0, #12] ; load 4 src pixels | 112 ldr r4, [r0, #12] ; load 4 src pixels |
| 113 ldr r5, [r2, #12] ; load 4 ref pixels | 113 ldr r5, [r2, #12] ; load 4 ref pixels |
| 114 smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) | 114 smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) |
| 115 | 115 |
| 116 usub8 r6, r4, r5 ; calculate difference | 116 usub8 r6, r4, r5 ; calculate difference |
| 117 add r0, r0, r1 ; set src_ptr to next row | 117 add r0, r0, r1 ; set src_ptr to next row |
| 118 sel r7, r6, lr ; select bytes with positive difference | 118 sel r7, r6, lr ; select bytes with positive difference |
| 119 usub8 r9, r5, r4 ; calculate difference with reversed operands | 119 usub8 r9, r5, r4 ; calculate difference with reversed operands |
| 120 add r2, r2, r3 ; set dst_ptr to next row | 120 add r2, r2, r3 ; set dst_ptr to next row |
| 121 sel r6, r9, lr ; select bytes with negative difference | 121 sel r6, r9, lr ; select bytes with negative difference |
| 122 | 122 |
| 123 ; calculate partial sums | 123 ; calculate partial sums |
| 124 usad8 r4, r7, lr ; calculate sum of positive differences | 124 usad8 r4, r7, lr ; calculate sum of positive differences |
| 125 usad8 r5, r6, lr ; calculate sum of negative differences | 125 usad8 r5, r6, lr ; calculate sum of negative differences |
| 126 orr r6, r6, r7 ; differences of all 4 pixels | 126 orr r6, r6, r7 ; differences of all 4 pixels |
| 127 | 127 |
| 128 ; calculate total sum | 128 ; calculate total sum |
| 129 add r8, r8, r4 ; add positive differences to sum | 129 add r8, r8, r4 ; add positive differences to sum |
| 130 sub r8, r8, r5 ; substract negative differences from sum | 130 sub r8, r8, r5 ; subtract negative differences from sum |
| 131 | 131 |
| 132 ; calculate sse | 132 ; calculate sse |
| 133 uxtb16 r5, r6 ; byte (two pixels) to halfwords | 133 uxtb16 r5, r6 ; byte (two pixels) to halfwords |
| 134 uxtb16 r10, r6, ror #8 ; another two pixels to halfwords | 134 uxtb16 r10, r6, ror #8 ; another two pixels to halfwords |
| 135 smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) | 135 smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1) |
| 136 smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) | 136 smlad r11, r10, r10, r11 ; dual signed multiply, add and accumulate (2) |
| 137 | 137 |
| 138 | 138 |
| 139 subs r12, r12, #1 | 139 subs r12, r12, #1 |
| 140 | 140 |
| 141 bne loop | 141 bne loop |
| 142 | 142 |
| 143 ; return stuff | 143 ; return stuff |
| 144 ldr r6, [sp, #40] ; get address of sse | 144 ldr r6, [sp, #40] ; get address of sse |
| 145 mul r0, r8, r8 ; sum * sum | 145 mul r0, r8, r8 ; sum * sum |
| 146 str r11, [r6] ; store sse | 146 str r11, [r6] ; store sse |
| 147 sub r0, r11, r0, lsr #8 ; return (sse - ((sum * sum) >> 8)) | 147 sub r0, r11, r0, lsr #8 ; return (sse - ((sum * sum) >> 8)) |
| 148 | 148 |
| 149 ldmfd sp!, {r4-r12, pc} | 149 ldmfd sp!, {r4-r12, pc} |
| 150 | 150 |
| 151 ENDP | 151 ENDP |
| 152 | 152 |
| 153 END | 153 END |
| 154 | 154 |
| OLD | NEW |