History

hevcdsp: fix compilation for arm and aarch64

Also add av_cold to ff_hevcdsp_init_arm.

James Almer committed 11 years ago

Commit d5addf11 parent a251aa15 files · +62 −12Browse files

Unified · Split

5 files
  1. libavcodec/arm/Makefile +1 −0
  2. libavcodec/arm/hevcdsp_arm.h +26 −0
  3. libavcodec/arm/hevcdsp_init_arm.c +32 −0
  4. libavcodec/arm/hevcdsp_init_neon.c +2 −11
  5. libavcodec/hevcdsp.c +1 −1
libavcodec/arm/Makefile+1−0
@@ -37,6 +37,7 @@ OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o · 36 unmodified lines
3737 OBJS-$(CONFIG_FLAC_DECODER) += arm/flacdsp_init_arm.o \
3838 arm/flacdsp_arm.o
3939 OBJS-$(CONFIG_FLAC_ENCODER) += arm/flacdsp_init_arm.o
40+OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_arm.o
4041 OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o
4142 OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_arm.o
4243 OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o
libavcodec/arm/hevcdsp_arm.h+26−0
@@ -0,0 +1,26 @@
1+/*
2+ * This file is part of FFmpeg.
3+ *
4+ * FFmpeg is free software; you can redistribute it and/or
5+ * modify it under the terms of the GNU Lesser General Public
6+ * License as published by the Free Software Foundation; either
7+ * version 2.1 of the License, or (at your option) any later version.
8+ *
9+ * FFmpeg is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ * Lesser General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU Lesser General Public
15+ * License along with FFmpeg; if not, write to the Free Software
16+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+ */
18+
19+#ifndef AVCODEC_ARM_HEVCDSP_ARM_H
20+#define AVCODEC_ARM_HEVCDSP_ARM_H
21+
22+#include "libavcodec/hevcdsp.h"
23+
24+void ff_hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth);
25+
26+#endif /* AVCODEC_ARM_HEVCDSP_ARM_H */
libavcodec/arm/hevcdsp_init_arm.c+32−0
@@ -0,0 +1,32 @@
1+/*
2+ * Copyright (c) 2014 Seppo Tomperi <seppo.tomperi@vtt.fi>
3+ *
4+ * This file is part of FFmpeg.
5+ *
6+ * FFmpeg is free software; you can redistribute it and/or
7+ * modify it under the terms of the GNU Lesser General Public
8+ * License as published by the Free Software Foundation; either
9+ * version 2.1 of the License, or (at your option) any later version.
10+ *
11+ * FFmpeg is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+ * Lesser General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU Lesser General Public
17+ * License along with FFmpeg; if not, write to the Free Software
18+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+ */
20+
21+#include "libavutil/attributes.h"
22+#include "libavutil/arm/cpu.h"
23+#include "libavcodec/hevcdsp.h"
24+#include "hevcdsp_arm.h"
25+
26+av_cold void ff_hevcdsp_init_arm(HEVCDSPContext *c, const int bit_depth)
27+{
28+ int cpu_flags = av_get_cpu_flags();
29+
30+ if (have_neon(cpu_flags))
31+ ff_hevcdsp_init_neon(c, bit_depth);
32+}
libavcodec/arm/hevcdsp_init_neon.c+2−11
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include "libavutil/attributes.h"
2222 #include "libavutil/arm/cpu.h"
2323 #include "libavcodec/hevcdsp.h"
24+#include "hevcdsp_arm.h"
2425
2526 void ff_hevc_v_loop_filter_luma_neon(uint8_t *_pix, ptrdiff_t _stride, int _beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
2627 void ff_hevc_h_loop_filter_luma_neon(uint8_t *_pix, ptrdiff_t _stride, int _beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
@@ -141,9 +142,8 @@ void ff_hevc_put_qpel_bi_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, uint8_t · 114 unmodified lines
141142 put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, src2, MAX_PB_SIZE);
142143 }
143144
144−static av_cold void hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth)
145+av_cold void ff_hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth)
145146 {
146−#if HAVE_NEON
147147 if (bit_depth == 8) {
148148 int x;
149149 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_neon;
@@ -221,13 +221,4 @@ static av_cold void hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth) · 71 unmodified lines
221221 c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_qpel_uw_pixels_w48_neon_8;
222222 c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_qpel_uw_pixels_w64_neon_8;
223223 }
224−#endif // HAVE_NEON
225−}
226−
227−void ff_hevcdsp_init_arm(HEVCDSPContext *c, const int bit_depth)
228−{
229− int cpu_flags = av_get_cpu_flags();
230−
231− if (have_neon(cpu_flags))
232− hevcdsp_init_neon(c, bit_depth);
233224 }
libavcodec/hevcdsp.c+1−1
@@ -259,6 +259,6 @@ int i = 0; · 258 unmodified lines
259259
260260 if (ARCH_X86)
261261 ff_hevc_dsp_init_x86(hevcdsp, bit_depth);
262− if (HAVE_NEON)
262+ if (ARCH_ARM)
263263 ff_hevcdsp_init_arm(hevcdsp, bit_depth);
264264 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t