MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_rdft_init

Function ff_rdft_init

libavcodec/rdft.c:99–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
100{
101 int n = 1 << nbits;
102 int i;
103 const double theta = (trans == DFT_R2C || trans == DFT_C2R ? -1 : 1)*2*M_PI/n;
104
105 s->nbits = nbits;
106 s->inverse = trans == IDFT_C2R || trans == DFT_C2R;
107 s->sign_convention = trans == IDFT_R2C || trans == DFT_C2R ? 1 : -1;
108
109 if (nbits < 4 || nbits > 16)
110 return -1;
111
112 if (ff_fft_init(&s->fft, nbits-1, trans == IDFT_C2R || trans == IDFT_R2C) < 0)
113 return -1;
114
115 ff_init_ff_cos_tabs(nbits);
116 s->tcos = ff_cos_tabs[nbits];
117 s->tsin = ff_sin_tabs[nbits]+(trans == DFT_R2C || trans == DFT_C2R)*(n>>2);
118#if !CONFIG_HARDCODED_TABLES
119 for (i = 0; i < (n>>2); i++) {
120 s->tsin[i] = sin(i*theta);
121 }
122#endif
123 s->rdft_calc = ff_rdft_calc_c;
124
125 if (ARCH_ARM) ff_rdft_init_arm(s);
126
127 return 0;
128}
129
130av_cold void ff_rdft_end(RDFTContext *s)
131{

Callers 6

ff_dct_initFunction · 0.85
av_rdft_initFunction · 0.85
mainFunction · 0.85
decode_initFunction · 0.85
qdm2_decode_initFunction · 0.85
wmavoice_decode_initFunction · 0.85

Calls 3

ff_fft_initFunction · 0.85
ff_init_ff_cos_tabsFunction · 0.85
ff_rdft_init_armFunction · 0.85

Tested by 1

mainFunction · 0.68