]> git.sesse.net Git - ffmpeg/commitdiff
lavc/aarch64: add HEVC idct_dc NEON
authorJosh Dekker <josh@itanimul.li>
Mon, 1 Feb 2021 10:30:52 +0000 (10:30 +0000)
committerJosh Dekker <josh@itanimul.li>
Thu, 18 Feb 2021 13:12:01 +0000 (14:12 +0100)
Signed-off-by: Josh Dekker <josh@itanimul.li>
libavcodec/aarch64/hevcdsp_idct_neon.S
libavcodec/aarch64/hevcdsp_init_aarch64.c

index ef574d243cee5ba50c347f8a74cf1138183914e6..28c11e632c78cbb856510e9c58a52860bb8b96bd 100644 (file)
@@ -5,6 +5,7 @@
  *
  * Ported from arm/hevcdsp_idct_neon.S by
  * Copyright (c) 2020 Reimar Döffinger
+ * Copyright (c) 2020 Josh Dekker
  *
  * This file is part of FFmpeg.
  *
@@ -568,3 +569,53 @@ tr_16x4 secondpass_10, 20 - 10, 512, 1
 
 idct_16x16 8
 idct_16x16 10
+
+// void ff_hevc_idct_NxN_dc_DEPTH_neon(int16_t *coeffs)
+.macro idct_dc size, bitdepth
+function ff_hevc_idct_\size\()x\size\()_dc_\bitdepth\()_neon, export=1
+        movi          v1.8h,  #((1 << (14 - \bitdepth))+1)
+        ld1r         {v4.8h}, [x0]
+        add           v4.8h,  v4.8h,  v1.8h
+        sshr          v0.8h,  v4.8h,  #(15 - \bitdepth)
+        sshr          v1.8h,  v4.8h,  #(15 - \bitdepth)
+.if \size > 4
+        sshr          v2.8h,  v4.8h,  #(15 - \bitdepth)
+        sshr          v3.8h,  v4.8h,  #(15 - \bitdepth)
+.if \size > 16 /* dc 32x32 */
+        mov              x2,  #4
+1:
+        subs             x2,  x2, #1
+.endif
+        add             x12,  x0, #64
+        mov             x13,  #128
+.if \size > 8 /* dc 16x16 */
+        st1            {v0.8h-v3.8h},  [x0], x13
+        st1            {v0.8h-v3.8h}, [x12], x13
+        st1            {v0.8h-v3.8h},  [x0], x13
+        st1            {v0.8h-v3.8h}, [x12], x13
+        st1            {v0.8h-v3.8h},  [x0], x13
+        st1            {v0.8h-v3.8h}, [x12], x13
+.endif /* dc 8x8 */
+        st1            {v0.8h-v3.8h},  [x0], x13
+        st1            {v0.8h-v3.8h}, [x12], x13
+.if \size > 16 /* dc 32x32 */
+        bne             1b
+.endif
+.else /* dc 4x4 */
+        st1            {v0.8h-v1.8h},  [x0]
+.endif
+        ret
+endfunc
+.endm
+
+idct_dc 4, 8
+idct_dc 4, 10
+
+idct_dc 8, 8
+idct_dc 8, 10
+
+idct_dc 16, 8
+idct_dc 16, 10
+
+idct_dc 32, 8
+idct_dc 32, 10
index 4c29daa6d5c177a737beca1dc23bfedd374e3320..fe111bd1ac93fda272d038502805153814b0c748 100644 (file)
@@ -45,6 +45,14 @@ void ff_hevc_idct_8x8_8_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_8_neon(int16_t *coeffs, int col_limit);
 void ff_hevc_idct_16x16_10_neon(int16_t *coeffs, int col_limit);
+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_dc_10_neon(int16_t *coeffs);
+void ff_hevc_idct_8x8_dc_10_neon(int16_t *coeffs);
+void ff_hevc_idct_16x16_dc_10_neon(int16_t *coeffs);
+void ff_hevc_idct_32x32_dc_10_neon(int16_t *coeffs);
 
 av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth)
 {
@@ -57,6 +65,10 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth)
         c->add_residual[3]             = ff_hevc_add_residual_32x32_8_neon;
         c->idct[1]                     = ff_hevc_idct_8x8_8_neon;
         c->idct[2]                     = ff_hevc_idct_16x16_8_neon;
+        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;
     }
     if (bit_depth == 10) {
         c->add_residual[0]             = ff_hevc_add_residual_4x4_10_neon;
@@ -65,5 +77,9 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth)
         c->add_residual[3]             = ff_hevc_add_residual_32x32_10_neon;
         c->idct[1]                     = ff_hevc_idct_8x8_10_neon;
         c->idct[2]                     = ff_hevc_idct_16x16_10_neon;
+        c->idct_dc[0]                  = ff_hevc_idct_4x4_dc_10_neon;
+        c->idct_dc[1]                  = ff_hevc_idct_8x8_dc_10_neon;
+        c->idct_dc[2]                  = ff_hevc_idct_16x16_dc_10_neon;
+        c->idct_dc[3]                  = ff_hevc_idct_32x32_dc_10_neon;
     }
 }