summaryrefslogtreecommitdiff
path: root/libavcodec/arm
diff options
context:
space:
mode:
authorSeppo Tomperi <seppo.tomperi@vtt.fi>2017-04-25 19:41:29 +0200
committerMartin Storsjö <martin@martin.st>2017-04-25 22:48:45 +0300
commit358adef0305618219522858e471edf7e0cb4043e (patch)
treeefaf531259164ca3132d0a4e18cf42d58e5f6147 /libavcodec/arm
parentd0ce0634e09403eecaea4283cf82a2c5cea7d1e1 (diff)
hevc: Add NEON IDCT DC functions for bitdepth 8
Signed-off-by: Alexandra Hájková <alexandra@khirnov.net> Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/arm')
-rw-r--r--libavcodec/arm/hevc_idct.S78
-rw-r--r--libavcodec/arm/hevcdsp_init_arm.c10
2 files changed, 88 insertions, 0 deletions
diff --git a/libavcodec/arm/hevc_idct.S b/libavcodec/arm/hevc_idct.S
index 156d4765f0..ceded7a45f 100644
--- a/libavcodec/arm/hevc_idct.S
+++ b/libavcodec/arm/hevc_idct.S
@@ -1,5 +1,7 @@
/*
* ARM NEON optimised IDCT functions for HEVC decoding
+ *
+ * Copyright (c) 2014 Seppo Tomperi <seppo.tomperi@vtt.fi>
* Copyright (c) 2017 Alexandra Hájková
*
* This file is part of Libav.
@@ -28,6 +30,82 @@ const trans, align=4
.short 57, 43, 25, 9
endconst
+function ff_hevc_idct_4x4_dc_8_neon, export=1
+ ldrsh r1, [r0]
+ ldr r2, =0x20
+ add r1, #1
+ asr r1, #1
+ add r1, r2
+ asr r1, #6
+ vdup.16 q0, r1
+ vdup.16 q1, r1
+ vst1.16 {q0, q1}, [r0, :128]
+ bx lr
+endfunc
+
+function ff_hevc_idct_8x8_dc_8_neon, export=1
+ ldrsh r1, [r0]
+ ldr r2, =0x20
+ add r1, #1
+ asr r1, #1
+ add r1, r2
+ asr r1, #6
+ vdup.16 q8, r1
+ vdup.16 q9, r1
+ vmov.16 q10, q8
+ vmov.16 q11, q8
+ vmov.16 q12, q8
+ vmov.16 q13, q8
+ vmov.16 q14, q8
+ vmov.16 q15, q8
+ vstm r0, {q8-q15}
+ bx lr
+endfunc
+
+function ff_hevc_idct_16x16_dc_8_neon, export=1
+ ldrsh r1, [r0]
+ ldr r2, =0x20
+ add r1, #1
+ asr r1, #1
+ add r1, r2
+ asr r1, #6
+ vdup.16 q8, r1
+ vdup.16 q9, r1
+ vmov.16 q10, q8
+ vmov.16 q11, q8
+ vmov.16 q12, q8
+ vmov.16 q13, q8
+ vmov.16 q14, q8
+ vmov.16 q15, q8
+ vstm r0!, {q8-q15}
+ vstm r0!, {q8-q15}
+ vstm r0!, {q8-q15}
+ vstm r0, {q8-q15}
+ bx lr
+endfunc
+
+function ff_hevc_idct_32x32_dc_8_neon, export=1
+ ldrsh r1, [r0]
+ ldr r2, =0x20
+ add r1, #1
+ asr r1, #1
+ add r1, r2
+ asr r1, #6
+ mov r3, #16
+ vdup.16 q8, r1
+ vdup.16 q9, r1
+ vmov.16 q10, q8
+ vmov.16 q11, q8
+ vmov.16 q12, q8
+ vmov.16 q13, q8
+ vmov.16 q14, q8
+ vmov.16 q15, q8
+1: subs r3, #1
+ vstm r0!, {q8-q15}
+ bne 1b
+ bx lr
+endfunc
+
.macro sum_sub out, in, c, op
.ifc \op, +
vmlal.s16 \out, \in, \c
diff --git a/libavcodec/arm/hevcdsp_init_arm.c b/libavcodec/arm/hevcdsp_init_arm.c
index e61587f4e3..fa2e7ad1e1 100644
--- a/libavcodec/arm/hevcdsp_init_arm.c
+++ b/libavcodec/arm/hevcdsp_init_arm.c
@@ -25,6 +25,11 @@
#include "libavcodec/hevcdsp.h"
+void ff_hevc_idct_4x4_dc_8_neon(int16_t *coeffs);
+void ff_hevc_idct_8x8_dc_8_neon(int16_t *coeffs);
+void ff_hevc_idct_16x16_dc_8_neon(int16_t *coeffs);
+void ff_hevc_idct_32x32_dc_8_neon(int16_t *coeffs);
+
void ff_hevc_idct_4x4_8_neon(int16_t *coeffs, int col_limit);
void ff_hevc_idct_8x8_8_neon(int16_t *coeffs, int col_limit);
void ff_hevc_idct_16x16_8_neon(int16_t *coeffs, int col_limit);
@@ -38,6 +43,11 @@ av_cold void ff_hevc_dsp_init_arm(HEVCDSPContext *c, int bit_depth)
if (have_neon(cpu_flags)) {
if (bit_depth == 8) {
+ c->idct_dc[0] = ff_hevc_idct_4x4_dc_8_neon;
+ c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_neon;
+ c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_neon;
+ c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_neon;
+
c->idct[0] = ff_hevc_idct_4x4_8_neon;
c->idct[1] = ff_hevc_idct_8x8_8_neon;
c->idct[2] = ff_hevc_idct_16x16_8_neon;