media/libvpx/vp9/common/arm/neon/vp9_mb_lpf_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) 2013 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 EXPORT |vp9_mb_lpf_horizontal_edge_w_neon|
michael@0 12 EXPORT |vp9_mb_lpf_vertical_edge_w_neon|
michael@0 13 ARM
michael@0 14
michael@0 15 AREA ||.text||, CODE, READONLY, ALIGN=2
michael@0 16
michael@0 17 ; void vp9_mb_lpf_horizontal_edge_w_neon(uint8_t *s, int p,
michael@0 18 ; const uint8_t *blimit,
michael@0 19 ; const uint8_t *limit,
michael@0 20 ; const uint8_t *thresh
michael@0 21 ; int count)
michael@0 22 ; r0 uint8_t *s,
michael@0 23 ; r1 int p, /* pitch */
michael@0 24 ; r2 const uint8_t *blimit,
michael@0 25 ; r3 const uint8_t *limit,
michael@0 26 ; sp const uint8_t *thresh,
michael@0 27 |vp9_mb_lpf_horizontal_edge_w_neon| PROC
michael@0 28 push {r4-r8, lr}
michael@0 29 vpush {d8-d15}
michael@0 30 ldr r4, [sp, #88] ; load thresh
michael@0 31 ldr r12, [sp, #92] ; load count
michael@0 32
michael@0 33 h_count
michael@0 34 vld1.8 {d16[]}, [r2] ; load *blimit
michael@0 35 vld1.8 {d17[]}, [r3] ; load *limit
michael@0 36 vld1.8 {d18[]}, [r4] ; load *thresh
michael@0 37
michael@0 38 sub r8, r0, r1, lsl #3 ; move src pointer down by 8 lines
michael@0 39
michael@0 40 vld1.u8 {d0}, [r8@64], r1 ; p7
michael@0 41 vld1.u8 {d1}, [r8@64], r1 ; p6
michael@0 42 vld1.u8 {d2}, [r8@64], r1 ; p5
michael@0 43 vld1.u8 {d3}, [r8@64], r1 ; p4
michael@0 44 vld1.u8 {d4}, [r8@64], r1 ; p3
michael@0 45 vld1.u8 {d5}, [r8@64], r1 ; p2
michael@0 46 vld1.u8 {d6}, [r8@64], r1 ; p1
michael@0 47 vld1.u8 {d7}, [r8@64], r1 ; p0
michael@0 48 vld1.u8 {d8}, [r8@64], r1 ; q0
michael@0 49 vld1.u8 {d9}, [r8@64], r1 ; q1
michael@0 50 vld1.u8 {d10}, [r8@64], r1 ; q2
michael@0 51 vld1.u8 {d11}, [r8@64], r1 ; q3
michael@0 52 vld1.u8 {d12}, [r8@64], r1 ; q4
michael@0 53 vld1.u8 {d13}, [r8@64], r1 ; q5
michael@0 54 vld1.u8 {d14}, [r8@64], r1 ; q6
michael@0 55 vld1.u8 {d15}, [r8@64], r1 ; q7
michael@0 56
michael@0 57 bl vp9_wide_mbfilter_neon
michael@0 58
michael@0 59 tst r7, #1
michael@0 60 beq h_mbfilter
michael@0 61
michael@0 62 ; flat && mask were not set for any of the channels. Just store the values
michael@0 63 ; from filter.
michael@0 64 sub r8, r0, r1, lsl #1
michael@0 65
michael@0 66 vst1.u8 {d25}, [r8@64], r1 ; store op1
michael@0 67 vst1.u8 {d24}, [r8@64], r1 ; store op0
michael@0 68 vst1.u8 {d23}, [r8@64], r1 ; store oq0
michael@0 69 vst1.u8 {d26}, [r8@64], r1 ; store oq1
michael@0 70
michael@0 71 b h_next
michael@0 72
michael@0 73 h_mbfilter
michael@0 74 tst r7, #2
michael@0 75 beq h_wide_mbfilter
michael@0 76
michael@0 77 ; flat2 was not set for any of the channels. Just store the values from
michael@0 78 ; mbfilter.
michael@0 79 sub r8, r0, r1, lsl #1
michael@0 80 sub r8, r8, r1
michael@0 81
michael@0 82 vst1.u8 {d18}, [r8@64], r1 ; store op2
michael@0 83 vst1.u8 {d19}, [r8@64], r1 ; store op1
michael@0 84 vst1.u8 {d20}, [r8@64], r1 ; store op0
michael@0 85 vst1.u8 {d21}, [r8@64], r1 ; store oq0
michael@0 86 vst1.u8 {d22}, [r8@64], r1 ; store oq1
michael@0 87 vst1.u8 {d23}, [r8@64], r1 ; store oq2
michael@0 88
michael@0 89 b h_next
michael@0 90
michael@0 91 h_wide_mbfilter
michael@0 92 sub r8, r0, r1, lsl #3
michael@0 93 add r8, r8, r1
michael@0 94
michael@0 95 vst1.u8 {d16}, [r8@64], r1 ; store op6
michael@0 96 vst1.u8 {d24}, [r8@64], r1 ; store op5
michael@0 97 vst1.u8 {d25}, [r8@64], r1 ; store op4
michael@0 98 vst1.u8 {d26}, [r8@64], r1 ; store op3
michael@0 99 vst1.u8 {d27}, [r8@64], r1 ; store op2
michael@0 100 vst1.u8 {d18}, [r8@64], r1 ; store op1
michael@0 101 vst1.u8 {d19}, [r8@64], r1 ; store op0
michael@0 102 vst1.u8 {d20}, [r8@64], r1 ; store oq0
michael@0 103 vst1.u8 {d21}, [r8@64], r1 ; store oq1
michael@0 104 vst1.u8 {d22}, [r8@64], r1 ; store oq2
michael@0 105 vst1.u8 {d23}, [r8@64], r1 ; store oq3
michael@0 106 vst1.u8 {d1}, [r8@64], r1 ; store oq4
michael@0 107 vst1.u8 {d2}, [r8@64], r1 ; store oq5
michael@0 108 vst1.u8 {d3}, [r8@64], r1 ; store oq6
michael@0 109
michael@0 110 h_next
michael@0 111 add r0, r0, #8
michael@0 112 subs r12, r12, #1
michael@0 113 bne h_count
michael@0 114
michael@0 115 vpop {d8-d15}
michael@0 116 pop {r4-r8, pc}
michael@0 117
michael@0 118 ENDP ; |vp9_mb_lpf_horizontal_edge_w_neon|
michael@0 119
michael@0 120 ; void vp9_mb_lpf_vertical_edge_w_neon(uint8_t *s, int p,
michael@0 121 ; const uint8_t *blimit,
michael@0 122 ; const uint8_t *limit,
michael@0 123 ; const uint8_t *thresh)
michael@0 124 ; r0 uint8_t *s,
michael@0 125 ; r1 int p, /* pitch */
michael@0 126 ; r2 const uint8_t *blimit,
michael@0 127 ; r3 const uint8_t *limit,
michael@0 128 ; sp const uint8_t *thresh,
michael@0 129 |vp9_mb_lpf_vertical_edge_w_neon| PROC
michael@0 130 push {r4-r8, lr}
michael@0 131 vpush {d8-d15}
michael@0 132 ldr r4, [sp, #88] ; load thresh
michael@0 133
michael@0 134 vld1.8 {d16[]}, [r2] ; load *blimit
michael@0 135 vld1.8 {d17[]}, [r3] ; load *limit
michael@0 136 vld1.8 {d18[]}, [r4] ; load *thresh
michael@0 137
michael@0 138 sub r8, r0, #8
michael@0 139
michael@0 140 vld1.8 {d0}, [r8@64], r1
michael@0 141 vld1.8 {d8}, [r0@64], r1
michael@0 142 vld1.8 {d1}, [r8@64], r1
michael@0 143 vld1.8 {d9}, [r0@64], r1
michael@0 144 vld1.8 {d2}, [r8@64], r1
michael@0 145 vld1.8 {d10}, [r0@64], r1
michael@0 146 vld1.8 {d3}, [r8@64], r1
michael@0 147 vld1.8 {d11}, [r0@64], r1
michael@0 148 vld1.8 {d4}, [r8@64], r1
michael@0 149 vld1.8 {d12}, [r0@64], r1
michael@0 150 vld1.8 {d5}, [r8@64], r1
michael@0 151 vld1.8 {d13}, [r0@64], r1
michael@0 152 vld1.8 {d6}, [r8@64], r1
michael@0 153 vld1.8 {d14}, [r0@64], r1
michael@0 154 vld1.8 {d7}, [r8@64], r1
michael@0 155 vld1.8 {d15}, [r0@64], r1
michael@0 156
michael@0 157 sub r0, r0, r1, lsl #3
michael@0 158
michael@0 159 vtrn.32 q0, q2
michael@0 160 vtrn.32 q1, q3
michael@0 161 vtrn.32 q4, q6
michael@0 162 vtrn.32 q5, q7
michael@0 163
michael@0 164 vtrn.16 q0, q1
michael@0 165 vtrn.16 q2, q3
michael@0 166 vtrn.16 q4, q5
michael@0 167 vtrn.16 q6, q7
michael@0 168
michael@0 169 vtrn.8 d0, d1
michael@0 170 vtrn.8 d2, d3
michael@0 171 vtrn.8 d4, d5
michael@0 172 vtrn.8 d6, d7
michael@0 173
michael@0 174 vtrn.8 d8, d9
michael@0 175 vtrn.8 d10, d11
michael@0 176 vtrn.8 d12, d13
michael@0 177 vtrn.8 d14, d15
michael@0 178
michael@0 179 bl vp9_wide_mbfilter_neon
michael@0 180
michael@0 181 tst r7, #1
michael@0 182 beq v_mbfilter
michael@0 183
michael@0 184 ; flat && mask were not set for any of the channels. Just store the values
michael@0 185 ; from filter.
michael@0 186 sub r8, r0, #2
michael@0 187
michael@0 188 vswp d23, d25
michael@0 189
michael@0 190 vst4.8 {d23[0], d24[0], d25[0], d26[0]}, [r8], r1
michael@0 191 vst4.8 {d23[1], d24[1], d25[1], d26[1]}, [r8], r1
michael@0 192 vst4.8 {d23[2], d24[2], d25[2], d26[2]}, [r8], r1
michael@0 193 vst4.8 {d23[3], d24[3], d25[3], d26[3]}, [r8], r1
michael@0 194 vst4.8 {d23[4], d24[4], d25[4], d26[4]}, [r8], r1
michael@0 195 vst4.8 {d23[5], d24[5], d25[5], d26[5]}, [r8], r1
michael@0 196 vst4.8 {d23[6], d24[6], d25[6], d26[6]}, [r8], r1
michael@0 197 vst4.8 {d23[7], d24[7], d25[7], d26[7]}, [r8], r1
michael@0 198
michael@0 199 b v_end
michael@0 200
michael@0 201 v_mbfilter
michael@0 202 tst r7, #2
michael@0 203 beq v_wide_mbfilter
michael@0 204
michael@0 205 ; flat2 was not set for any of the channels. Just store the values from
michael@0 206 ; mbfilter.
michael@0 207 sub r8, r0, #3
michael@0 208
michael@0 209 vst3.8 {d18[0], d19[0], d20[0]}, [r8], r1
michael@0 210 vst3.8 {d21[0], d22[0], d23[0]}, [r0], r1
michael@0 211 vst3.8 {d18[1], d19[1], d20[1]}, [r8], r1
michael@0 212 vst3.8 {d21[1], d22[1], d23[1]}, [r0], r1
michael@0 213 vst3.8 {d18[2], d19[2], d20[2]}, [r8], r1
michael@0 214 vst3.8 {d21[2], d22[2], d23[2]}, [r0], r1
michael@0 215 vst3.8 {d18[3], d19[3], d20[3]}, [r8], r1
michael@0 216 vst3.8 {d21[3], d22[3], d23[3]}, [r0], r1
michael@0 217 vst3.8 {d18[4], d19[4], d20[4]}, [r8], r1
michael@0 218 vst3.8 {d21[4], d22[4], d23[4]}, [r0], r1
michael@0 219 vst3.8 {d18[5], d19[5], d20[5]}, [r8], r1
michael@0 220 vst3.8 {d21[5], d22[5], d23[5]}, [r0], r1
michael@0 221 vst3.8 {d18[6], d19[6], d20[6]}, [r8], r1
michael@0 222 vst3.8 {d21[6], d22[6], d23[6]}, [r0], r1
michael@0 223 vst3.8 {d18[7], d19[7], d20[7]}, [r8], r1
michael@0 224 vst3.8 {d21[7], d22[7], d23[7]}, [r0], r1
michael@0 225
michael@0 226 b v_end
michael@0 227
michael@0 228 v_wide_mbfilter
michael@0 229 sub r8, r0, #8
michael@0 230
michael@0 231 vtrn.32 d0, d26
michael@0 232 vtrn.32 d16, d27
michael@0 233 vtrn.32 d24, d18
michael@0 234 vtrn.32 d25, d19
michael@0 235
michael@0 236 vtrn.16 d0, d24
michael@0 237 vtrn.16 d16, d25
michael@0 238 vtrn.16 d26, d18
michael@0 239 vtrn.16 d27, d19
michael@0 240
michael@0 241 vtrn.8 d0, d16
michael@0 242 vtrn.8 d24, d25
michael@0 243 vtrn.8 d26, d27
michael@0 244 vtrn.8 d18, d19
michael@0 245
michael@0 246 vtrn.32 d20, d1
michael@0 247 vtrn.32 d21, d2
michael@0 248 vtrn.32 d22, d3
michael@0 249 vtrn.32 d23, d15
michael@0 250
michael@0 251 vtrn.16 d20, d22
michael@0 252 vtrn.16 d21, d23
michael@0 253 vtrn.16 d1, d3
michael@0 254 vtrn.16 d2, d15
michael@0 255
michael@0 256 vtrn.8 d20, d21
michael@0 257 vtrn.8 d22, d23
michael@0 258 vtrn.8 d1, d2
michael@0 259 vtrn.8 d3, d15
michael@0 260
michael@0 261 vst1.8 {d0}, [r8@64], r1
michael@0 262 vst1.8 {d20}, [r0@64], r1
michael@0 263 vst1.8 {d16}, [r8@64], r1
michael@0 264 vst1.8 {d21}, [r0@64], r1
michael@0 265 vst1.8 {d24}, [r8@64], r1
michael@0 266 vst1.8 {d22}, [r0@64], r1
michael@0 267 vst1.8 {d25}, [r8@64], r1
michael@0 268 vst1.8 {d23}, [r0@64], r1
michael@0 269 vst1.8 {d26}, [r8@64], r1
michael@0 270 vst1.8 {d1}, [r0@64], r1
michael@0 271 vst1.8 {d27}, [r8@64], r1
michael@0 272 vst1.8 {d2}, [r0@64], r1
michael@0 273 vst1.8 {d18}, [r8@64], r1
michael@0 274 vst1.8 {d3}, [r0@64], r1
michael@0 275 vst1.8 {d19}, [r8@64], r1
michael@0 276 vst1.8 {d15}, [r0@64], r1
michael@0 277
michael@0 278 v_end
michael@0 279 vpop {d8-d15}
michael@0 280 pop {r4-r8, pc}
michael@0 281
michael@0 282 ENDP ; |vp9_mb_lpf_vertical_edge_w_neon|
michael@0 283
michael@0 284 ; void vp9_wide_mbfilter_neon();
michael@0 285 ; This is a helper function for the loopfilters. The invidual functions do the
michael@0 286 ; necessary load, transpose (if necessary) and store.
michael@0 287 ;
michael@0 288 ; r0-r3 PRESERVE
michael@0 289 ; d16 blimit
michael@0 290 ; d17 limit
michael@0 291 ; d18 thresh
michael@0 292 ; d0 p7
michael@0 293 ; d1 p6
michael@0 294 ; d2 p5
michael@0 295 ; d3 p4
michael@0 296 ; d4 p3
michael@0 297 ; d5 p2
michael@0 298 ; d6 p1
michael@0 299 ; d7 p0
michael@0 300 ; d8 q0
michael@0 301 ; d9 q1
michael@0 302 ; d10 q2
michael@0 303 ; d11 q3
michael@0 304 ; d12 q4
michael@0 305 ; d13 q5
michael@0 306 ; d14 q6
michael@0 307 ; d15 q7
michael@0 308 |vp9_wide_mbfilter_neon| PROC
michael@0 309 mov r7, #0
michael@0 310
michael@0 311 ; filter_mask
michael@0 312 vabd.u8 d19, d4, d5 ; abs(p3 - p2)
michael@0 313 vabd.u8 d20, d5, d6 ; abs(p2 - p1)
michael@0 314 vabd.u8 d21, d6, d7 ; abs(p1 - p0)
michael@0 315 vabd.u8 d22, d9, d8 ; abs(q1 - q0)
michael@0 316 vabd.u8 d23, d10, d9 ; abs(q2 - q1)
michael@0 317 vabd.u8 d24, d11, d10 ; abs(q3 - q2)
michael@0 318
michael@0 319 ; only compare the largest value to limit
michael@0 320 vmax.u8 d19, d19, d20 ; max(abs(p3 - p2), abs(p2 - p1))
michael@0 321 vmax.u8 d20, d21, d22 ; max(abs(p1 - p0), abs(q1 - q0))
michael@0 322 vmax.u8 d23, d23, d24 ; max(abs(q2 - q1), abs(q3 - q2))
michael@0 323 vmax.u8 d19, d19, d20
michael@0 324
michael@0 325 vabd.u8 d24, d7, d8 ; abs(p0 - q0)
michael@0 326
michael@0 327 vmax.u8 d19, d19, d23
michael@0 328
michael@0 329 vabd.u8 d23, d6, d9 ; a = abs(p1 - q1)
michael@0 330 vqadd.u8 d24, d24, d24 ; b = abs(p0 - q0) * 2
michael@0 331
michael@0 332 ; abs () > limit
michael@0 333 vcge.u8 d19, d17, d19
michael@0 334
michael@0 335 ; flatmask4
michael@0 336 vabd.u8 d25, d7, d5 ; abs(p0 - p2)
michael@0 337 vabd.u8 d26, d8, d10 ; abs(q0 - q2)
michael@0 338 vabd.u8 d27, d4, d7 ; abs(p3 - p0)
michael@0 339 vabd.u8 d28, d11, d8 ; abs(q3 - q0)
michael@0 340
michael@0 341 ; only compare the largest value to thresh
michael@0 342 vmax.u8 d25, d25, d26 ; max(abs(p0 - p2), abs(q0 - q2))
michael@0 343 vmax.u8 d26, d27, d28 ; max(abs(p3 - p0), abs(q3 - q0))
michael@0 344 vmax.u8 d25, d25, d26
michael@0 345 vmax.u8 d20, d20, d25
michael@0 346
michael@0 347 vshr.u8 d23, d23, #1 ; a = a / 2
michael@0 348 vqadd.u8 d24, d24, d23 ; a = b + a
michael@0 349
michael@0 350 vmov.u8 d30, #1
michael@0 351 vcge.u8 d24, d16, d24 ; (a > blimit * 2 + limit) * -1
michael@0 352
michael@0 353 vcge.u8 d20, d30, d20 ; flat
michael@0 354
michael@0 355 vand d19, d19, d24 ; mask
michael@0 356
michael@0 357 ; hevmask
michael@0 358 vcgt.u8 d21, d21, d18 ; (abs(p1 - p0) > thresh)*-1
michael@0 359 vcgt.u8 d22, d22, d18 ; (abs(q1 - q0) > thresh)*-1
michael@0 360 vorr d21, d21, d22 ; hev
michael@0 361
michael@0 362 vand d16, d20, d19 ; flat && mask
michael@0 363 vmov r5, r6, d16
michael@0 364
michael@0 365 ; flatmask5(1, p7, p6, p5, p4, p0, q0, q4, q5, q6, q7)
michael@0 366 vabd.u8 d22, d3, d7 ; abs(p4 - p0)
michael@0 367 vabd.u8 d23, d12, d8 ; abs(q4 - q0)
michael@0 368 vabd.u8 d24, d7, d2 ; abs(p0 - p5)
michael@0 369 vabd.u8 d25, d8, d13 ; abs(q0 - q5)
michael@0 370 vabd.u8 d26, d1, d7 ; abs(p6 - p0)
michael@0 371 vabd.u8 d27, d14, d8 ; abs(q6 - q0)
michael@0 372 vabd.u8 d28, d0, d7 ; abs(p7 - p0)
michael@0 373 vabd.u8 d29, d15, d8 ; abs(q7 - q0)
michael@0 374
michael@0 375 ; only compare the largest value to thresh
michael@0 376 vmax.u8 d22, d22, d23 ; max(abs(p4 - p0), abs(q4 - q0))
michael@0 377 vmax.u8 d23, d24, d25 ; max(abs(p0 - p5), abs(q0 - q5))
michael@0 378 vmax.u8 d24, d26, d27 ; max(abs(p6 - p0), abs(q6 - q0))
michael@0 379 vmax.u8 d25, d28, d29 ; max(abs(p7 - p0), abs(q7 - q0))
michael@0 380
michael@0 381 vmax.u8 d26, d22, d23
michael@0 382 vmax.u8 d27, d24, d25
michael@0 383 vmax.u8 d23, d26, d27
michael@0 384
michael@0 385 vcge.u8 d18, d30, d23 ; flat2
michael@0 386
michael@0 387 vmov.u8 d22, #0x80
michael@0 388
michael@0 389 orrs r5, r5, r6 ; Check for 0
michael@0 390 orreq r7, r7, #1 ; Only do filter branch
michael@0 391
michael@0 392 vand d17, d18, d16 ; flat2 && flat && mask
michael@0 393 vmov r5, r6, d17
michael@0 394
michael@0 395 ; mbfilter() function
michael@0 396
michael@0 397 ; filter() function
michael@0 398 ; convert to signed
michael@0 399 veor d23, d8, d22 ; qs0
michael@0 400 veor d24, d7, d22 ; ps0
michael@0 401 veor d25, d6, d22 ; ps1
michael@0 402 veor d26, d9, d22 ; qs1
michael@0 403
michael@0 404 vmov.u8 d27, #3
michael@0 405
michael@0 406 vsub.s8 d28, d23, d24 ; ( qs0 - ps0)
michael@0 407 vqsub.s8 d29, d25, d26 ; filter = clamp(ps1-qs1)
michael@0 408 vmull.s8 q15, d28, d27 ; 3 * ( qs0 - ps0)
michael@0 409 vand d29, d29, d21 ; filter &= hev
michael@0 410 vaddw.s8 q15, q15, d29 ; filter + 3 * (qs0 - ps0)
michael@0 411 vmov.u8 d29, #4
michael@0 412
michael@0 413 ; filter = clamp(filter + 3 * ( qs0 - ps0))
michael@0 414 vqmovn.s16 d28, q15
michael@0 415
michael@0 416 vand d28, d28, d19 ; filter &= mask
michael@0 417
michael@0 418 vqadd.s8 d30, d28, d27 ; filter2 = clamp(filter+3)
michael@0 419 vqadd.s8 d29, d28, d29 ; filter1 = clamp(filter+4)
michael@0 420 vshr.s8 d30, d30, #3 ; filter2 >>= 3
michael@0 421 vshr.s8 d29, d29, #3 ; filter1 >>= 3
michael@0 422
michael@0 423
michael@0 424 vqadd.s8 d24, d24, d30 ; op0 = clamp(ps0 + filter2)
michael@0 425 vqsub.s8 d23, d23, d29 ; oq0 = clamp(qs0 - filter1)
michael@0 426
michael@0 427 ; outer tap adjustments: ++filter1 >> 1
michael@0 428 vrshr.s8 d29, d29, #1
michael@0 429 vbic d29, d29, d21 ; filter &= ~hev
michael@0 430
michael@0 431 vqadd.s8 d25, d25, d29 ; op1 = clamp(ps1 + filter)
michael@0 432 vqsub.s8 d26, d26, d29 ; oq1 = clamp(qs1 - filter)
michael@0 433
michael@0 434 veor d24, d24, d22 ; *f_op0 = u^0x80
michael@0 435 veor d23, d23, d22 ; *f_oq0 = u^0x80
michael@0 436 veor d25, d25, d22 ; *f_op1 = u^0x80
michael@0 437 veor d26, d26, d22 ; *f_oq1 = u^0x80
michael@0 438
michael@0 439 tst r7, #1
michael@0 440 bxne lr
michael@0 441
michael@0 442 ; mbfilter flat && mask branch
michael@0 443 ; TODO(fgalligan): Can I decrease the cycles shifting to consective d's
michael@0 444 ; and using vibt on the q's?
michael@0 445 vmov.u8 d29, #2
michael@0 446 vaddl.u8 q15, d7, d8 ; op2 = p0 + q0
michael@0 447 vmlal.u8 q15, d4, d27 ; op2 = p0 + q0 + p3 * 3
michael@0 448 vmlal.u8 q15, d5, d29 ; op2 = p0 + q0 + p3 * 3 + p2 * 2
michael@0 449 vaddl.u8 q10, d4, d5
michael@0 450 vaddw.u8 q15, d6 ; op2=p1 + p0 + q0 + p3 * 3 + p2 *2
michael@0 451 vaddl.u8 q14, d6, d9
michael@0 452 vqrshrn.u16 d18, q15, #3 ; r_op2
michael@0 453
michael@0 454 vsub.i16 q15, q10
michael@0 455 vaddl.u8 q10, d4, d6
michael@0 456 vadd.i16 q15, q14
michael@0 457 vaddl.u8 q14, d7, d10
michael@0 458 vqrshrn.u16 d19, q15, #3 ; r_op1
michael@0 459
michael@0 460 vsub.i16 q15, q10
michael@0 461 vadd.i16 q15, q14
michael@0 462 vaddl.u8 q14, d8, d11
michael@0 463 vqrshrn.u16 d20, q15, #3 ; r_op0
michael@0 464
michael@0 465 vsubw.u8 q15, d4 ; oq0 = op0 - p3
michael@0 466 vsubw.u8 q15, d7 ; oq0 -= p0
michael@0 467 vadd.i16 q15, q14
michael@0 468 vaddl.u8 q14, d9, d11
michael@0 469 vqrshrn.u16 d21, q15, #3 ; r_oq0
michael@0 470
michael@0 471 vsubw.u8 q15, d5 ; oq1 = oq0 - p2
michael@0 472 vsubw.u8 q15, d8 ; oq1 -= q0
michael@0 473 vadd.i16 q15, q14
michael@0 474 vaddl.u8 q14, d10, d11
michael@0 475 vqrshrn.u16 d22, q15, #3 ; r_oq1
michael@0 476
michael@0 477 vsubw.u8 q15, d6 ; oq2 = oq0 - p1
michael@0 478 vsubw.u8 q15, d9 ; oq2 -= q1
michael@0 479 vadd.i16 q15, q14
michael@0 480 vqrshrn.u16 d27, q15, #3 ; r_oq2
michael@0 481
michael@0 482 ; Filter does not set op2 or oq2, so use p2 and q2.
michael@0 483 vbif d18, d5, d16 ; t_op2 |= p2 & ~(flat & mask)
michael@0 484 vbif d19, d25, d16 ; t_op1 |= f_op1 & ~(flat & mask)
michael@0 485 vbif d20, d24, d16 ; t_op0 |= f_op0 & ~(flat & mask)
michael@0 486 vbif d21, d23, d16 ; t_oq0 |= f_oq0 & ~(flat & mask)
michael@0 487 vbif d22, d26, d16 ; t_oq1 |= f_oq1 & ~(flat & mask)
michael@0 488
michael@0 489 vbit d23, d27, d16 ; t_oq2 |= r_oq2 & (flat & mask)
michael@0 490 vbif d23, d10, d16 ; t_oq2 |= q2 & ~(flat & mask)
michael@0 491
michael@0 492 tst r7, #2
michael@0 493 bxne lr
michael@0 494
michael@0 495 ; wide_mbfilter flat2 && flat && mask branch
michael@0 496 vmov.u8 d16, #7
michael@0 497 vaddl.u8 q15, d7, d8 ; op6 = p0 + q0
michael@0 498 vaddl.u8 q12, d2, d3
michael@0 499 vaddl.u8 q13, d4, d5
michael@0 500 vaddl.u8 q14, d1, d6
michael@0 501 vmlal.u8 q15, d0, d16 ; op6 += p7 * 3
michael@0 502 vadd.i16 q12, q13
michael@0 503 vadd.i16 q15, q14
michael@0 504 vaddl.u8 q14, d2, d9
michael@0 505 vadd.i16 q15, q12
michael@0 506 vaddl.u8 q12, d0, d1
michael@0 507 vaddw.u8 q15, d1
michael@0 508 vaddl.u8 q13, d0, d2
michael@0 509 vadd.i16 q14, q15, q14
michael@0 510 vqrshrn.u16 d16, q15, #4 ; w_op6
michael@0 511
michael@0 512 vsub.i16 q15, q14, q12
michael@0 513 vaddl.u8 q14, d3, d10
michael@0 514 vqrshrn.u16 d24, q15, #4 ; w_op5
michael@0 515
michael@0 516 vsub.i16 q15, q13
michael@0 517 vaddl.u8 q13, d0, d3
michael@0 518 vadd.i16 q15, q14
michael@0 519 vaddl.u8 q14, d4, d11
michael@0 520 vqrshrn.u16 d25, q15, #4 ; w_op4
michael@0 521
michael@0 522 vadd.i16 q15, q14
michael@0 523 vaddl.u8 q14, d0, d4
michael@0 524 vsub.i16 q15, q13
michael@0 525 vsub.i16 q14, q15, q14
michael@0 526 vqrshrn.u16 d26, q15, #4 ; w_op3
michael@0 527
michael@0 528 vaddw.u8 q15, q14, d5 ; op2 += p2
michael@0 529 vaddl.u8 q14, d0, d5
michael@0 530 vaddw.u8 q15, d12 ; op2 += q4
michael@0 531 vbif d26, d4, d17 ; op3 |= p3 & ~(f2 & f & m)
michael@0 532 vqrshrn.u16 d27, q15, #4 ; w_op2
michael@0 533
michael@0 534 vsub.i16 q15, q14
michael@0 535 vaddl.u8 q14, d0, d6
michael@0 536 vaddw.u8 q15, d6 ; op1 += p1
michael@0 537 vaddw.u8 q15, d13 ; op1 += q5
michael@0 538 vbif d27, d18, d17 ; op2 |= t_op2 & ~(f2 & f & m)
michael@0 539 vqrshrn.u16 d18, q15, #4 ; w_op1
michael@0 540
michael@0 541 vsub.i16 q15, q14
michael@0 542 vaddl.u8 q14, d0, d7
michael@0 543 vaddw.u8 q15, d7 ; op0 += p0
michael@0 544 vaddw.u8 q15, d14 ; op0 += q6
michael@0 545 vbif d18, d19, d17 ; op1 |= t_op1 & ~(f2 & f & m)
michael@0 546 vqrshrn.u16 d19, q15, #4 ; w_op0
michael@0 547
michael@0 548 vsub.i16 q15, q14
michael@0 549 vaddl.u8 q14, d1, d8
michael@0 550 vaddw.u8 q15, d8 ; oq0 += q0
michael@0 551 vaddw.u8 q15, d15 ; oq0 += q7
michael@0 552 vbif d19, d20, d17 ; op0 |= t_op0 & ~(f2 & f & m)
michael@0 553 vqrshrn.u16 d20, q15, #4 ; w_oq0
michael@0 554
michael@0 555 vsub.i16 q15, q14
michael@0 556 vaddl.u8 q14, d2, d9
michael@0 557 vaddw.u8 q15, d9 ; oq1 += q1
michael@0 558 vaddl.u8 q4, d10, d15
michael@0 559 vaddw.u8 q15, d15 ; oq1 += q7
michael@0 560 vbif d20, d21, d17 ; oq0 |= t_oq0 & ~(f2 & f & m)
michael@0 561 vqrshrn.u16 d21, q15, #4 ; w_oq1
michael@0 562
michael@0 563 vsub.i16 q15, q14
michael@0 564 vaddl.u8 q14, d3, d10
michael@0 565 vadd.i16 q15, q4
michael@0 566 vaddl.u8 q4, d11, d15
michael@0 567 vbif d21, d22, d17 ; oq1 |= t_oq1 & ~(f2 & f & m)
michael@0 568 vqrshrn.u16 d22, q15, #4 ; w_oq2
michael@0 569
michael@0 570 vsub.i16 q15, q14
michael@0 571 vaddl.u8 q14, d4, d11
michael@0 572 vadd.i16 q15, q4
michael@0 573 vaddl.u8 q4, d12, d15
michael@0 574 vbif d22, d23, d17 ; oq2 |= t_oq2 & ~(f2 & f & m)
michael@0 575 vqrshrn.u16 d23, q15, #4 ; w_oq3
michael@0 576
michael@0 577 vsub.i16 q15, q14
michael@0 578 vaddl.u8 q14, d5, d12
michael@0 579 vadd.i16 q15, q4
michael@0 580 vaddl.u8 q4, d13, d15
michael@0 581 vbif d16, d1, d17 ; op6 |= p6 & ~(f2 & f & m)
michael@0 582 vqrshrn.u16 d1, q15, #4 ; w_oq4
michael@0 583
michael@0 584 vsub.i16 q15, q14
michael@0 585 vaddl.u8 q14, d6, d13
michael@0 586 vadd.i16 q15, q4
michael@0 587 vaddl.u8 q4, d14, d15
michael@0 588 vbif d24, d2, d17 ; op5 |= p5 & ~(f2 & f & m)
michael@0 589 vqrshrn.u16 d2, q15, #4 ; w_oq5
michael@0 590
michael@0 591 vsub.i16 q15, q14
michael@0 592 vbif d25, d3, d17 ; op4 |= p4 & ~(f2 & f & m)
michael@0 593 vadd.i16 q15, q4
michael@0 594 vbif d23, d11, d17 ; oq3 |= q3 & ~(f2 & f & m)
michael@0 595 vqrshrn.u16 d3, q15, #4 ; w_oq6
michael@0 596 vbif d1, d12, d17 ; oq4 |= q4 & ~(f2 & f & m)
michael@0 597 vbif d2, d13, d17 ; oq5 |= q5 & ~(f2 & f & m)
michael@0 598 vbif d3, d14, d17 ; oq6 |= q6 & ~(f2 & f & m)
michael@0 599
michael@0 600 bx lr
michael@0 601 ENDP ; |vp9_wide_mbfilter_neon|
michael@0 602
michael@0 603 END

mercurial