[FFmpeg-devel] [PATCH 1/2] aarch64/hevc: Move sao to h26x directory

Zhao Zhili quinkblack at foxmail.com
Wed Aug 28 18:21:00 EEST 2024


From: Zhao Zhili <zhilizhao at tencent.com>

So vvc can reuse the implementation.
---
 libavcodec/aarch64/Makefile                   |  2 +-
 libavcodec/aarch64/h26x/dsp.h                 | 36 +++++++++++++++++++
 .../{hevcdsp_sao_neon.S => h26x/sao_neon.S}   |  2 +-
 libavcodec/aarch64/hevcdsp_init_aarch64.c     |  9 +----
 4 files changed, 39 insertions(+), 10 deletions(-)
 create mode 100644 libavcodec/aarch64/h26x/dsp.h
 rename libavcodec/aarch64/{hevcdsp_sao_neon.S => h26x/sao_neon.S} (99%)

diff --git a/libavcodec/aarch64/Makefile b/libavcodec/aarch64/Makefile
index de0653ebbc..a01e665b55 100644
--- a/libavcodec/aarch64/Makefile
+++ b/libavcodec/aarch64/Makefile
@@ -73,4 +73,4 @@ NEON-OBJS-$(CONFIG_HEVC_DECODER)        += aarch64/hevcdsp_deblock_neon.o      \
                                            aarch64/hevcdsp_init_aarch64.o      \
                                            aarch64/hevcdsp_qpel_neon.o         \
                                            aarch64/hevcdsp_epel_neon.o         \
-                                           aarch64/hevcdsp_sao_neon.o
+                                           aarch64/h26x/sao_neon.o
diff --git a/libavcodec/aarch64/h26x/dsp.h b/libavcodec/aarch64/h26x/dsp.h
new file mode 100644
index 0000000000..4dcaf0e6bb
--- /dev/null
+++ b/libavcodec/aarch64/h26x/dsp.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2024 Zhao Zhili
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AARCH64_H26X_DSP_H
+#define AVCODEC_AARCH64_H26X_DSP_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+void ff_hevc_sao_band_filter_8x8_8_neon(uint8_t *_dst, const uint8_t *_src,
+                                        ptrdiff_t stride_dst, ptrdiff_t stride_src,
+                                        const int16_t *sao_offset_val, int sao_left_class,
+                                        int width, int height);
+void ff_hevc_sao_edge_filter_16x16_8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst,
+                                          const int16_t *sao_offset_val, int eo, int width, int height);
+void ff_hevc_sao_edge_filter_8x8_8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst,
+                                        const int16_t *sao_offset_val, int eo, int width, int height);
+
+#endif
diff --git a/libavcodec/aarch64/hevcdsp_sao_neon.S b/libavcodec/aarch64/h26x/sao_neon.S
similarity index 99%
rename from libavcodec/aarch64/hevcdsp_sao_neon.S
rename to libavcodec/aarch64/h26x/sao_neon.S
index 30e83dda5d..dc407484de 100644
--- a/libavcodec/aarch64/hevcdsp_sao_neon.S
+++ b/libavcodec/aarch64/h26x/sao_neon.S
@@ -1,7 +1,7 @@
 /* -*-arm64-*-
  * vim: syntax=arm64asm
  *
- * AArch64 NEON optimised SAO functions for HEVC decoding
+ * AArch64 NEON optimised SAO functions for h26x decoding
  *
  * Copyright (c) 2022 J. Dekker <jdek at itanimul.li>
  *
diff --git a/libavcodec/aarch64/hevcdsp_init_aarch64.c b/libavcodec/aarch64/hevcdsp_init_aarch64.c
index e8c911deb4..7efae0f740 100644
--- a/libavcodec/aarch64/hevcdsp_init_aarch64.c
+++ b/libavcodec/aarch64/hevcdsp_init_aarch64.c
@@ -24,6 +24,7 @@
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
 #include "libavutil/aarch64/cpu.h"
+#include "libavcodec/aarch64/h26x/dsp.h"
 #include "libavcodec/hevc/dsp.h"
 
 void ff_hevc_v_loop_filter_chroma_8_neon(uint8_t *_pix, ptrdiff_t _stride,
@@ -91,14 +92,6 @@ 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);
 void ff_hevc_transform_luma_4x4_neon_8(int16_t *coeffs);
-void ff_hevc_sao_band_filter_8x8_8_neon(uint8_t *_dst, const uint8_t *_src,
-                                  ptrdiff_t stride_dst, ptrdiff_t stride_src,
-                                  const int16_t *sao_offset_val, int sao_left_class,
-                                  int width, int height);
-void ff_hevc_sao_edge_filter_16x16_8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst,
-                                          const int16_t *sao_offset_val, int eo, int width, int height);
-void ff_hevc_sao_edge_filter_8x8_8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst,
-                                        const int16_t *sao_offset_val, int eo, int width, int height);
 void ff_hevc_put_hevc_qpel_h4_8_neon(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height,
                                      intptr_t mx, intptr_t my, int width);
 void ff_hevc_put_hevc_qpel_h6_8_neon(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height,
-- 
2.42.0



More information about the ffmpeg-devel mailing list