media/libvpx/vp8/common/arm/neon/bilinearpredict8x8_neon.asm

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 ;
michael@0 2 ; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
michael@0 3 ;
michael@0 4 ; Use of this source code is governed by a BSD-style license
michael@0 5 ; that can be found in the LICENSE file in the root of the source
michael@0 6 ; tree. An additional intellectual property rights grant can be found
michael@0 7 ; in the file PATENTS. All contributing project authors may
michael@0 8 ; be found in the AUTHORS file in the root of the source tree.
michael@0 9 ;
michael@0 10
michael@0 11
michael@0 12 EXPORT |vp8_bilinear_predict8x8_neon|
michael@0 13 ARM
michael@0 14 REQUIRE8
michael@0 15 PRESERVE8
michael@0 16
michael@0 17 AREA ||.text||, CODE, READONLY, ALIGN=2
michael@0 18 ; r0 unsigned char *src_ptr,
michael@0 19 ; r1 int src_pixels_per_line,
michael@0 20 ; r2 int xoffset,
michael@0 21 ; r3 int yoffset,
michael@0 22 ; r4 unsigned char *dst_ptr,
michael@0 23 ; stack(lr) int dst_pitch
michael@0 24
michael@0 25 |vp8_bilinear_predict8x8_neon| PROC
michael@0 26 push {r4, lr}
michael@0 27
michael@0 28 adr r12, bifilter8_coeff
michael@0 29 ldr r4, [sp, #8] ;load parameters from stack
michael@0 30 ldr lr, [sp, #12] ;load parameters from stack
michael@0 31
michael@0 32 cmp r2, #0 ;skip first_pass filter if xoffset=0
michael@0 33 beq skip_firstpass_filter
michael@0 34
michael@0 35 ;First pass: output_height lines x output_width columns (9x8)
michael@0 36 add r2, r12, r2, lsl #3 ;calculate filter location
michael@0 37
michael@0 38 vld1.u8 {q1}, [r0], r1 ;load src data
michael@0 39 vld1.u32 {d31}, [r2] ;load first_pass filter
michael@0 40 vld1.u8 {q2}, [r0], r1
michael@0 41 vdup.8 d0, d31[0] ;first_pass filter (d0 d1)
michael@0 42 vld1.u8 {q3}, [r0], r1
michael@0 43 vdup.8 d1, d31[4]
michael@0 44 vld1.u8 {q4}, [r0], r1
michael@0 45
michael@0 46 vmull.u8 q6, d2, d0 ;(src_ptr[0] * vp8_filter[0])
michael@0 47 vmull.u8 q7, d4, d0
michael@0 48 vmull.u8 q8, d6, d0
michael@0 49 vmull.u8 q9, d8, d0
michael@0 50
michael@0 51 vext.8 d3, d2, d3, #1 ;construct src_ptr[-1]
michael@0 52 vext.8 d5, d4, d5, #1
michael@0 53 vext.8 d7, d6, d7, #1
michael@0 54 vext.8 d9, d8, d9, #1
michael@0 55
michael@0 56 vmlal.u8 q6, d3, d1 ;(src_ptr[1] * vp8_filter[1])
michael@0 57 vmlal.u8 q7, d5, d1
michael@0 58 vmlal.u8 q8, d7, d1
michael@0 59 vmlal.u8 q9, d9, d1
michael@0 60
michael@0 61 vld1.u8 {q1}, [r0], r1 ;load src data
michael@0 62 vqrshrn.u16 d22, q6, #7 ;shift/round/saturate to u8
michael@0 63 vld1.u8 {q2}, [r0], r1
michael@0 64 vqrshrn.u16 d23, q7, #7
michael@0 65 vld1.u8 {q3}, [r0], r1
michael@0 66 vqrshrn.u16 d24, q8, #7
michael@0 67 vld1.u8 {q4}, [r0], r1
michael@0 68 vqrshrn.u16 d25, q9, #7
michael@0 69
michael@0 70 ;first_pass filtering on the rest 5-line data
michael@0 71 vld1.u8 {q5}, [r0], r1
michael@0 72
michael@0 73 vmull.u8 q6, d2, d0 ;(src_ptr[0] * vp8_filter[0])
michael@0 74 vmull.u8 q7, d4, d0
michael@0 75 vmull.u8 q8, d6, d0
michael@0 76 vmull.u8 q9, d8, d0
michael@0 77 vmull.u8 q10, d10, d0
michael@0 78
michael@0 79 vext.8 d3, d2, d3, #1 ;construct src_ptr[-1]
michael@0 80 vext.8 d5, d4, d5, #1
michael@0 81 vext.8 d7, d6, d7, #1
michael@0 82 vext.8 d9, d8, d9, #1
michael@0 83 vext.8 d11, d10, d11, #1
michael@0 84
michael@0 85 vmlal.u8 q6, d3, d1 ;(src_ptr[1] * vp8_filter[1])
michael@0 86 vmlal.u8 q7, d5, d1
michael@0 87 vmlal.u8 q8, d7, d1
michael@0 88 vmlal.u8 q9, d9, d1
michael@0 89 vmlal.u8 q10, d11, d1
michael@0 90
michael@0 91 vqrshrn.u16 d26, q6, #7 ;shift/round/saturate to u8
michael@0 92 vqrshrn.u16 d27, q7, #7
michael@0 93 vqrshrn.u16 d28, q8, #7
michael@0 94 vqrshrn.u16 d29, q9, #7
michael@0 95 vqrshrn.u16 d30, q10, #7
michael@0 96
michael@0 97 ;Second pass: 8x8
michael@0 98 secondpass_filter
michael@0 99 cmp r3, #0 ;skip second_pass filter if yoffset=0
michael@0 100 beq skip_secondpass_filter
michael@0 101
michael@0 102 add r3, r12, r3, lsl #3
michael@0 103 add r0, r4, lr
michael@0 104
michael@0 105 vld1.u32 {d31}, [r3] ;load second_pass filter
michael@0 106 add r1, r0, lr
michael@0 107
michael@0 108 vdup.8 d0, d31[0] ;second_pass filter parameters (d0 d1)
michael@0 109 vdup.8 d1, d31[4]
michael@0 110
michael@0 111 vmull.u8 q1, d22, d0 ;(src_ptr[0] * vp8_filter[0])
michael@0 112 vmull.u8 q2, d23, d0
michael@0 113 vmull.u8 q3, d24, d0
michael@0 114 vmull.u8 q4, d25, d0
michael@0 115 vmull.u8 q5, d26, d0
michael@0 116 vmull.u8 q6, d27, d0
michael@0 117 vmull.u8 q7, d28, d0
michael@0 118 vmull.u8 q8, d29, d0
michael@0 119
michael@0 120 vmlal.u8 q1, d23, d1 ;(src_ptr[pixel_step] * vp8_filter[1])
michael@0 121 vmlal.u8 q2, d24, d1
michael@0 122 vmlal.u8 q3, d25, d1
michael@0 123 vmlal.u8 q4, d26, d1
michael@0 124 vmlal.u8 q5, d27, d1
michael@0 125 vmlal.u8 q6, d28, d1
michael@0 126 vmlal.u8 q7, d29, d1
michael@0 127 vmlal.u8 q8, d30, d1
michael@0 128
michael@0 129 vqrshrn.u16 d2, q1, #7 ;shift/round/saturate to u8
michael@0 130 vqrshrn.u16 d3, q2, #7
michael@0 131 vqrshrn.u16 d4, q3, #7
michael@0 132 vqrshrn.u16 d5, q4, #7
michael@0 133 vqrshrn.u16 d6, q5, #7
michael@0 134 vqrshrn.u16 d7, q6, #7
michael@0 135 vqrshrn.u16 d8, q7, #7
michael@0 136 vqrshrn.u16 d9, q8, #7
michael@0 137
michael@0 138 vst1.u8 {d2}, [r4] ;store result
michael@0 139 vst1.u8 {d3}, [r0]
michael@0 140 vst1.u8 {d4}, [r1], lr
michael@0 141 vst1.u8 {d5}, [r1], lr
michael@0 142 vst1.u8 {d6}, [r1], lr
michael@0 143 vst1.u8 {d7}, [r1], lr
michael@0 144 vst1.u8 {d8}, [r1], lr
michael@0 145 vst1.u8 {d9}, [r1], lr
michael@0 146
michael@0 147 pop {r4, pc}
michael@0 148
michael@0 149 ;--------------------
michael@0 150 skip_firstpass_filter
michael@0 151 vld1.u8 {d22}, [r0], r1 ;load src data
michael@0 152 vld1.u8 {d23}, [r0], r1
michael@0 153 vld1.u8 {d24}, [r0], r1
michael@0 154 vld1.u8 {d25}, [r0], r1
michael@0 155 vld1.u8 {d26}, [r0], r1
michael@0 156 vld1.u8 {d27}, [r0], r1
michael@0 157 vld1.u8 {d28}, [r0], r1
michael@0 158 vld1.u8 {d29}, [r0], r1
michael@0 159 vld1.u8 {d30}, [r0], r1
michael@0 160
michael@0 161 b secondpass_filter
michael@0 162
michael@0 163 ;---------------------
michael@0 164 skip_secondpass_filter
michael@0 165 vst1.u8 {d22}, [r4], lr ;store result
michael@0 166 vst1.u8 {d23}, [r4], lr
michael@0 167 vst1.u8 {d24}, [r4], lr
michael@0 168 vst1.u8 {d25}, [r4], lr
michael@0 169 vst1.u8 {d26}, [r4], lr
michael@0 170 vst1.u8 {d27}, [r4], lr
michael@0 171 vst1.u8 {d28}, [r4], lr
michael@0 172 vst1.u8 {d29}, [r4], lr
michael@0 173
michael@0 174 pop {r4, pc}
michael@0 175
michael@0 176 ENDP
michael@0 177
michael@0 178 ;-----------------
michael@0 179
michael@0 180 bifilter8_coeff
michael@0 181 DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
michael@0 182
michael@0 183 END

mercurial