/* The guts header contains all the multiplication and addition macros that are defined for complexnumbers.Italsodeclaresthekf_internalfunctions.
*/
staticvoid kf_bfly2(
kiss_fft_cpx * Fout, int m, int N
)
{
kiss_fft_cpx * Fout2; int i;
(void)m; #ifdef CUSTOM_MODES if (m==1)
{
celt_assert(m==1); for (i=0;i<N;i++)
{
kiss_fft_cpx t;
Fout2 = Fout + 1;
t = *Fout2;
C_SUB( *Fout2 , *Fout , t );
C_ADDTO( *Fout , t );
Fout += 2;
}
} else #endif
{
celt_coef tw;
tw = QCONST32(0.7071067812f, COEF_SHIFT-1); /* We know that m==4 here because the radix-2 is just after a radix-4 */
celt_assert(m==4); for (i=0;i<N;i++)
{
kiss_fft_cpx t;
Fout2 = Fout + 4;
t = Fout2[0];
C_SUB( Fout2[0] , Fout[0] , t );
C_ADDTO( Fout[0] , t );
staticvoid kf_bfly3(
kiss_fft_cpx * Fout, const size_t fstride, const kiss_fft_state *st, int m, int N, int mm
)
{ int i;
size_t k; const size_t m2 = 2*m; const kiss_twiddle_cpx *tw1,*tw2;
kiss_fft_cpx scratch[5];
kiss_twiddle_cpx epi3;
kiss_fft_cpx * Fout_beg = Fout; #ifdef FIXED_POINT /*epi3.r = -16384;*/ /* Unused */
epi3.i = -QCONST32(0.86602540f, COEF_SHIFT-1); #else
epi3 = st->twiddles[fstride*m]; #endif for (i=0;i<N;i++)
{
Fout = Fout_beg + i*mm;
tw1=tw2=st->twiddles; /* For non-custom modes, m is guaranteed to be a multiple of 4. */
k=m; do {
#ifndef OVERRIDE_kf_bfly5 staticvoid kf_bfly5(
kiss_fft_cpx * Fout, const size_t fstride, const kiss_fft_state *st, int m, int N, int mm
)
{
kiss_fft_cpx *Fout0,*Fout1,*Fout2,*Fout3,*Fout4; int i, u;
kiss_fft_cpx scratch[13]; const kiss_twiddle_cpx *tw;
kiss_twiddle_cpx ya,yb;
kiss_fft_cpx * Fout_beg = Fout;
/*printf ("fft %d %d %d %d %d %d\n", p*m, m, p, s2, fstride*in_stride, N);*/ if (m==1)
{ int j; for (j=0;j<p;j++)
{
*f = Fout+j;
f += fstride*in_stride;
}
} else { int j; for (j=0;j<p;j++)
{
compute_bitrev_table( Fout , f, fstride*p, in_stride, factors,st);
f += fstride*in_stride;
Fout += m;
}
}
}
/* facbuf is populated by p1,m1,p2,m2, ... where p[i]*m[i]=m[i-1]
m0 = n */ static int kf_factor(int n,opus_int16 * facbuf)
{ int p=4; int i; int stages=0; int nbak = n;
/*factor out powers of 4, powers of 2, then any remaining primes */ do { while (n % p) { switch (p) { case4: p = 2; break; case2: p = 3; break; default: p += 2; break;
} if (p>32000 || (opus_int32)p*(opus_int32)p > n)
p = n; /* no more factors, skip to end */
}
n /= p; #ifdef RADIX_TWO_ONLY if (p!=2 && p != 4) #else if (p>5) #endif
{ return0;
}
facbuf[2*stages] = p; if (p==2 && stages > 1)
{
facbuf[2*stages] = 4;
facbuf[2] = 2;
}
stages++;
} while (n > 1);
n = nbak; /* Reverse the order to get the radix 4 at the end, so we can use the fastdegeneratecase.Itturnsoutthatreversingtheorderalso
improves the noise behaviour. */ for (i=0;i<stages/2;i++)
{ int tmp;
tmp = facbuf[2*i];
facbuf[2*i] = facbuf[2*(stages-i-1)];
facbuf[2*(stages-i-1)] = tmp;
} for (i=0;i<stages;i++)
{
n /= facbuf[2*i];
facbuf[2*i+1] = n;
} return1;
}
void opus_fft_free(const kiss_fft_state *cfg, int arch)
{ if (cfg)
{
opus_fft_free_arch((kiss_fft_state *)cfg, arch);
opus_free((opus_int16*)cfg->bitrev); if (cfg->shift < 0)
opus_free((kiss_twiddle_cpx*)cfg->twiddles);
opus_free((kiss_fft_state*)cfg);
}
}
#endif/* CUSTOM_MODES */
#ifdef FIXED_POINT #ifndef OVERRIDE_fft_downshift staticvoid fft_downshift(kiss_fft_cpx *x, int N, int *total, int step) { int shift;
shift = IMIN(step, *total);
*total -= shift; if (shift == 1) { int i; for (i=0;i<N;i++) {
x[i].r = SHR32(x[i].r, 1);
x[i].i = SHR32(x[i].i, 1);
}
} elseif (shift>0) { int i; for (i=0;i<N;i++) {
x[i].r = PSHR32(x[i].r, shift);
x[i].i = PSHR32(x[i].i, shift);
}
}
} #endif/* OVERRIDE_fft_downshift */ #else #define fft_downshift(x, N, total, step) #endif
void opus_fft_impl(const kiss_fft_state *st,kiss_fft_cpx *fout ARG_FIXED(int downshift))
{ int m2, m; int p; int L; int fstride[MAXFACTORS]; int i; int shift;
/* st->shift can be -1 */
shift = st->shift>0 ? st->shift : 0;
void opus_fft_c(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)
{ int i;
celt_coef scale; #ifdef FIXED_POINT /* Allows us to scale with MULT16_32_Q16(), which is faster than
MULT16_32_Q15() on ARM. */ int scale_shift = st->scale_shift-1; #endif
scale = st->scale;
celt_assert2 (fin != fout, "In-place FFT not supported"); /* Bit-reverse the input */ for (i=0;i<st->nfft;i++)
{
kiss_fft_cpx x = fin[i];
fout[st->bitrev[i]].r = S_MUL2(x.r, scale);
fout[st->bitrev[i]].i = S_MUL2(x.i, scale);
}
opus_fft_impl(st, fout ARG_FIXED(scale_shift));
}
void opus_ifft_c(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)
{ int i;
celt_assert2 (fin != fout, "In-place FFT not supported"); /* Bit-reverse the input */ for (i=0;i<st->nfft;i++)
fout[st->bitrev[i]] = fin[i]; for (i=0;i<st->nfft;i++)
fout[i].i = -fout[i].i;
opus_fft_impl(st, fout ARG_FIXED(0)); for (i=0;i<st->nfft;i++)
fout[i].i = -fout[i].i;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.