media/libvpx/vp8/common/arm/neon/dequant_idct_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_dequant_idct_add_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 ;void vp8_dequant_idct_add_neon(short *input, short *dq,
michael@0 19 ; unsigned char *dest, int stride)
michael@0 20 ; r0 short *input,
michael@0 21 ; r1 short *dq,
michael@0 22 ; r2 unsigned char *dest
michael@0 23 ; r3 int stride
michael@0 24
michael@0 25 |vp8_dequant_idct_add_neon| PROC
michael@0 26 vld1.16 {q3, q4}, [r0]
michael@0 27 vld1.16 {q5, q6}, [r1]
michael@0 28
michael@0 29 add r1, r2, r3 ; r1 = dest + stride
michael@0 30 lsl r3, #1 ; 2x stride
michael@0 31
michael@0 32 vld1.32 {d14[0]}, [r2], r3
michael@0 33 vld1.32 {d14[1]}, [r1], r3
michael@0 34 vld1.32 {d15[0]}, [r2]
michael@0 35 vld1.32 {d15[1]}, [r1]
michael@0 36
michael@0 37 adr r12, cospi8sqrt2minus1 ; pointer to the first constant
michael@0 38
michael@0 39 vmul.i16 q1, q3, q5 ;input for short_idct4x4llm_neon
michael@0 40 vmul.i16 q2, q4, q6
michael@0 41
michael@0 42 ;|short_idct4x4llm_neon| PROC
michael@0 43 vld1.16 {d0}, [r12]
michael@0 44 vswp d3, d4 ;q2(vp[4] vp[12])
michael@0 45
michael@0 46 vqdmulh.s16 q3, q2, d0[2]
michael@0 47 vqdmulh.s16 q4, q2, d0[0]
michael@0 48
michael@0 49 vqadd.s16 d12, d2, d3 ;a1
michael@0 50 vqsub.s16 d13, d2, d3 ;b1
michael@0 51
michael@0 52 vshr.s16 q3, q3, #1
michael@0 53 vshr.s16 q4, q4, #1
michael@0 54
michael@0 55 vqadd.s16 q3, q3, q2
michael@0 56 vqadd.s16 q4, q4, q2
michael@0 57
michael@0 58 vqsub.s16 d10, d6, d9 ;c1
michael@0 59 vqadd.s16 d11, d7, d8 ;d1
michael@0 60
michael@0 61 vqadd.s16 d2, d12, d11
michael@0 62 vqadd.s16 d3, d13, d10
michael@0 63 vqsub.s16 d4, d13, d10
michael@0 64 vqsub.s16 d5, d12, d11
michael@0 65
michael@0 66 vtrn.32 d2, d4
michael@0 67 vtrn.32 d3, d5
michael@0 68 vtrn.16 d2, d3
michael@0 69 vtrn.16 d4, d5
michael@0 70
michael@0 71 ; memset(input, 0, 32) -- 32bytes
michael@0 72 vmov.i16 q14, #0
michael@0 73
michael@0 74 vswp d3, d4
michael@0 75 vqdmulh.s16 q3, q2, d0[2]
michael@0 76 vqdmulh.s16 q4, q2, d0[0]
michael@0 77
michael@0 78 vqadd.s16 d12, d2, d3 ;a1
michael@0 79 vqsub.s16 d13, d2, d3 ;b1
michael@0 80
michael@0 81 vmov q15, q14
michael@0 82
michael@0 83 vshr.s16 q3, q3, #1
michael@0 84 vshr.s16 q4, q4, #1
michael@0 85
michael@0 86 vqadd.s16 q3, q3, q2
michael@0 87 vqadd.s16 q4, q4, q2
michael@0 88
michael@0 89 vqsub.s16 d10, d6, d9 ;c1
michael@0 90 vqadd.s16 d11, d7, d8 ;d1
michael@0 91
michael@0 92 vqadd.s16 d2, d12, d11
michael@0 93 vqadd.s16 d3, d13, d10
michael@0 94 vqsub.s16 d4, d13, d10
michael@0 95 vqsub.s16 d5, d12, d11
michael@0 96
michael@0 97 vst1.16 {q14, q15}, [r0]
michael@0 98
michael@0 99 vrshr.s16 d2, d2, #3
michael@0 100 vrshr.s16 d3, d3, #3
michael@0 101 vrshr.s16 d4, d4, #3
michael@0 102 vrshr.s16 d5, d5, #3
michael@0 103
michael@0 104 vtrn.32 d2, d4
michael@0 105 vtrn.32 d3, d5
michael@0 106 vtrn.16 d2, d3
michael@0 107 vtrn.16 d4, d5
michael@0 108
michael@0 109 vaddw.u8 q1, q1, d14
michael@0 110 vaddw.u8 q2, q2, d15
michael@0 111
michael@0 112 sub r2, r2, r3
michael@0 113 sub r1, r1, r3
michael@0 114
michael@0 115 vqmovun.s16 d0, q1
michael@0 116 vqmovun.s16 d1, q2
michael@0 117
michael@0 118 vst1.32 {d0[0]}, [r2], r3
michael@0 119 vst1.32 {d0[1]}, [r1], r3
michael@0 120 vst1.32 {d1[0]}, [r2]
michael@0 121 vst1.32 {d1[1]}, [r1]
michael@0 122
michael@0 123 bx lr
michael@0 124
michael@0 125 ENDP ; |vp8_dequant_idct_add_neon|
michael@0 126
michael@0 127 ; Constant Pool
michael@0 128 cospi8sqrt2minus1 DCD 0x4e7b4e7b
michael@0 129 sinpi8sqrt2 DCD 0x8a8c8a8c
michael@0 130
michael@0 131 END

mercurial