2 * Copyright (c) 2020 Reimar Döffinger
4 * This file is part of FFmpeg.
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.
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.
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
23 #include "libavutil/attributes.h"
24 #include "libavutil/cpu.h"
25 #include "libavutil/aarch64/cpu.h"
26 #include "libavcodec/hevcdsp.h"
28 void ff_hevc_add_residual_4x4_8_neon(uint8_t *_dst, int16_t *coeffs,
30 void ff_hevc_add_residual_4x4_10_neon(uint8_t *_dst, int16_t *coeffs,
32 void ff_hevc_add_residual_8x8_8_neon(uint8_t *_dst, int16_t *coeffs,
34 void ff_hevc_add_residual_8x8_10_neon(uint8_t *_dst, int16_t *coeffs,
36 void ff_hevc_add_residual_16x16_8_neon(uint8_t *_dst, int16_t *coeffs,
38 void ff_hevc_add_residual_16x16_10_neon(uint8_t *_dst, int16_t *coeffs,
40 void ff_hevc_add_residual_32x32_8_neon(uint8_t *_dst, int16_t *coeffs,
42 void ff_hevc_add_residual_32x32_10_neon(uint8_t *_dst, int16_t *coeffs,
44 void ff_hevc_idct_8x8_8_neon(int16_t *coeffs, int col_limit);
45 void ff_hevc_idct_8x8_10_neon(int16_t *coeffs, int col_limit);
46 void ff_hevc_idct_16x16_8_neon(int16_t *coeffs, int col_limit);
47 void ff_hevc_idct_16x16_10_neon(int16_t *coeffs, int col_limit);
49 av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth)
51 if (!have_neon(av_get_cpu_flags())) return;
54 c->add_residual[0] = ff_hevc_add_residual_4x4_8_neon;
55 c->add_residual[1] = ff_hevc_add_residual_8x8_8_neon;
56 c->add_residual[2] = ff_hevc_add_residual_16x16_8_neon;
57 c->add_residual[3] = ff_hevc_add_residual_32x32_8_neon;
58 c->idct[1] = ff_hevc_idct_8x8_8_neon;
59 c->idct[2] = ff_hevc_idct_16x16_8_neon;
61 if (bit_depth == 10) {
62 c->add_residual[0] = ff_hevc_add_residual_4x4_10_neon;
63 c->add_residual[1] = ff_hevc_add_residual_8x8_10_neon;
64 c->add_residual[2] = ff_hevc_add_residual_16x16_10_neon;
65 c->add_residual[3] = ff_hevc_add_residual_32x32_10_neon;
66 c->idct[1] = ff_hevc_idct_8x8_10_neon;
67 c->idct[2] = ff_hevc_idct_16x16_10_neon;