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>tags/n2.7
| @@ -37,6 +37,7 @@ OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o | |||||
| OBJS-$(CONFIG_FLAC_DECODER) += arm/flacdsp_init_arm.o \ | OBJS-$(CONFIG_FLAC_DECODER) += arm/flacdsp_init_arm.o \ | ||||
| arm/flacdsp_arm.o | arm/flacdsp_arm.o | ||||
| OBJS-$(CONFIG_FLAC_ENCODER) += arm/flacdsp_init_arm.o | OBJS-$(CONFIG_FLAC_ENCODER) += arm/flacdsp_init_arm.o | ||||
| OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_arm.o | |||||
| OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o | OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o | ||||
| OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_arm.o | OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_arm.o | ||||
| OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o | OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o | ||||
| @@ -0,0 +1,26 @@ | |||||
| /* | |||||
| * This file is part of FFmpeg. | |||||
| * | |||||
| * FFmpeg 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. | |||||
| * | |||||
| * FFmpeg 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 FFmpeg; if not, write to the Free Software | |||||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||||
| */ | |||||
| #ifndef AVCODEC_ARM_HEVCDSP_ARM_H | |||||
| #define AVCODEC_ARM_HEVCDSP_ARM_H | |||||
| #include "libavcodec/hevcdsp.h" | |||||
| void ff_hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth); | |||||
| #endif /* AVCODEC_ARM_HEVCDSP_ARM_H */ | |||||
| @@ -0,0 +1,32 @@ | |||||
| /* | |||||
| * Copyright (c) 2014 Seppo Tomperi <seppo.tomperi@vtt.fi> | |||||
| * | |||||
| * This file is part of FFmpeg. | |||||
| * | |||||
| * FFmpeg 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. | |||||
| * | |||||
| * FFmpeg 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 FFmpeg; if not, write to the Free Software | |||||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||||
| */ | |||||
| #include "libavutil/attributes.h" | |||||
| #include "libavutil/arm/cpu.h" | |||||
| #include "libavcodec/hevcdsp.h" | |||||
| #include "hevcdsp_arm.h" | |||||
| av_cold void ff_hevcdsp_init_arm(HEVCDSPContext *c, const int bit_depth) | |||||
| { | |||||
| int cpu_flags = av_get_cpu_flags(); | |||||
| if (have_neon(cpu_flags)) | |||||
| ff_hevcdsp_init_neon(c, bit_depth); | |||||
| } | |||||
| @@ -21,6 +21,7 @@ | |||||
| #include "libavutil/attributes.h" | #include "libavutil/attributes.h" | ||||
| #include "libavutil/arm/cpu.h" | #include "libavutil/arm/cpu.h" | ||||
| #include "libavcodec/hevcdsp.h" | #include "libavcodec/hevcdsp.h" | ||||
| #include "hevcdsp_arm.h" | |||||
| 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); | 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); | ||||
| 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); | 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 | |||||
| put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, src2, MAX_PB_SIZE); | put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, src2, MAX_PB_SIZE); | ||||
| } | } | ||||
| static av_cold void hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth) | |||||
| av_cold void ff_hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth) | |||||
| { | { | ||||
| #if HAVE_NEON | |||||
| if (bit_depth == 8) { | if (bit_depth == 8) { | ||||
| int x; | int x; | ||||
| c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_neon; | 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) | |||||
| c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_qpel_uw_pixels_w48_neon_8; | c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_qpel_uw_pixels_w48_neon_8; | ||||
| c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_qpel_uw_pixels_w64_neon_8; | c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_qpel_uw_pixels_w64_neon_8; | ||||
| } | } | ||||
| #endif // HAVE_NEON | |||||
| } | |||||
| void ff_hevcdsp_init_arm(HEVCDSPContext *c, const int bit_depth) | |||||
| { | |||||
| int cpu_flags = av_get_cpu_flags(); | |||||
| if (have_neon(cpu_flags)) | |||||
| hevcdsp_init_neon(c, bit_depth); | |||||
| } | } | ||||
| @@ -259,6 +259,6 @@ int i = 0; | |||||
| if (ARCH_X86) | if (ARCH_X86) | ||||
| ff_hevc_dsp_init_x86(hevcdsp, bit_depth); | ff_hevc_dsp_init_x86(hevcdsp, bit_depth); | ||||
| if (HAVE_NEON) | |||||
| if (ARCH_ARM) | |||||
| ff_hevcdsp_init_arm(hevcdsp, bit_depth); | ff_hevcdsp_init_arm(hevcdsp, bit_depth); | ||||
| } | } | ||||