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

Showing the changes to libavcodec/arm (4 of 5 files). Show all

Unified · Split

4 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
libavcodec/arm/Makefile+1−0
@@ -37,6 +37,7 @@ OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o · 36 unmodified lines
37OBJS-$(CONFIG_FLAC_DECODER) += arm/flacdsp_init_arm.o \37OBJS-$(CONFIG_FLAC_DECODER) += arm/flacdsp_init_arm.o \
38 arm/flacdsp_arm.o38 arm/flacdsp_arm.o
39OBJS-$(CONFIG_FLAC_ENCODER) += arm/flacdsp_init_arm.o39OBJS-$(CONFIG_FLAC_ENCODER) += arm/flacdsp_init_arm.o
40OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_arm.o
40OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o41OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o
41OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_arm.o42OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_arm.o
42OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o43OBJS-$(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
24void 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
26av_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
21#include "libavutil/attributes.h"21#include "libavutil/attributes.h"
22#include "libavutil/arm/cpu.h"22#include "libavutil/arm/cpu.h"
23#include "libavcodec/hevcdsp.h"23#include "libavcodec/hevcdsp.h"
24#include "hevcdsp_arm.h"
24 25
25void 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);26void 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);
26void 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);27void 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
141 put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, src2, MAX_PB_SIZE);142 put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, src2, MAX_PB_SIZE);
142}143}
143 144
144static av_cold void hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth)145av_cold void ff_hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth)
145{146{
146#if HAVE_NEON
147 if (bit_depth == 8) {147 if (bit_depth == 8) {
148 int x;148 int x;
149 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_neon;149 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
221 c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_qpel_uw_pixels_w48_neon_8;221 c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_qpel_uw_pixels_w48_neon_8;
222 c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_qpel_uw_pixels_w64_neon_8;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
227void 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}

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