fft-internal.h
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 #ifndef AVCODEC_FFT_INTERNAL_H
20 #define AVCODEC_FFT_INTERNAL_H
21 
22 #if CONFIG_FFT_FLOAT
23 
24 #define FIX15(v) (v)
25 #define sqrthalf (float)M_SQRT1_2
26 
27 #define BF(x, y, a, b) do { \
28  x = a - b; \
29  y = a + b; \
30  } while (0)
31 
32 #define CMUL(dre, dim, are, aim, bre, bim) do { \
33  (dre) = (are) * (bre) - (aim) * (bim); \
34  (dim) = (are) * (bim) + (aim) * (bre); \
35  } while (0)
36 
37 #else
38 
39 #include "fft.h"
40 #include "mathops.h"
41 
43 
44 #define SCALE_FLOAT(a, bits) lrint((a) * (double)(1 << (bits)))
45 #define FIX15(a) av_clip(SCALE_FLOAT(a, 15), -32767, 32767)
46 
47 #define sqrthalf ((int16_t)((1<<15)*M_SQRT1_2))
48 
49 #define BF(x, y, a, b) do { \
50  x = (a - b) >> 1; \
51  y = (a + b) >> 1; \
52  } while (0)
53 
54 #define CMULS(dre, dim, are, aim, bre, bim, sh) do { \
55  (dre) = (MUL16(are, bre) - MUL16(aim, bim)) >> sh; \
56  (dim) = (MUL16(are, bim) + MUL16(aim, bre)) >> sh; \
57  } while (0)
58 
59 #define CMUL(dre, dim, are, aim, bre, bim) \
60  CMULS(dre, dim, are, aim, bre, bim, 15)
61 
62 #define CMULL(dre, dim, are, aim, bre, bim) \
63  CMULS(dre, dim, are, aim, bre, bim, 0)
64 
65 #endif /* CONFIG_FFT_FLOAT */
66 
67 #define ff_imdct_calc_c FFT_NAME(ff_imdct_calc_c)
68 #define ff_imdct_half_c FFT_NAME(ff_imdct_half_c)
69 #define ff_mdct_calc_c FFT_NAME(ff_mdct_calc_c)
70 
74 
75 #endif /* AVCODEC_FFT_INTERNAL_H */
float FFTDouble
Definition: fft.h:39
const char * s
Definition: avisynth_c.h:668
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an input
float FFTSample
Definition: avfft.h:35
Definition: fft.h:62
#define ff_imdct_half_c
Definition: fft-internal.h:68
#define ff_imdct_calc_c
Definition: fft-internal.h:67
void ff_mdct_calcw_c(FFTContext *s, FFTDouble *output, const FFTSample *input)
Definition: mdct_fixed.c:23
these buffered frames must be flushed immediately if a new input produces new output(Example:frame rate-doubling filter:filter_frame must(1) flush the second copy of the previous frame, if it is still there,(2) push the first copy of the incoming frame,(3) keep the second copy for later.) If the input frame is not enough to produce output
#define ff_mdct_calc_c
Definition: fft-internal.h:69