Go to the source code of this file.
|
#define | INIT_FF_COS_TABS_FUNC(index, size) |
|
#define | DECL_FFT5(NAME, D0, D1, D2, D3, D4) |
|
#define | BUTTERFLIES(a0, a1, a2, a3) |
|
#define | BUTTERFLIES_BIG(a0, a1, a2, a3) |
|
#define | TRANSFORM(a0, a1, a2, a3, wre, wim) |
|
#define | TRANSFORM_ZERO(a0, a1, a2, a3) |
|
#define | PASS(name) |
|
#define | BUTTERFLIES BUTTERFLIES_BIG |
|
#define | DECL_FFT(n, n2, n4) |
|
#define | pass pass_big |
|
#define | DECL_COMP_FFT(N) |
|
#define | DECL_COMP_IMDCT(N) |
|
#define | DECL_COMP_MDCT(N) |
|
#define | CHECK_FACTOR(DST, FACTOR, SRC) |
|
|
| COSTABLE (16) |
|
| COSTABLE (32) |
|
| COSTABLE (64) |
|
| COSTABLE (128) |
|
| COSTABLE (256) |
|
| COSTABLE (512) |
|
| COSTABLE (1024) |
|
| COSTABLE (2048) |
|
| COSTABLE (4096) |
|
| COSTABLE (8192) |
|
| COSTABLE (16384) |
|
| COSTABLE (32768) |
|
| COSTABLE (65536) |
|
| COSTABLE (131072) |
|
FFTComplex | TX_NAME (ff_cos_53)[4] |
|
static av_always_inline void | init_cos_tabs_idx (int index) |
|
static av_cold void | ff_init_53_tabs (void) |
|
static av_cold void | init_cos_tabs (int index) |
|
static av_always_inline void | fft3 (FFTComplex *out, FFTComplex *in, ptrdiff_t stride) |
|
static av_always_inline void | fft15 (FFTComplex *out, FFTComplex *in, ptrdiff_t stride) |
|
static void | fft2 (FFTComplex *z) |
|
static void | fft4 (FFTComplex *z) |
|
static void | fft8 (FFTComplex *z) |
|
static void | fft16 (FFTComplex *z) |
|
static void | monolithic_fft (AVTXContext *s, void *_out, void *_in, ptrdiff_t stride) |
|
static void | naive_fft (AVTXContext *s, void *_out, void *_in, ptrdiff_t stride) |
|
static void | monolithic_imdct (AVTXContext *s, void *_dst, void *_src, ptrdiff_t stride) |
|
static void | monolithic_mdct (AVTXContext *s, void *_dst, void *_src, ptrdiff_t stride) |
|
static void | naive_imdct (AVTXContext *s, void *_dst, void *_src, ptrdiff_t stride) |
|
static void | naive_mdct (AVTXContext *s, void *_dst, void *_src, ptrdiff_t stride) |
|
static int | gen_mdct_exptab (AVTXContext *s, int len4, double scale) |
|
int TX_NAME() | ff_tx_init_mdct_fft (AVTXContext *s, av_tx_fn *tx, enum AVTXType type, int inv, int len, const void *scale, uint64_t flags) |
|
◆ INIT_FF_COS_TABS_FUNC
#define INIT_FF_COS_TABS_FUNC |
( |
|
index, |
|
|
|
size |
|
) |
| |
◆ DECL_FFT5
#define DECL_FFT5 |
( |
|
NAME, |
|
|
|
D0, |
|
|
|
D1, |
|
|
|
D2, |
|
|
|
D3, |
|
|
|
D4 |
|
) |
| |
◆ BUTTERFLIES [1/2]
◆ BUTTERFLIES_BIG
#define BUTTERFLIES_BIG |
( |
|
a0, |
|
|
|
a1, |
|
|
|
a2, |
|
|
|
a3 |
|
) |
| |
◆ TRANSFORM
#define TRANSFORM |
( |
|
a0, |
|
|
|
a1, |
|
|
|
a2, |
|
|
|
a3, |
|
|
|
wre, |
|
|
|
wim |
|
) |
| |
◆ TRANSFORM_ZERO
#define TRANSFORM_ZERO |
( |
|
a0, |
|
|
|
a1, |
|
|
|
a2, |
|
|
|
a3 |
|
) |
| |
◆ PASS
Value:
{\
int o1 = 2*n;\
int o2 = 4*n;\
int o3 = 6*n;\
TRANSFORM(z[1],z[o1+1],z[o2+1],z[o3+1],wre[1],wim[-1]);\
do {\
z += 2;\
wre += 2;\
wim -= 2;\
TRANSFORM(z[0],z[o1],z[o2],z[o3],wre[0],wim[0]);\
TRANSFORM(z[1],z[o1+1],z[o2+1],z[o3+1],wre[1],wim[-1]);\
} while(--n);\
}
Definition at line 254 of file tx_template.c.
◆ BUTTERFLIES [2/2]
◆ DECL_FFT
#define DECL_FFT |
( |
|
n, |
|
|
|
n2, |
|
|
|
n4 |
|
) |
| |
Value:
{\
fft##n2(z);\
fft##n4(z+n4*2);\
fft##n4(z+n4*3);\
}
Definition at line 280 of file tx_template.c.
◆ pass
◆ DECL_COMP_FFT
#define DECL_COMP_FFT |
( |
|
N | ) |
|
Value:
void *_in, ptrdiff_t
stride) \
{ \
const
int m =
s->m, *in_map =
s->pfatab, *out_map = in_map +
N*m; \
FFTComplex *
out = _out; \
FFTComplex fft##
N##
in[
N]; \
for (
int i = 0;
i < m;
i++) { \
for (
int j = 0; j <
N; j++) \
fft##
N##
in[j] =
in[in_map[
i*
N + j]]; \
fft##
N(
s->tmp +
s->revtab[
i], fft##
N##
in, m); \
out[
i] =
s->tmp[out_map[
i]]; \
}
Definition at line 362 of file tx_template.c.
◆ DECL_COMP_IMDCT
#define DECL_COMP_IMDCT |
( |
|
N | ) |
|
◆ DECL_COMP_MDCT
#define DECL_COMP_MDCT |
( |
|
N | ) |
|
◆ CHECK_FACTOR
#define CHECK_FACTOR |
( |
|
DST, |
|
|
|
FACTOR, |
|
|
|
SRC |
|
) |
| |
Value: if (
DST == 1 && !(
SRC % FACTOR)) { \
DST = FACTOR; \
SRC /= FACTOR; \
}
◆ COSTABLE() [1/14]
◆ COSTABLE() [2/14]
◆ COSTABLE() [3/14]
◆ COSTABLE() [4/14]
◆ COSTABLE() [5/14]
◆ COSTABLE() [6/14]
◆ COSTABLE() [7/14]
◆ COSTABLE() [8/14]
◆ COSTABLE() [9/14]
◆ COSTABLE() [10/14]
◆ COSTABLE() [11/14]
◆ COSTABLE() [12/14]
◆ COSTABLE() [13/14]
◆ COSTABLE() [14/14]
◆ TX_NAME()
◆ init_cos_tabs_idx()
◆ ff_init_53_tabs()
static av_cold void ff_init_53_tabs |
( |
void |
| ) |
|
|
static |
◆ init_cos_tabs()
◆ fft3()
◆ fft15()
◆ fft2()
◆ fft4()
◆ fft8()
◆ fft16()
◆ monolithic_fft()
static void monolithic_fft |
( |
AVTXContext * |
s, |
|
|
void * |
_out, |
|
|
void * |
_in, |
|
|
ptrdiff_t |
stride |
|
) |
| |
|
static |
◆ naive_fft()
static void naive_fft |
( |
AVTXContext * |
s, |
|
|
void * |
_out, |
|
|
void * |
_in, |
|
|
ptrdiff_t |
stride |
|
) |
| |
|
static |
◆ monolithic_imdct()
static void monolithic_imdct |
( |
AVTXContext * |
s, |
|
|
void * |
_dst, |
|
|
void * |
_src, |
|
|
ptrdiff_t |
stride |
|
) |
| |
|
static |
◆ monolithic_mdct()
static void monolithic_mdct |
( |
AVTXContext * |
s, |
|
|
void * |
_dst, |
|
|
void * |
_src, |
|
|
ptrdiff_t |
stride |
|
) |
| |
|
static |
◆ naive_imdct()
static void naive_imdct |
( |
AVTXContext * |
s, |
|
|
void * |
_dst, |
|
|
void * |
_src, |
|
|
ptrdiff_t |
stride |
|
) |
| |
|
static |
◆ naive_mdct()
static void naive_mdct |
( |
AVTXContext * |
s, |
|
|
void * |
_dst, |
|
|
void * |
_src, |
|
|
ptrdiff_t |
stride |
|
) |
| |
|
static |
◆ gen_mdct_exptab()
◆ ff_tx_init_mdct_fft()
◆ cos_tabs
◆ cos_tabs_init_once
◆ fft_dispatch
Initial value:= {
NULL,
fft2,
fft4,
fft8,
fft16, fft32, fft64, fft128, fft256, fft512,
fft1024, fft2048, fft4096, fft8192, fft16384, fft32768, fft65536, fft131072
}
Definition at line 357 of file tx_template.c.
Referenced by ff_tx_init_mdct_fft(), monolithic_fft(), monolithic_imdct(), and monolithic_mdct().
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in