Also add av_cold to ff_hevcdsp_init_arm.
Showing the changes to libavcodec/arm (4 of 5 files). Show all
Unified · Split
| @@ -37,6 +37,7 @@ OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o · 36 unmodified lines | ||
| 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 |
| @@ -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 */ | |
| @@ -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 | +} | |
| @@ -21,6 +21,7 @@ · 20 unmodified lines | ||
| 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 · 114 unmodified lines | ||
| 141 | 142 | put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, src2, MAX_PB_SIZE); |
| 142 | 143 | } |
| 143 | 144 | |
| 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) | |
| 145 | 146 | { |
| 146 | −#if HAVE_NEON | |
| 147 | 147 | if (bit_depth == 8) { |
| 148 | 148 | int x; |
| 149 | 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 | 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 | } |