diff options
author | tetsuo55 <tetsuo55@users.sourceforge.net> | 2010-04-09 01:14:58 +0400 |
---|---|---|
committer | tetsuo55 <tetsuo55@users.sourceforge.net> | 2010-04-09 01:14:58 +0400 |
commit | a9b7bf3fb3e1334d8defd05ca4cfae870b4912e5 (patch) | |
tree | 2dab453d94d5e003379a6cc895eceb84c80e23ec /src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mdct.c | |
parent | aafd49a91f7c2fa9c7103971c16fa6e1b29e8bfd (diff) |
astyle formatting cleanup to make the sourcecode more accessible
switch used: astyle --style=ansi --min-conditional-indent=0 --pad=oper --unpad=paren
http://astyle.sourceforge.net/
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1783 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mdct.c')
-rw-r--r-- | src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mdct.c | 70 |
1 files changed, 39 insertions, 31 deletions
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mdct.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mdct.c index 3bf953134..34357d481 100644 --- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mdct.c +++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mdct.c @@ -33,27 +33,28 @@ #define BESSEL_I0_ITER 50 // default: 50 iterations of Bessel I0 approximation
av_cold void ff_kbd_window_init(float *window, float alpha, int n)
{
- int i, j;
- double sum = 0.0, bessel, tmp;
+ int i, j;
+ double sum = 0.0, bessel, tmp;
#if __STDC_VERSION__ >= 199901L
- double local_window[n];
+ double local_window[n];
#else
- double *local_window = _alloca(n * sizeof(double));
+ double *local_window = _alloca(n * sizeof(double));
#endif
- double alpha2 = (alpha * M_PI / n) * (alpha * M_PI / n);
-
- for (i = 0; i < n; i++) {
- tmp = i * (n - i) * alpha2;
- bessel = 1.0;
- for (j = BESSEL_I0_ITER; j > 0; j--)
- bessel = bessel * tmp / (j * j) + 1;
- sum += bessel;
- local_window[i] = sum;
- }
-
- sum++;
- for (i = 0; i < n; i++)
- window[i] = sqrt(local_window[i] / sum);
+ double alpha2 = (alpha * M_PI / n) * (alpha * M_PI / n);
+
+ for(i = 0; i < n; i++)
+ {
+ tmp = i * (n - i) * alpha2;
+ bessel = 1.0;
+ for(j = BESSEL_I0_ITER; j > 0; j--)
+ bessel = bessel * tmp / (j * j) + 1;
+ sum += bessel;
+ local_window[i] = sum;
+ }
+
+ sum++;
+ for(i = 0; i < n; i++)
+ window[i] = sqrt(local_window[i] / sum);
}
//#include "mdct_tablegen.h"
@@ -74,14 +75,15 @@ av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale) n4 = n >> 2;
s->permutation = FF_MDCT_PERM_NONE;
- if (ff_fft_init(s, s->mdct_bits - 2, inverse) < 0)
+ if(ff_fft_init(s, s->mdct_bits - 2, inverse) < 0)
goto fail;
- s->tcos = av_malloc(n/2 * sizeof(FFTSample));
- if (!s->tcos)
+ s->tcos = av_malloc(n / 2 * sizeof(FFTSample));
+ if(!s->tcos)
goto fail;
- switch (s->permutation) {
+ switch(s->permutation)
+ {
case FF_MDCT_PERM_NONE:
s->tsin = s->tcos + n4;
tstep = 1;
@@ -96,13 +98,14 @@ av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale) theta = 1.0 / 8.0 + (scale < 0 ? n4 : 0);
scale = sqrt(fabs(scale));
- for(i=0;i<n4;i++) {
+ for(i = 0; i < n4; i++)
+ {
alpha = 2 * M_PI * (i + theta) / n;
s->tcos[i*tstep] = -cos(alpha) * scale;
s->tsin[i*tstep] = -sin(alpha) * scale;
}
return 0;
- fail:
+fail:
ff_mdct_end(s);
return -1;
}
@@ -141,8 +144,9 @@ void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input) /* pre rotation */
in1 = input;
in2 = input + n2 - 1;
- for(k = 0; k < n4; k++) {
- j=revtab[k];
+ for(k = 0; k < n4; k++)
+ {
+ j = revtab[k];
CMUL(z[j].re, z[j].im, *in2, *in1, tcos[k], tsin[k]);
in1 += 2;
in2 -= 2;
@@ -150,7 +154,8 @@ void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input) ff_fft_calc(s, z);
/* post rotation + reordering */
- for(k = 0; k < n8; k++) {
+ for(k = 0; k < n8; k++)
+ {
FFTSample r0, i0, r1, i1;
CMUL(r0, i1, z[n8-k-1].im, z[n8-k-1].re, tsin[n8-k-1], tcos[n8-k-1]);
CMUL(r1, i0, z[n8+k ].im, z[n8+k ].re, tsin[n8+k ], tcos[n8+k ]);
@@ -173,9 +178,10 @@ void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input) int n2 = n >> 1;
int n4 = n >> 2;
- ff_imdct_half_c(s, output+n4, input);
+ ff_imdct_half_c(s, output + n4, input);
- for(k = 0; k < n4; k++) {
+ for(k = 0; k < n4; k++)
+ {
output[k] = -output[n2-k-1];
output[n-k-1] = output[n2+k];
}
@@ -202,7 +208,8 @@ void ff_mdct_calc_c(FFTContext *s, FFTSample *out, const FFTSample *input) n3 = 3 * n4;
/* pre rotation */
- for(i=0;i<n8;i++) {
+ for(i = 0; i < n8; i++)
+ {
re = -input[2*i+3*n4] - input[n3-1-2*i];
im = -input[n4+2*i] + input[n4-1-2*i];
j = revtab[i];
@@ -217,7 +224,8 @@ void ff_mdct_calc_c(FFTContext *s, FFTSample *out, const FFTSample *input) ff_fft_calc(s, x);
/* post rotation */
- for(i=0;i<n8;i++) {
+ for(i = 0; i < n8; i++)
+ {
FFTSample r0, i0, r1, i1;
CMUL(i1, r0, x[n8-i-1].re, x[n8-i-1].im, -tsin[n8-i-1], -tcos[n8-i-1]);
CMUL(i0, r1, x[n8+i ].re, x[n8+i ].im, -tsin[n8+i ], -tcos[n8+i ]);
|