FFmpeg
resample_init.c
Go to the documentation of this file.
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 #include <stdint.h>
20 
21 #include "config.h"
22 #include "libavutil/cpu.h"
23 #include "libavutil/aarch64/cpu.h"
24 #include "libavutil/internal.h"
25 #include "libavutil/samplefmt.h"
26 #include "libavresample/resample.h"
27 
28 #include "asm-offsets.h"
29 
30 AV_CHECK_OFFSET(struct ResampleContext, filter_bank, FILTER_BANK);
31 AV_CHECK_OFFSET(struct ResampleContext, filter_length, FILTER_LENGTH);
32 AV_CHECK_OFFSET(struct ResampleContext, phase_shift, PHASE_SHIFT);
33 AV_CHECK_OFFSET(struct ResampleContext, phase_mask, PHASE_MASK);
34 
35 void ff_resample_one_dbl_neon(struct ResampleContext *c, void *dst0,
36  int dst_index, const void *src0,
37  unsigned int index, int frac);
38 void ff_resample_one_flt_neon(struct ResampleContext *c, void *dst0,
39  int dst_index, const void *src0,
40  unsigned int index, int frac);
41 void ff_resample_one_s16_neon(struct ResampleContext *c, void *dst0,
42  int dst_index, const void *src0,
43  unsigned int index, int frac);
44 void ff_resample_one_s32_neon(struct ResampleContext *c, void *dst0,
45  int dst_index, const void *src0,
46  unsigned int index, int frac);
47 
49  enum AVSampleFormat sample_fmt)
50 {
52 
53  if (have_neon(cpu_flags)) {
54  if (!c->linear) {
55  switch (sample_fmt) {
56  case AV_SAMPLE_FMT_DBLP:
58  break;
59  case AV_SAMPLE_FMT_FLTP:
61  break;
62  case AV_SAMPLE_FMT_S16P:
64  break;
65  case AV_SAMPLE_FMT_S32P:
67  break;
68  }
69  }
70  }
71 }
float, planar
Definition: samplefmt.h:69
AV_CHECK_OFFSET(struct ResampleContext, filter_bank, FILTER_BANK)
double, planar
Definition: samplefmt.h:70
static atomic_int cpu_flags
Definition: cpu.c:50
#define FILTER_BANK
Definition: asm-offsets.h:23
void ff_resample_one_s16_neon(struct ResampleContext *c, void *dst0, int dst_index, const void *src0, unsigned int index, int frac)
#define PHASE_MASK
Definition: asm-offsets.h:26
#define av_cold
Definition: attributes.h:88
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
common internal API header
void ff_resample_one_flt_neon(struct ResampleContext *c, void *dst0, int dst_index, const void *src0, unsigned int index, int frac)
#define have_neon(flags)
Definition: cpu.h:26
signed 32 bits, planar
Definition: samplefmt.h:68
void ff_resample_one_s32_neon(struct ResampleContext *c, void *dst0, int dst_index, const void *src0, unsigned int index, int frac)
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
int index
Definition: gxfenc.c:89
#define src0
Definition: h264pred.c:138
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:93
#define FILTER_LENGTH
Definition: asm-offsets.h:24
void ff_resample_one_dbl_neon(struct ResampleContext *c, void *dst0, int dst_index, const void *src0, unsigned int index, int frac)
#define PHASE_SHIFT
Definition: asm-offsets.h:25
void(* resample_one)(struct ResampleContext *c, void *dst0, int dst_index, const void *src0, unsigned int index, int frac)
Definition: resample.h:45
signed 16 bits, planar
Definition: samplefmt.h:67
av_cold void ff_audio_resample_init_aarch64(ResampleContext *c, enum AVSampleFormat sample_fmt)
Definition: resample_init.c:48