@ -75,6 +75,17 @@ endconst
.endif
.endm
/ / Same a s d m b u t t e r f l y 0 a b o v e , b u t t r e a t i n g t h e i n p u t i n i n 2 a s z e r o ,
/ / writing t h e s a m e o u t p u t i n t o b o t h o u t 1 a n d o u t 2 .
.macro dmbutterfly0_h out1 , o u t 2 , i n 1 , i n 2 , t m p1 , t m p2 , t m p3 , t m p4 , t m p5 , t m p6
smull \ t m p1 \ ( ) . 4 s , \ i n 1 \ ( ) . 4 h , v0 . h [ 0 ]
smull2 \ t m p2 \ ( ) . 4 s , \ i n 1 \ ( ) . 8 h , v0 . h [ 0 ]
rshrn \ o u t 1 \ ( ) . 4 h , \ t m p1 \ ( ) . 4 s , #14
rshrn2 \ o u t 1 \ ( ) . 8 h , \ t m p2 \ ( ) . 4 s , #14
rshrn \ o u t 2 \ ( ) . 4 h , \ t m p1 \ ( ) . 4 s , #14
rshrn2 \ o u t 2 \ ( ) . 8 h , \ t m p2 \ ( ) . 4 s , #14
.endm
/ / out1 ,o u t 2 = i n 1 * c o e f1 - i n 2 * c o e f2
/ / out3 ,o u t 4 = i n 1 * c o e f2 + i n 2 * c o e f1
/ / out a r e 4 x . 4 s r e g i s t e r s , i n a r e 2 x . 8 h r e g i s t e r s
@ -104,6 +115,43 @@ endconst
rshrn2 \ i n o u t 2 \ ( ) . 8 h , \ t m p4 \ ( ) . 4 s , #14
.endm
/ / Same a s d m b u t t e r f l y a b o v e , b u t t r e a t i n g t h e i n p u t i n i n o u t 2 a s z e r o
.macro dmbutterfly_h1 inout1 , i n o u t 2 , c o e f1 , c o e f2 , t m p1 , t m p2 , t m p3 , t m p4
smull \ t m p1 \ ( ) . 4 s , \ i n o u t 1 \ ( ) . 4 h , \ c o e f1
smull2 \ t m p2 \ ( ) . 4 s , \ i n o u t 1 \ ( ) . 8 h , \ c o e f1
smull \ t m p3 \ ( ) . 4 s , \ i n o u t 1 \ ( ) . 4 h , \ c o e f2
smull2 \ t m p4 \ ( ) . 4 s , \ i n o u t 1 \ ( ) . 8 h , \ c o e f2
rshrn \ i n o u t 1 \ ( ) . 4 h , \ t m p1 \ ( ) . 4 s , #14
rshrn2 \ i n o u t 1 \ ( ) . 8 h , \ t m p2 \ ( ) . 4 s , #14
rshrn \ i n o u t 2 \ ( ) . 4 h , \ t m p3 \ ( ) . 4 s , #14
rshrn2 \ i n o u t 2 \ ( ) . 8 h , \ t m p4 \ ( ) . 4 s , #14
.endm
/ / Same a s d m b u t t e r f l y a b o v e , b u t t r e a t i n g t h e i n p u t i n i n o u t 1 a s z e r o
.macro dmbutterfly_h2 inout1 , i n o u t 2 , c o e f1 , c o e f2 , t m p1 , t m p2 , t m p3 , t m p4
smull \ t m p1 \ ( ) . 4 s , \ i n o u t 2 \ ( ) . 4 h , \ c o e f2
smull2 \ t m p2 \ ( ) . 4 s , \ i n o u t 2 \ ( ) . 8 h , \ c o e f2
smull \ t m p3 \ ( ) . 4 s , \ i n o u t 2 \ ( ) . 4 h , \ c o e f1
smull2 \ t m p4 \ ( ) . 4 s , \ i n o u t 2 \ ( ) . 8 h , \ c o e f1
neg \ t m p1 \ ( ) . 4 s , \ t m p1 \ ( ) . 4 s
neg \ t m p2 \ ( ) . 4 s , \ t m p2 \ ( ) . 4 s
rshrn \ i n o u t 2 \ ( ) . 4 h , \ t m p3 \ ( ) . 4 s , #14
rshrn2 \ i n o u t 2 \ ( ) . 8 h , \ t m p4 \ ( ) . 4 s , #14
rshrn \ i n o u t 1 \ ( ) . 4 h , \ t m p1 \ ( ) . 4 s , #14
rshrn2 \ i n o u t 1 \ ( ) . 8 h , \ t m p2 \ ( ) . 4 s , #14
.endm
.macro dsmull_h out1 , o u t 2 , i n , c o e f
smull \ o u t 1 \ ( ) . 4 s , \ i n \ ( ) . 4 h , \ c o e f
smull2 \ o u t 2 \ ( ) . 4 s , \ i n \ ( ) . 8 h , \ c o e f
.endm
.macro drshrn_h out, i n 1 , i n 2 , s h i f t
rshrn \ o u t \ ( ) . 4 h , \ i n 1 \ ( ) . 4 s , \ s h i f t
rshrn2 \ o u t \ ( ) . 8 h , \ i n 2 \ ( ) . 4 s , \ s h i f t
.endm
/ / out1 = i n 1 + i n 2
/ / out2 = i n 1 - i n 2
.macro butterfly_8h out1 , o u t 2 , i n 1 , i n 2
@ -463,6 +511,30 @@ function idct16x16_dc_add_neon
ret
endfunc
.macro idct16_end
butterfly_ 8 h v18 , v7 , v4 , v7 / / v18 = t 0 a , v7 = t 7 a
butterfly_ 8 h v19 , v22 , v5 , v22 / / v19 = t 1 a , v22 = t 6
butterfly_ 8 h v4 , v26 , v20 , v26 / / v4 = t 2 a , v26 = t 5
butterfly_ 8 h v5 , v6 , v28 , v6 / / v5 = t 3 a , v6 = t 4
butterfly_ 8 h v20 , v28 , v16 , v24 / / v20 = t 8 a , v28 = t 1 1 a
butterfly_ 8 h v24 , v21 , v23 , v21 / / v24 = t 9 , v21 = t 1 0
butterfly_ 8 h v23 , v27 , v25 , v27 / / v23 = t 1 4 , v27 = t 1 3
butterfly_ 8 h v25 , v29 , v29 , v17 / / v25 = t 1 5 a , v29 = t 1 2 a
dmbutterfly0 v2 , v3 , v27 , v21 , v2 , v3 , v16 , v17 , v30 , v31 / / v2 = t 1 3 a , v3 = t 1 0 a
dmbutterfly0 v28 , v27 , v29 , v28 , v21 , v29 , v16 , v17 , v30 , v31 / / v28 = t 1 2 , v27 = t 1 1
butterfly_ 8 h v16 , v31 , v18 , v25 / / v16 = o u t [ 0 ] , v31 = o u t [ 1 5 ]
butterfly_ 8 h v17 , v30 , v19 , v23 / / v17 = o u t [ 1 ] , v30 = o u t [ 1 4 ]
butterfly_ 8 h _ r v25 , v22 , v22 , v24 / / v25 = o u t [ 9 ] , v22 = o u t [ 6 ]
butterfly_ 8 h v23 , v24 , v7 , v20 / / v23 = o u t [ 7 ] , v24 = o u t [ 8 ]
butterfly_ 8 h v18 , v29 , v4 , v2 / / v18 = o u t [ 2 ] , v29 = o u t [ 1 3 ]
butterfly_ 8 h v19 , v28 , v5 , v28 / / v19 = o u t [ 3 ] , v28 = o u t [ 1 2 ]
butterfly_ 8 h v20 , v27 , v6 , v27 / / v20 = o u t [ 4 ] , v27 = o u t [ 1 1 ]
butterfly_ 8 h v21 , v26 , v26 , v3 / / v21 = o u t [ 5 ] , v26 = o u t [ 1 0 ]
ret
.endm
function i d c t 1 6
dmbutterfly0 v16 , v24 , v16 , v24 , v2 , v3 , v4 , v5 , v6 , v7 / / v16 = t 0 a , v24 = t 1 a
dmbutterfly v20 , v28 , v0 . h [ 1 ] , v0 . h [ 2 ] , v2 , v3 , v4 , v5 / / v20 = t 2 a , v28 = t 3 a
@ -485,28 +557,65 @@ function idct16
dmbutterfly0 v22 , v26 , v22 , v26 , v2 , v3 , v18 , v19 , v30 , v31 / / v22 = t 6 a , v26 = t 5 a
dmbutterfly v23 , v25 , v0 . h [ 1 ] , v0 . h [ 2 ] , v18 , v19 , v30 , v31 / / v23 = t 9 a , v25 = t 1 4 a
dmbutterfly v27 , v21 , v0 . h [ 1 ] , v0 . h [ 2 ] , v18 , v19 , v30 , v31 , n e g =1 / / v27 = t 1 3 a , v21 = t 1 0 a
idct1 6 _ e n d
endfunc
butterfly_ 8 h v18 , v7 , v4 , v7 / / v18 = t 0 a , v7 = t 7 a
butterfly_ 8 h v19 , v22 , v5 , v22 / / v19 = t 1 a , v22 = t 6
butterfly_ 8 h v4 , v26 , v20 , v26 / / v4 = t 2 a , v26 = t 5
butterfly_ 8 h v5 , v6 , v28 , v6 / / v5 = t 3 a , v6 = t 4
butterfly_ 8 h v20 , v28 , v16 , v24 / / v20 = t 8 a , v28 = t 1 1 a
butterfly_ 8 h v24 , v21 , v23 , v21 / / v24 = t 9 , v21 = t 1 0
butterfly_ 8 h v23 , v27 , v25 , v27 / / v23 = t 1 4 , v27 = t 1 3
butterfly_ 8 h v25 , v29 , v29 , v17 / / v25 = t 1 5 a , v29 = t 1 2 a
function i d c t 1 6 _ h a l f
dmbutterfly0 _ h v16 , v24 , v16 , v24 , v2 , v3 , v4 , v5 , v6 , v7 / / v16 = t 0 a , v24 = t 1 a
dmbutterfly_ h1 v20 , v28 , v0 . h [ 1 ] , v0 . h [ 2 ] , v2 , v3 , v4 , v5 / / v20 = t 2 a , v28 = t 3 a
dmbutterfly_ h1 v18 , v30 , v0 . h [ 3 ] , v0 . h [ 4 ] , v2 , v3 , v4 , v5 / / v18 = t 4 a , v30 = t 7 a
dmbutterfly_ h2 v26 , v22 , v0 . h [ 5 ] , v0 . h [ 6 ] , v2 , v3 , v4 , v5 / / v26 = t 5 a , v22 = t 6 a
dmbutterfly_ h1 v17 , v31 , v0 . h [ 7 ] , v1 . h [ 0 ] , v2 , v3 , v4 , v5 / / v17 = t 8 a , v31 = t 1 5 a
dmbutterfly_ h2 v25 , v23 , v1 . h [ 1 ] , v1 . h [ 2 ] , v2 , v3 , v4 , v5 / / v25 = t 9 a , v23 = t 1 4 a
dmbutterfly_ h1 v21 , v27 , v1 . h [ 3 ] , v1 . h [ 4 ] , v2 , v3 , v4 , v5 / / v21 = t 1 0 a , v27 = t 1 3 a
dmbutterfly_ h2 v29 , v19 , v1 . h [ 5 ] , v1 . h [ 6 ] , v2 , v3 , v4 , v5 / / v29 = t 1 1 a , v19 = t 1 2 a
dmbutterfly0 v2 , v3 , v27 , v21 , v2 , v3 , v16 , v17 , v30 , v31 / / v2 = t 1 3 a , v3 = t 1 0 a
dmbutterfly0 v28 , v27 , v29 , v28 , v21 , v29 , v16 , v17 , v30 , v31 / / v28 = t 1 2 , v27 = t 1 1
butterfly_ 8 h v4 , v28 , v16 , v28 / / v4 = t 0 , v28 = t 3
butterfly_ 8 h v5 , v20 , v24 , v20 / / v5 = t 1 , v20 = t 2
butterfly_ 8 h v6 , v26 , v18 , v26 / / v6 = t 4 , v26 = t 5
butterfly_ 8 h v7 , v22 , v30 , v22 / / v7 = t 7 , v22 = t 6
butterfly_ 8 h v16 , v25 , v17 , v25 / / v16 = t 8 , v25 = t 9
butterfly_ 8 h v24 , v21 , v29 , v21 / / v24 = t 1 1 , v21 = t 1 0
butterfly_ 8 h v17 , v27 , v19 , v27 / / v17 = t 1 2 , v27 = t 1 3
butterfly_ 8 h v29 , v23 , v31 , v23 / / v29 = t 1 5 , v23 = t 1 4
butterfly_ 8 h v16 , v31 , v18 , v25 / / v16 = o u t [ 0 ] , v31 = o u t [ 1 5 ]
butterfly_ 8 h v17 , v30 , v19 , v23 / / v17 = o u t [ 1 ] , v30 = o u t [ 1 4 ]
butterfly_ 8 h _ r v25 , v22 , v22 , v24 / / v25 = o u t [ 9 ] , v22 = o u t [ 6 ]
butterfly_ 8 h v23 , v24 , v7 , v20 / / v23 = o u t [ 7 ] , v24 = o u t [ 8 ]
butterfly_ 8 h v18 , v29 , v4 , v2 / / v18 = o u t [ 2 ] , v29 = o u t [ 1 3 ]
butterfly_ 8 h v19 , v28 , v5 , v28 / / v19 = o u t [ 3 ] , v28 = o u t [ 1 2 ]
butterfly_ 8 h v20 , v27 , v6 , v27 / / v20 = o u t [ 4 ] , v27 = o u t [ 1 1 ]
butterfly_ 8 h v21 , v26 , v26 , v3 / / v21 = o u t [ 5 ] , v26 = o u t [ 1 0 ]
ret
dmbutterfly0 v22 , v26 , v22 , v26 , v2 , v3 , v18 , v19 , v30 , v31 / / v22 = t 6 a , v26 = t 5 a
dmbutterfly v23 , v25 , v0 . h [ 1 ] , v0 . h [ 2 ] , v18 , v19 , v30 , v31 / / v23 = t 9 a , v25 = t 1 4 a
dmbutterfly v27 , v21 , v0 . h [ 1 ] , v0 . h [ 2 ] , v18 , v19 , v30 , v31 , n e g =1 / / v27 = t 1 3 a , v21 = t 1 0 a
idct1 6 _ e n d
endfunc
function i d c t 1 6 _ q u a r t e r
dsmull_ h v24 , v25 , v19 , v1 . h [ 6 ]
dsmull_ h v4 , v5 , v17 , v0 . h [ 7 ]
dsmull_ h v7 , v6 , v18 , v0 . h [ 4 ]
dsmull_ h v30 , v31 , v18 , v0 . h [ 3 ]
neg v24 . 4 s , v24 . 4 s
neg v25 . 4 s , v25 . 4 s
dsmull_ h v29 , v28 , v17 , v1 . h [ 0 ]
dsmull_ h v26 , v27 , v19 , v1 . h [ 5 ]
dsmull_ h v22 , v23 , v16 , v0 . h [ 0 ]
drshrn_ h v24 , v24 , v25 , #14
drshrn_ h v16 , v4 , v5 , #14
drshrn_ h v7 , v7 , v6 , #14
drshrn_ h v6 , v30 , v31 , #14
drshrn_ h v29 , v29 , v28 , #14
drshrn_ h v17 , v26 , v27 , #14
drshrn_ h v28 , v22 , v23 , #14
dmbutterfly_ l v20 , v21 , v22 , v23 , v17 , v24 , v0 . h [ 1 ] , v0 . h [ 2 ]
dmbutterfly_ l v18 , v19 , v30 , v31 , v29 , v16 , v0 . h [ 1 ] , v0 . h [ 2 ]
neg v22 . 4 s , v22 . 4 s
neg v23 . 4 s , v23 . 4 s
drshrn_ h v27 , v20 , v21 , #14
drshrn_ h v21 , v22 , v23 , #14
drshrn_ h v23 , v18 , v19 , #14
drshrn_ h v25 , v30 , v31 , #14
mov v4 . 1 6 b , v28 . 1 6 b
mov v5 . 1 6 b , v28 . 1 6 b
dmbutterfly0 v22 , v26 , v7 , v6 , v18 , v19 , v30 , v31
mov v20 . 1 6 b , v28 . 1 6 b
idct1 6 _ e n d
endfunc
function i a d s t 1 6
@ -756,6 +865,13 @@ function ff_vp9_\txfm1\()_\txfm2\()_16x16_add_neon, export=1
.endif
mov x9 , #32
.ifc \ txfm1 \ ( ) _ \ t x f m 2 ,i d c t _ i d c t
cmp w3 , #10
b. l e i d c t 1 6 x16 _ q u a r t e r _ a d d _ n e o n
cmp w3 , #38
b. l e i d c t 1 6 x16 _ h a l f _ a d d _ n e o n
.endif
.irp i, 0 , 8
add x0 , s p , #( \ i * 32 )
.ifc \ txfm1 \ ( ) _ \ t x f m 2 ,i d c t _ i d c t
@ -812,6 +928,116 @@ itxfm_func16x16 iadst, idct
itxfm_ f u n c16 x16 i d c t , i a d s t
itxfm_ f u n c16 x16 i a d s t , i a d s t
function i d c t 1 6 _ 1 d _ 8 x16 _ p a s s1 _ q u a r t e r _ n e o n
mov x14 , x30
movi v2 . 8 h , #0
.irp i, 1 6 , 1 7 , 1 8 , 1 9
load_ c l e a r \ i , x2 , x9
.endr
bl i d c t 1 6 _ q u a r t e r
/ / Do t w o 8 x8 t r a n s p o s e s . O r i g i n a l l y , v16 - v31 c o n t a i n t h e
/ / 1 6 rows. A f t e r w a r d s , v16 - v23 a n d v24 - v31 c o n t a i n t h e t w o
/ / transposed 8 x8 b l o c k s .
transpose_ 8 x8 H v16 , v17 , v18 , v19 , v20 , v21 , v22 , v23 , v2 , v3
transpose_ 8 x8 H v24 , v25 , v26 , v27 , v28 , v29 , v30 , v31 , v2 , v3
/ / Store t h e t r a n s p o s e d 8 x8 b l o c k s h o r i z o n t a l l y .
/ / The f i r s t 8 x8 b l o c k i s k e p t i n r e g i s t e r s f o r t h e s e c o n d p a s s ,
/ / store t h e r e s t i n t h e t e m p b u f f e r .
/ / Since o n l y a 4 x4 p a r t o f t h e i n p u t w a s n o n z e r o , t h i s m e a n s t h a t
/ / only 4 r o w s a r e n o n z e r o a f t e r t r a n s p o s i n g , a n d t h e s e c o n d p a s s
/ / only r e a d s t h e t o p m o s t 4 r o w s . T h e r e f o r e o n l y s t o r e t h e t o p m o s t
/ / 4 rows.
add x0 , x0 , #16
.irp i, 2 4 , 2 5 , 2 6 , 2 7
store \ i , x0 , x9
.endr
br x14
endfunc
function i d c t 1 6 _ 1 d _ 8 x16 _ p a s s2 _ q u a r t e r _ n e o n
mov x14 , x30
cbz x3 , 1 f
.irp i, 1 6 , 1 7 , 1 8 , 1 9
load \ i , x2 , x9
.endr
1 :
add x3 , x0 , x1
lsl x1 , x1 , #1
bl i d c t 1 6 _ q u a r t e r
load_ a d d _ s t o r e v16 . 8 h , v17 . 8 h , v18 . 8 h , v19 . 8 h , v20 . 8 h , v21 . 8 h , v22 . 8 h , v23 . 8 h , v16 . 8 b , v17 . 8 b
load_ a d d _ s t o r e v24 . 8 h , v25 . 8 h , v26 . 8 h , v27 . 8 h , v28 . 8 h , v29 . 8 h , v30 . 8 h , v31 . 8 h , v16 . 8 b , v17 . 8 b
br x14
endfunc
function i d c t 1 6 _ 1 d _ 8 x16 _ p a s s1 _ h a l f _ n e o n
mov x14 , x30
movi v2 . 8 h , #0
.irp i, 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3
load_ c l e a r \ i , x2 , x9
.endr
bl i d c t 1 6 _ h a l f
/ / Do t w o 8 x8 t r a n s p o s e s . O r i g i n a l l y , v16 - v31 c o n t a i n t h e
/ / 1 6 rows. A f t e r w a r d s , v16 - v23 a n d v24 - v31 c o n t a i n t h e t w o
/ / transposed 8 x8 b l o c k s .
transpose_ 8 x8 H v16 , v17 , v18 , v19 , v20 , v21 , v22 , v23 , v2 , v3
transpose_ 8 x8 H v24 , v25 , v26 , v27 , v28 , v29 , v30 , v31 , v2 , v3
/ / Store t h e t r a n s p o s e d 8 x8 b l o c k s h o r i z o n t a l l y .
/ / The f i r s t 8 x8 b l o c k i s k e p t i n r e g i s t e r s f o r t h e s e c o n d p a s s ,
/ / store t h e r e s t i n t h e t e m p b u f f e r .
add x0 , x0 , #16
.irp i, 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1
store \ i , x0 , x9
.endr
br x14
endfunc
function i d c t 1 6 _ 1 d _ 8 x16 _ p a s s2 _ h a l f _ n e o n
mov x14 , x30
cbz x3 , 1 f
.irp i, 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3
load \ i , x2 , x9
.endr
1 :
add x3 , x0 , x1
lsl x1 , x1 , #1
bl i d c t 1 6 _ h a l f
load_ a d d _ s t o r e v16 . 8 h , v17 . 8 h , v18 . 8 h , v19 . 8 h , v20 . 8 h , v21 . 8 h , v22 . 8 h , v23 . 8 h , v16 . 8 b , v17 . 8 b
load_ a d d _ s t o r e v24 . 8 h , v25 . 8 h , v26 . 8 h , v27 . 8 h , v28 . 8 h , v29 . 8 h , v30 . 8 h , v31 . 8 h , v16 . 8 b , v17 . 8 b
br x14
endfunc
.macro idct16_partial size
function i d c t 1 6 x16 _ \ s i z e \ ( ) _ a d d _ n e o n
add x0 , s p , #( 0 * 3 2 )
add x2 , x6 , #( 0 * 2 )
bl i d c t 1 6 _ 1 d _ 8 x16 _ p a s s1 _ \ s i z e \ ( ) _ n e o n
.irp i, 0 , 8
add x0 , x4 , #( \ i )
mov x1 , x5
add x2 , s p , #( \ i * 2 )
mov x3 , #\ i
bl i d c t 1 6 _ 1 d _ 8 x16 _ p a s s2 _ \ s i z e \ ( ) _ n e o n
.endr
add s p , s p , #512
br x15
endfunc
.endm
idct1 6 _ p a r t i a l q u a r t e r
idct1 6 _ p a r t i a l h a l f
function i d c t 3 2 x32 _ d c _ a d d _ n e o n
movrel x4 , i d c t _ c o e f f s
@ -848,6 +1074,37 @@ function idct32x32_dc_add_neon
ret
endfunc
.macro idct32_end
butterfly_ 8 h v16 , v5 , v4 , v5 / / v16 = t 1 6 a , v5 = t 1 9 a
butterfly_ 8 h v17 , v20 , v23 , v20 / / v17 = t 1 7 , v20 = t 1 8
butterfly_ 8 h v18 , v6 , v7 , v6 / / v18 = t 2 3 a , v6 = t 2 0 a
butterfly_ 8 h v19 , v21 , v22 , v21 / / v19 = t 2 2 , v21 = t 2 1
butterfly_ 8 h v4 , v28 , v28 , v30 / / v4 = t 2 4 a , v28 = t 2 7 a
butterfly_ 8 h v23 , v26 , v25 , v26 / / v23 = t 2 5 , v26 = t 2 6
butterfly_ 8 h v7 , v3 , v29 , v31 / / v7 = t 3 1 a , v3 = t 2 8 a
butterfly_ 8 h v22 , v27 , v24 , v27 / / v22 = t 3 0 , v27 = t 2 9
dmbutterfly v27 , v20 , v0 . h [ 1 ] , v0 . h [ 2 ] , v24 , v25 , v30 , v31 / / v27 = t 1 8 a , v20 = t 2 9 a
dmbutterfly v3 , v5 , v0 . h [ 1 ] , v0 . h [ 2 ] , v24 , v25 , v30 , v31 / / v3 = t 1 9 , v5 = t 2 8
dmbutterfly v28 , v6 , v0 . h [ 1 ] , v0 . h [ 2 ] , v24 , v25 , v30 , v31 , n e g =1 / / v28 = t 2 7 , v6 = t 2 0
dmbutterfly v26 , v21 , v0 . h [ 1 ] , v0 . h [ 2 ] , v24 , v25 , v30 , v31 , n e g =1 / / v26 = t 2 6 a , v21 = t 2 1 a
butterfly_ 8 h v31 , v24 , v7 , v4 / / v31 = t 3 1 , v24 = t 2 4
butterfly_ 8 h v30 , v25 , v22 , v23 / / v30 = t 3 0 a , v25 = t 2 5 a
butterfly_ 8 h _ r v23 , v16 , v16 , v18 / / v23 = t 2 3 , v16 = t 1 6
butterfly_ 8 h _ r v22 , v17 , v17 , v19 / / v22 = t 2 2 a , v17 = t 1 7 a
butterfly_ 8 h v18 , v21 , v27 , v21 / / v18 = t 1 8 , v21 = t 2 1
butterfly_ 8 h _ r v27 , v28 , v5 , v28 / / v27 = t 2 7 a , v28 = t 2 8 a
butterfly_ 8 h v29 , v26 , v20 , v26 / / v29 = t 2 9 , v26 = t 2 6
butterfly_ 8 h v19 , v20 , v3 , v6 / / v19 = t 1 9 a , v20 = t 2 0
dmbutterfly0 v27 , v20 , v27 , v20 , v2 , v3 , v4 , v5 , v6 , v7 / / v27 = t 2 7 , v20 = t 2 0
dmbutterfly0 v26 , v21 , v26 , v21 , v2 , v3 , v4 , v5 , v6 , v7 / / v26 = t 2 6 a , v21 = t 2 1 a
dmbutterfly0 v25 , v22 , v25 , v22 , v2 , v3 , v4 , v5 , v6 , v7 / / v25 = t 2 5 , v22 = t 2 2
dmbutterfly0 v24 , v23 , v24 , v23 , v2 , v3 , v4 , v5 , v6 , v7 / / v24 = t 2 4 a , v23 = t 2 3 a
ret
.endm
function i d c t 3 2 _ o d d
ld1 { v0 . 8 h ,v1 . 8 h } , [ x11 ]
@ -875,37 +1132,88 @@ function idct32_odd
dmbutterfly v27 , v20 , v0 . h [ 3 ] , v0 . h [ 4 ] , v16 , v17 , v18 , v19 , n e g =1 / / v27 = t 2 9 a , v20 = t 1 8 a
dmbutterfly v21 , v26 , v0 . h [ 5 ] , v0 . h [ 6 ] , v16 , v17 , v18 , v19 / / v21 = t 2 1 a , v26 = t 2 6 a
dmbutterfly v25 , v22 , v0 . h [ 5 ] , v0 . h [ 6 ] , v16 , v17 , v18 , v19 , n e g =1 / / v25 = t 2 5 a , v22 = t 2 2 a
idct3 2 _ e n d
endfunc
butterfly_ 8 h v16 , v5 , v4 , v5 / / v16 = t 1 6 a , v5 = t 1 9 a
butterfly_ 8 h v17 , v20 , v23 , v20 / / v17 = t 1 7 , v20 = t 1 8
butterfly_ 8 h v18 , v6 , v7 , v6 / / v18 = t 2 3 a , v6 = t 2 0 a
butterfly_ 8 h v19 , v21 , v22 , v21 / / v19 = t 2 2 , v21 = t 2 1
butterfly_ 8 h v4 , v28 , v28 , v30 / / v4 = t 2 4 a , v28 = t 2 7 a
butterfly_ 8 h v23 , v26 , v25 , v26 / / v23 = t 2 5 , v26 = t 2 6
butterfly_ 8 h v7 , v3 , v29 , v31 / / v7 = t 3 1 a , v3 = t 2 8 a
butterfly_ 8 h v22 , v27 , v24 , v27 / / v22 = t 3 0 , v27 = t 2 9
function i d c t 3 2 _ o d d _ h a l f
ld1 { v0 . 8 h ,v1 . 8 h } , [ x11 ]
dmbutterfly v27 , v20 , v0 . h [ 1 ] , v0 . h [ 2 ] , v24 , v25 , v30 , v31 / / v27 = t 1 8 a , v20 = t 2 9 a
dmbutterfly v3 , v5 , v0 . h [ 1 ] , v0 . h [ 2 ] , v24 , v25 , v30 , v31 / / v3 = t 1 9 , v5 = t 2 8
dmbutterfly v28 , v6 , v0 . h [ 1 ] , v0 . h [ 2 ] , v24 , v25 , v30 , v31 , n e g =1 / / v28 = t 2 7 , v6 = t 2 0
dmbutterfly v26 , v21 , v0 . h [ 1 ] , v0 . h [ 2 ] , v24 , v25 , v30 , v31 , n e g =1 / / v26 = t 2 6 a , v21 = t 2 1 a
dmbutterfly_ h1 v16 , v31 , v0 . h [ 0 ] , v0 . h [ 1 ] , v4 , v5 , v6 , v7 / / v16 = t 1 6 a , v31 = t 3 1 a
dmbutterfly_ h2 v24 , v23 , v0 . h [ 2 ] , v0 . h [ 3 ] , v4 , v5 , v6 , v7 / / v24 = t 1 7 a , v23 = t 3 0 a
dmbutterfly_ h1 v20 , v27 , v0 . h [ 4 ] , v0 . h [ 5 ] , v4 , v5 , v6 , v7 / / v20 = t 1 8 a , v27 = t 2 9 a
dmbutterfly_ h2 v28 , v19 , v0 . h [ 6 ] , v0 . h [ 7 ] , v4 , v5 , v6 , v7 / / v28 = t 1 9 a , v19 = t 2 8 a
dmbutterfly_ h1 v18 , v29 , v1 . h [ 0 ] , v1 . h [ 1 ] , v4 , v5 , v6 , v7 / / v18 = t 2 0 a , v29 = t 2 7 a
dmbutterfly_ h2 v26 , v21 , v1 . h [ 2 ] , v1 . h [ 3 ] , v4 , v5 , v6 , v7 / / v26 = t 2 1 a , v21 = t 2 6 a
dmbutterfly_ h1 v22 , v25 , v1 . h [ 4 ] , v1 . h [ 5 ] , v4 , v5 , v6 , v7 / / v22 = t 2 2 a , v25 = t 2 5 a
dmbutterfly_ h2 v30 , v17 , v1 . h [ 6 ] , v1 . h [ 7 ] , v4 , v5 , v6 , v7 / / v30 = t 2 3 a , v17 = t 2 4 a
butterfly_ 8 h v31 , v24 , v7 , v4 / / v31 = t 3 1 , v24 = t 2 4
butterfly_ 8 h v30 , v25 , v22 , v23 / / v30 = t 3 0 a , v25 = t 2 5 a
butterfly_ 8 h _ r v23 , v16 , v16 , v18 / / v23 = t 2 3 , v16 = t 1 6
butterfly_ 8 h _ r v22 , v17 , v17 , v19 / / v22 = t 2 2 a , v17 = t 1 7 a
butterfly_ 8 h v18 , v21 , v27 , v21 / / v18 = t 1 8 , v21 = t 2 1
butterfly_ 8 h _ r v27 , v28 , v5 , v28 / / v27 = t 2 7 a , v28 = t 2 8 a
butterfly_ 8 h v29 , v26 , v20 , v26 / / v29 = t 2 9 , v26 = t 2 6
butterfly_ 8 h v19 , v20 , v3 , v6 / / v19 = t 1 9 a , v20 = t 2 0
ld1 { v0 . 8 h } , [ x10 ]
dmbutterfly0 v27 , v20 , v27 , v20 , v2 , v3 , v4 , v5 , v6 , v7 / / v27 = t 2 7 , v20 = t 2 0
dmbutterfly0 v26 , v21 , v26 , v21 , v2 , v3 , v4 , v5 , v6 , v7 / / v26 = t 2 6 a , v21 = t 2 1 a
dmbutterfly0 v25 , v22 , v25 , v22 , v2 , v3 , v4 , v5 , v6 , v7 / / v25 = t 2 5 , v22 = t 2 2
dmbutterfly0 v24 , v23 , v24 , v23 , v2 , v3 , v4 , v5 , v6 , v7 / / v24 = t 2 4 a , v23 = t 2 3 a
ret
butterfly_ 8 h v4 , v24 , v16 , v24 / / v4 = t 1 6 , v24 = t 1 7
butterfly_ 8 h v5 , v20 , v28 , v20 / / v5 = t 1 9 , v20 = t 1 8
butterfly_ 8 h v6 , v26 , v18 , v26 / / v6 = t 2 0 , v26 = t 2 1
butterfly_ 8 h v7 , v22 , v30 , v22 / / v7 = t 2 3 , v22 = t 2 2
butterfly_ 8 h v28 , v25 , v17 , v25 / / v28 = t 2 4 , v25 = t 2 5
butterfly_ 8 h v30 , v21 , v29 , v21 / / v30 = t 2 7 , v21 = t 2 6
butterfly_ 8 h v29 , v23 , v31 , v23 / / v29 = t 3 1 , v23 = t 3 0
butterfly_ 8 h v31 , v27 , v19 , v27 / / v31 = t 2 8 , v27 = t 2 9
dmbutterfly v23 , v24 , v0 . h [ 3 ] , v0 . h [ 4 ] , v16 , v17 , v18 , v19 / / v23 = t 1 7 a , v24 = t 3 0 a
dmbutterfly v27 , v20 , v0 . h [ 3 ] , v0 . h [ 4 ] , v16 , v17 , v18 , v19 , n e g =1 / / v27 = t 2 9 a , v20 = t 1 8 a
dmbutterfly v21 , v26 , v0 . h [ 5 ] , v0 . h [ 6 ] , v16 , v17 , v18 , v19 / / v21 = t 2 1 a , v26 = t 2 6 a
dmbutterfly v25 , v22 , v0 . h [ 5 ] , v0 . h [ 6 ] , v16 , v17 , v18 , v19 , n e g =1 / / v25 = t 2 5 a , v22 = t 2 2 a
idct3 2 _ e n d
endfunc
function i d c t 3 2 _ o d d _ q u a r t e r
ld1 { v0 . 8 h ,v1 . 8 h } , [ x11 ]
dsmull_ h v4 , v5 , v16 , v0 . h [ 0 ]
dsmull_ h v28 , v29 , v19 , v0 . h [ 7 ]
dsmull_ h v30 , v31 , v16 , v0 . h [ 1 ]
dsmull_ h v22 , v23 , v17 , v1 . h [ 6 ]
dsmull_ h v7 , v6 , v17 , v1 . h [ 7 ]
dsmull_ h v26 , v27 , v19 , v0 . h [ 6 ]
dsmull_ h v20 , v21 , v18 , v1 . h [ 0 ]
dsmull_ h v24 , v25 , v18 , v1 . h [ 1 ]
ld1 { v0 . 8 h } , [ x10 ]
neg v28 . 4 s , v28 . 4 s
neg v29 . 4 s , v29 . 4 s
neg v7 . 4 s , v7 . 4 s
neg v6 . 4 s , v6 . 4 s
drshrn_ h v4 , v4 , v5 , #14
drshrn_ h v5 , v28 , v29 , #14
drshrn_ h v29 , v30 , v31 , #14
drshrn_ h v28 , v22 , v23 , #14
drshrn_ h v7 , v7 , v6 , #14
drshrn_ h v31 , v26 , v27 , #14
drshrn_ h v6 , v20 , v21 , #14
drshrn_ h v30 , v24 , v25 , #14
dmbutterfly_ l v16 , v17 , v18 , v19 , v29 , v4 , v0 . h [ 3 ] , v0 . h [ 4 ]
dmbutterfly_ l v27 , v26 , v20 , v21 , v31 , v5 , v0 . h [ 3 ] , v0 . h [ 4 ]
drshrn_ h v23 , v16 , v17 , #14
drshrn_ h v24 , v18 , v19 , #14
neg v20 . 4 s , v20 . 4 s
neg v21 . 4 s , v21 . 4 s
drshrn_ h v27 , v27 , v26 , #14
drshrn_ h v20 , v20 , v21 , #14
dmbutterfly_ l v16 , v17 , v18 , v19 , v30 , v6 , v0 . h [ 5 ] , v0 . h [ 6 ]
drshrn_ h v21 , v16 , v17 , #14
drshrn_ h v26 , v18 , v19 , #14
dmbutterfly_ l v16 , v17 , v18 , v19 , v28 , v7 , v0 . h [ 5 ] , v0 . h [ 6 ]
drshrn_ h v25 , v16 , v17 , #14
neg v18 . 4 s , v18 . 4 s
neg v19 . 4 s , v19 . 4 s
drshrn_ h v22 , v18 , v19 , #14
idct3 2 _ e n d
endfunc
.macro idct32_funcs suffix
/ / Do a n 3 2 - p o i n t I D C T o f a 8 x32 s l i c e o u t o f a 3 2 x32 m a t r i x .
/ / The 3 2 - p o i n t I D C T c a n b e d e c o m p o s e d i n t o t w o 1 6 - p o i n t I D C T s ;
/ / a n o r m a l I D C T 1 6 w i t h e v e r y o t h e r i n p u t c o m p o n e n t ( t h e e v e n o n e s , w i t h
@ -917,19 +1225,30 @@ endfunc
/ / x9 = d o u b l e i n p u t s t r i d e
/ / x1 0 = i d c t _ c o e f f s
/ / x1 1 = i d c t _ c o e f f s + 3 2
function i d c t 3 2 _ 1 d _ 8 x32 _ p a s s1 _ n e o n
function i d c t 3 2 _ 1 d _ 8 x32 _ p a s s1 \ s u f f i x \ ( ) _ n e o n
mov x14 , x30
ld1 { v0 . 8 h ,v1 . 8 h } , [ x10 ]
movi v4 . 8 h , #0
movi v2 . 8 h , #0
/ / v1 6 = I N ( 0 ) , v17 = I N ( 2 ) . . . v31 = I N ( 3 0 )
.ifb \ suffix
.irp i, 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1
ld1 { v \ i \ ( ) . 8 h } , [ x2 ]
st1 { v4 . 8 h } , [ x2 ] , x9
load_ c l e a r \ i , x2 , x9
.endr
.endif
.ifc \ suffix,_ q u a r t e r
.irp i, 1 6 , 1 7 , 1 8 , 1 9
load_ c l e a r \ i , x2 , x9
.endr
.endif
.ifc \ suffix,_ h a l f
.irp i, 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3
load_ c l e a r \ i , x2 , x9
.endr
.endif
bl i d c t 1 6
bl i d c t 1 6 \ s u f f i x
/ / Do t w o 8 x8 t r a n s p o s e s . O r i g i n a l l y , v16 - v31 c o n t a i n t h e
/ / 1 6 rows. A f t e r w a r d s , v16 - v23 a n d v24 - v31 c o n t a i n t h e
@ -964,17 +1283,36 @@ function idct32_1d_8x32_pass1_neon
/ / Move x2 b a c k t o t h e s t a r t o f t h e i n p u t , a n d m o v e
/ / to t h e f i r s t o d d r o w
.ifb \ suffix
sub x2 , x2 , x9 , l s l #4
.endif
.ifc \ suffix,_ q u a r t e r
sub x2 , x2 , x9 , l s l #2
.endif
.ifc \ suffix,_ h a l f
sub x2 , x2 , x9 , l s l #3
.endif
add x2 , x2 , #64
movi v4 . 8 h , #0
movi v2 . 8 h , #0
/ / v1 6 = I N ( 1 ) , v17 = I N ( 3 ) . . . v31 = I N ( 3 1 )
.ifb \ suffix
.irp i, 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1
ld1 { v \ i \ ( ) . 8 h } , [ x2 ]
st1 { v4 . 8 h } , [ x2 ] , x9
load_ c l e a r \ i , x2 , x9
.endr
.endif
.ifc \ suffix,_ q u a r t e r
.irp i, 1 6 , 1 7 , 1 8 , 1 9
load_ c l e a r \ i , x2 , x9
.endr
.endif
.ifc \ suffix,_ h a l f
.irp i, 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3
load_ c l e a r \ i , x2 , x9
.endr
.endif
bl i d c t 3 2 _ o d d
bl i d c t 3 2 _ o d d \ s u f f i x
transpose_ 8 x8 H v31 , v30 , v29 , v28 , v27 , v26 , v25 , v24 , v2 , v3
transpose_ 8 x8 H v23 , v22 , v21 , v20 , v19 , v18 , v17 , v16 , v2 , v3
@ -1023,33 +1361,61 @@ endfunc
/ / x9 = d o u b l e t e m p b u f f e r s t r i d e
/ / x1 0 = i d c t _ c o e f f s
/ / x1 1 = i d c t _ c o e f f s + 3 2
function i d c t 3 2 _ 1 d _ 8 x32 _ p a s s2 _ n e o n
function i d c t 3 2 _ 1 d _ 8 x32 _ p a s s2 \ s u f f i x \ ( ) _ n e o n
mov x14 , x30
ld1 { v0 . 8 h ,v1 . 8 h } , [ x10 ]
/ / v1 6 = I N ( 0 ) , v17 = I N ( 2 ) . . . v31 = I N ( 3 0 )
.ifb \ suffix
.irp i, 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1
ld1 { v \ i \ ( ) . 8 h } , [ x2 ] , x9
load \ i , x2 , x9
.endr
sub x2 , x2 , x9 , l s l #4
.endif
.ifc \ suffix,_ q u a r t e r
.irp i, 1 6 , 1 7 , 1 8 , 1 9
load \ i , x2 , x9
.endr
sub x2 , x2 , x9 , l s l #2
.endif
.ifc \ suffix,_ h a l f
.irp i, 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3
load \ i , x2 , x9
.endr
sub x2 , x2 , x9 , l s l #3
.endif
bl i d c t 1 6
bl i d c t 1 6 \ s u f f i x
.irp i, 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1
st1 { v \ i \ ( ) . 8 h } , [ x2 ] , x9
store \ i , x2 , x9
.endr
sub x2 , x2 , x9 , l s l #4
add x2 , x2 , #64
/ / v1 6 = I N ( 1 ) , v17 = I N ( 3 ) . . . v31 = I N ( 3 1 )
.ifb \ suffix
.irp i, 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1
ld1 { v \ i \ ( ) . 8 h } , [ x2 ] , x9
load \ i , x2 , x9
.endr
sub x2 , x2 , x9 , l s l #4
.endif
.ifc \ suffix,_ q u a r t e r
.irp i, 1 6 , 1 7 , 1 8 , 1 9
load \ i , x2 , x9
.endr
sub x2 , x2 , x9 , l s l #2
.endif
.ifc \ suffix,_ h a l f
.irp i, 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3
load \ i , x2 , x9
.endr
sub x2 , x2 , x9 , l s l #3
.endif
sub x2 , x2 , #64
bl i d c t 3 2 _ o d d
bl i d c t 3 2 _ o d d \ s u f f i x
.macro load_acc_store a, b , c , d , n e g =0
.if \ neg = = 0
@ -1105,6 +1471,11 @@ function idct32_1d_8x32_pass2_neon
.purgem load_acc_store
br x14
endfunc
.endm
idct3 2 _ f u n c s
idct3 2 _ f u n c s _ q u a r t e r
idct3 2 _ f u n c s _ h a l f
const m i n _ e o b _ i d c t _ i d c t _ 3 2 , a l i g n =4
.short 0 , 3 4 , 1 3 5 , 3 3 6
@ -1135,6 +1506,11 @@ function ff_vp9_idct_idct_32x32_add_neon, export=1
mov x9 , #128
neg x7 , x9
cmp w3 , #34
b. l e i d c t 3 2 x32 _ q u a r t e r _ a d d _ n e o n
cmp w3 , #135
b. l e i d c t 3 2 x32 _ h a l f _ a d d _ n e o n
.irp i, 0 , 8 , 1 6 , 2 4
add x0 , s p , #( \ i * 64 )
.if \ i > 0
@ -1177,3 +1553,34 @@ function ff_vp9_idct_idct_32x32_add_neon, export=1
br x15
endfunc
.macro idct32_partial size
function i d c t 3 2 x32 _ \ s i z e \ ( ) _ a d d _ n e o n
add x0 , s p , #( 0 * 6 4 )
add x2 , x6 , #( 0 * 2 )
bl i d c t 3 2 _ 1 d _ 8 x32 _ p a s s1 _ \ s i z e \ ( ) _ n e o n
.ifc \ size,h a l f
add x0 , s p , #( 8 * 6 4 )
add x2 , x6 , #( 8 * 2 )
bl i d c t 3 2 _ 1 d _ 8 x32 _ p a s s1 _ \ s i z e \ ( ) _ n e o n
.endif
.irp i, 0 , 8 , 1 6 , 2 4
add x0 , x4 , #( \ i )
mov x1 , x5
add x2 , s p , #( \ i * 2 )
bl i d c t 3 2 _ 1 d _ 8 x32 _ p a s s2 _ \ s i z e \ ( ) _ n e o n
.endr
add s p , s p , #2048
ldp d8 , d9 , [ s p ] , 0 x10
ldp d10 , d11 , [ s p ] , 0 x10
ldp d12 , d13 , [ s p ] , 0 x10
ldp d14 , d15 , [ s p ] , 0 x10
br x15
endfunc
.endm
idct3 2 _ p a r t i a l q u a r t e r
idct3 2 _ p a r t i a l h a l f