On Mon, 17 Apr 2017, Alexandra Hájková wrote:

From: Seppo Tomperi <[email protected]>

Signed-off-by: Alexandra Hájková <[email protected]>
---

Indent operands.

libavcodec/arm/hevc_idct.S        | 78 +++++++++++++++++++++++++++++++++++++++
libavcodec/arm/hevcdsp_init_arm.c | 14 +++++--
2 files changed, 89 insertions(+), 3 deletions(-)

diff --git a/libavcodec/arm/hevc_idct.S b/libavcodec/arm/hevc_idct.S
index 156d476..7fdd7cc 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 <[email protected]>
 * 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]

This store could probably be aligned to 128 bits, right?

Other than that, it seems fine and well tuned. I tried to see how it'd behave if the ldrsh/ldr/add/asr were replaced with vld1+vrshr, but it ended up slower on Cortex A7, A8 and A53, only a little faster on A9. So this form probably is good.

It also builds fine in the odd toolchains.

diff --git a/libavcodec/arm/hevcdsp_init_arm.c 
b/libavcodec/arm/hevcdsp_init_arm.c
index e61587f..b65e2e9 100644
--- a/libavcodec/arm/hevcdsp_init_arm.c
+++ b/libavcodec/arm/hevcdsp_init_arm.c
@@ -26,8 +26,12 @@
#include "libavcodec/hevcdsp.h"

void ff_hevc_idct_4x4_8_neon(int16_t *coeffs, int col_limit);
+void ff_hevc_idct_4x4_dc_8_neon(int16_t *coeffs);
void ff_hevc_idct_8x8_8_neon(int16_t *coeffs, int col_limit);
+void ff_hevc_idct_8x8_dc_8_neon(int16_t *coeffs);
void ff_hevc_idct_16x16_8_neon(int16_t *coeffs, int col_limit);
+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_10_neon(int16_t *coeffs, int col_limit);
void ff_hevc_idct_8x8_10_neon(int16_t *coeffs, int col_limit);
void ff_hevc_idct_16x16_10_neon(int16_t *coeffs, int col_limit);
@@ -38,9 +42,13 @@ av_cold void ff_hevc_dsp_init_arm(HEVCDSPContext *c, int 
bit_depth)

    if (have_neon(cpu_flags)) {
        if (bit_depth == 8) {
-            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;
+            c->idct[0]    = ff_hevc_idct_4x4_8_neon;
+            c->idct_dc[0] = ff_hevc_idct_4x4_dc_8_neon;
+            c->idct[1]    = ff_hevc_idct_8x8_8_neon;
+            c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_neon;
+            c->idct[2]    = ff_hevc_idct_16x16_8_neon;
+            c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_neon;
+            c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_neon;
        }
        if (bit_depth == 10) {
            c->idct[0] = ff_hevc_idct_4x4_10_neon;
--
2.10.2

It'd probably nicer to group the idct_dc separately already here, as Diego commented on the other patch.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to