libavcodec/fft-internal.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of FFmpeg.
00003  *
00004  * FFmpeg is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * FFmpeg is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with FFmpeg; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00017  */
00018 
00019 #ifndef AVCODEC_FFT_INTERNAL_H
00020 #define AVCODEC_FFT_INTERNAL_H
00021 
00022 #if CONFIG_FFT_FLOAT
00023 
00024 #define FIX15(v) (v)
00025 #define sqrthalf (float)M_SQRT1_2
00026 
00027 #define BF(x, y, a, b) do { \
00028  x = a - b; \
00029  y = a + b; \
00030  } while (0)
00031 
00032 #define CMUL(dre, dim, are, aim, bre, bim) do { \
00033  (dre) = (are) * (bre) - (aim) * (bim); \
00034  (dim) = (are) * (bim) + (aim) * (bre); \
00035  } while (0)
00036 
00037 #else
00038 
00039 #include "libavutil/intmath.h"
00040 #include "mathops.h"
00041 
00042 void ff_mdct_calcw_c(FFTContext *s, FFTDouble *output, const FFTSample *input);
00043 
00044 #define SCALE_FLOAT(a, bits) lrint((a) * (double)(1 << (bits)))
00045 #define FIX15(a) av_clip(SCALE_FLOAT(a, 15), -32767, 32767)
00046 
00047 #define sqrthalf ((int16_t)((1<<15)*M_SQRT1_2))
00048 
00049 #define BF(x, y, a, b) do { \
00050  x = (a - b) >> 1; \
00051  y = (a + b) >> 1; \
00052  } while (0)
00053 
00054 #define CMULS(dre, dim, are, aim, bre, bim, sh) do { \
00055  (dre) = (MUL16(are, bre) - MUL16(aim, bim)) >> sh; \
00056  (dim) = (MUL16(are, bim) + MUL16(aim, bre)) >> sh; \
00057  } while (0)
00058 
00059 #define CMUL(dre, dim, are, aim, bre, bim) \
00060  CMULS(dre, dim, are, aim, bre, bim, 15)
00061 
00062 #define CMULL(dre, dim, are, aim, bre, bim) \
00063  CMULS(dre, dim, are, aim, bre, bim, 0)
00064 
00065 #endif /* CONFIG_FFT_FLOAT */
00066 
00067 #define ff_imdct_calc_c FFT_NAME(ff_imdct_calc_c)
00068 #define ff_imdct_half_c FFT_NAME(ff_imdct_half_c)
00069 #define ff_mdct_calc_c FFT_NAME(ff_mdct_calc_c)
00070 
00071 void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
00072 void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input);
00073 void ff_mdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
00074 
00075 #endif /* AVCODEC_FFT_INTERNAL_H */

Generated on Fri Oct 26 02:43:34 2012 for FFmpeg by doxygen 1.5.8

AltStyle によって変換されたページ (->オリジナル) /