Browse code

hevcdsp: fix compilation for arm and aarch64

Also add av_cold to ff_hevcdsp_init_arm.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d5addf1555024aebf13b37fbca9fb8d0f4f656ca)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

James Almer authored on 2015/03/13 03:35:05
Showing 5 changed files
... ...
@@ -37,6 +37,7 @@ OBJS-$(CONFIG_DCA_DECODER)             += arm/dcadsp_init_arm.o
37 37
 OBJS-$(CONFIG_FLAC_DECODER)            += arm/flacdsp_init_arm.o        \
38 38
                                           arm/flacdsp_arm.o
39 39
 OBJS-$(CONFIG_FLAC_ENCODER)            += arm/flacdsp_init_arm.o
40
+OBJS-$(CONFIG_HEVC_DECODER)            += arm/hevcdsp_init_arm.o
40 41
 OBJS-$(CONFIG_MLP_DECODER)             += arm/mlpdsp_init_arm.o
41 42
 OBJS-$(CONFIG_VC1_DECODER)             += arm/vc1dsp_init_arm.o
42 43
 OBJS-$(CONFIG_VORBIS_DECODER)          += arm/vorbisdsp_init_arm.o
43 44
new file mode 100644
... ...
@@ -0,0 +1,26 @@
0
+/*
1
+ * This file is part of FFmpeg.
2
+ *
3
+ * FFmpeg is free software; you can redistribute it and/or
4
+ * modify it under the terms of the GNU Lesser General Public
5
+ * License as published by the Free Software Foundation; either
6
+ * version 2.1 of the License, or (at your option) any later version.
7
+ *
8
+ * FFmpeg is distributed in the hope that it will be useful,
9
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11
+ * Lesser General Public License for more details.
12
+ *
13
+ * You should have received a copy of the GNU Lesser General Public
14
+ * License along with FFmpeg; if not, write to the Free Software
15
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+ */
17
+
18
+#ifndef AVCODEC_ARM_HEVCDSP_ARM_H
19
+#define AVCODEC_ARM_HEVCDSP_ARM_H
20
+
21
+#include "libavcodec/hevcdsp.h"
22
+
23
+void ff_hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth);
24
+
25
+#endif /* AVCODEC_ARM_HEVCDSP_ARM_H */
0 26
new file mode 100644
... ...
@@ -0,0 +1,32 @@
0
+/*
1
+ * Copyright (c) 2014 Seppo Tomperi <seppo.tomperi@vtt.fi>
2
+ *
3
+ * This file is part of FFmpeg.
4
+ *
5
+ * FFmpeg is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * FFmpeg is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with FFmpeg; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+ */
19
+
20
+#include "libavutil/attributes.h"
21
+#include "libavutil/arm/cpu.h"
22
+#include "libavcodec/hevcdsp.h"
23
+#include "hevcdsp_arm.h"
24
+
25
+av_cold void ff_hevcdsp_init_arm(HEVCDSPContext *c, const int bit_depth)
26
+{
27
+    int cpu_flags = av_get_cpu_flags();
28
+
29
+    if (have_neon(cpu_flags))
30
+        ff_hevcdsp_init_neon(c, bit_depth);
31
+}
... ...
@@ -21,6 +21,7 @@
21 21
 #include "libavutil/attributes.h"
22 22
 #include "libavutil/arm/cpu.h"
23 23
 #include "libavcodec/hevcdsp.h"
24
+#include "hevcdsp_arm.h"
24 25
 
25 26
 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);
26 27
 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
141 141
     put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, src2, MAX_PB_SIZE);
142 142
 }
143 143
 
144
-static av_cold void hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth)
144
+av_cold void ff_hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth)
145 145
 {
146
-#if HAVE_NEON
147 146
     if (bit_depth == 8) {
148 147
         int x;
149 148
         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)
221 221
         c->put_hevc_qpel_uni[8][0][0]  = ff_hevc_put_qpel_uw_pixels_w48_neon_8;
222 222
         c->put_hevc_qpel_uni[9][0][0]  = ff_hevc_put_qpel_uw_pixels_w64_neon_8;
223 223
     }
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);
233 224
 }
... ...
@@ -259,6 +259,6 @@ int i = 0;
259 259
 
260 260
     if (ARCH_X86)
261 261
         ff_hevc_dsp_init_x86(hevcdsp, bit_depth);
262
-    if (HAVE_NEON)
262
+    if (ARCH_ARM)
263 263
         ff_hevcdsp_init_arm(hevcdsp, bit_depth);
264 264
 }