On Wed, 15 Jan 2014, Janne Grunau wrote:

Since RV40 and VC-1 use almost the same algorithm so optimizations for
those two decoders are easy to do and included.
---
libavcodec/aarch64/Makefile                  |   5 +
libavcodec/aarch64/h264chroma_init_aarch64.c |  59 ++++
libavcodec/aarch64/h264cmc_neon.S            | 402 +++++++++++++++++++++++++++
libavcodec/aarch64/rv40dsp_init_aarch64.c    |  48 ++++
libavcodec/aarch64/vc1dsp_init_aarch64.c     |  47 ++++
libavcodec/h264chroma.c                      |   2 +
libavcodec/h264chroma.h                      |   1 +
libavcodec/rv34dsp.h                         |   1 +
libavcodec/rv40dsp.c                         |   2 +
libavcodec/vc1dsp.c                          |   2 +
libavcodec/vc1dsp.h                          |   1 +
11 files changed, 570 insertions(+)
create mode 100644 libavcodec/aarch64/Makefile
create mode 100644 libavcodec/aarch64/h264chroma_init_aarch64.c
create mode 100644 libavcodec/aarch64/h264cmc_neon.S
create mode 100644 libavcodec/aarch64/rv40dsp_init_aarch64.c
create mode 100644 libavcodec/aarch64/vc1dsp_init_aarch64.c

diff --git a/libavcodec/aarch64/Makefile b/libavcodec/aarch64/Makefile
new file mode 100644
index 0000000..879e6be
--- /dev/null
+++ b/libavcodec/aarch64/Makefile
@@ -0,0 +1,5 @@
+OBJS-$(CONFIG_H264CHROMA)               += aarch64/h264chroma_init_aarch64.o
+OBJS-$(CONFIG_RV40_DECODER)             += aarch64/rv40dsp_init_aarch64.o
+OBJS-$(CONFIG_VC1_DECODER)              += aarch64/vc1dsp_init_aarch64.o
+
+NEON-OBJS-$(CONFIG_H264CHROMA)          += aarch64/h264cmc_neon.o
diff --git a/libavcodec/aarch64/h264chroma_init_aarch64.c 
b/libavcodec/aarch64/h264chroma_init_aarch64.c
new file mode 100644
index 0000000..1f5b888
--- /dev/null
+++ b/libavcodec/aarch64/h264chroma_init_aarch64.c
@@ -0,0 +1,59 @@
+/*
+ * ARM NEON optimised H.264 chroma functions
+ * Copyright (c) 2008 Mans Rullgard <[email protected]>
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/h264chroma.h"
+
+#include "config.h"
+
+void ff_put_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride,
+                                 int h, int x, int y);
+void ff_put_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride,
+                                 int h, int x, int y);
+void ff_put_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, int stride,
+                                 int h, int x, int y);
+
+void ff_avg_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride,
+                                 int h, int x, int y);
+void ff_avg_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride,
+                                 int h, int x, int y);
+void ff_avg_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, int stride,
+                                 int h, int x, int y);
+
+av_cold void ff_h264chroma_init_aarch64(H264ChromaContext *c, int bit_depth)
+{
+    const int high_bit_depth = bit_depth > 8;
+    int cpu_flags = av_get_cpu_flags();
+
+    if (have_neon_external(cpu_flags) && !high_bit_depth) {

Wouldn't it be more correct or at least consistent with arm (and consistent with how it should behave in the future once there are optional features detected at runtime) to use have_neon instead of have_neon_external?

Other than that it looks good.

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

Reply via email to