00001 /* 00002 * (I)RDFT transforms 00003 * Copyright (c) 2009 Alex Converse <alex dot converse at gmail dot com> 00004 * 00005 * This file is part of FFmpeg. 00006 * 00007 * FFmpeg is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * FFmpeg is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with FFmpeg; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #ifndef AVCODEC_RDFT_H 00023 #define AVCODEC_RDFT_H 00024 00025 #include "config.h" 00026 #include "fft.h" 00027 00028 #if CONFIG_HARDCODED_TABLES 00029 # define SINTABLE_CONST const 00030 #else 00031 # define SINTABLE_CONST 00032 #endif 00033 00034 #define SINTABLE(size) \ 00035 SINTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_sin_##size)[size/2] 00036 00037 extern SINTABLE(16); 00038 extern SINTABLE(32); 00039 extern SINTABLE(64); 00040 extern SINTABLE(128); 00041 extern SINTABLE(256); 00042 extern SINTABLE(512); 00043 extern SINTABLE(1024); 00044 extern SINTABLE(2048); 00045 extern SINTABLE(4096); 00046 extern SINTABLE(8192); 00047 extern SINTABLE(16384); 00048 extern SINTABLE(32768); 00049 extern SINTABLE(65536); 00050 00051 struct RDFTContext { 00052 int nbits; 00053 int inverse; 00054 int sign_convention; 00055 00056 /* pre/post rotation tables */ 00057 const FFTSample *tcos; 00058 SINTABLE_CONST FFTSample *tsin; 00059 FFTContext fft; 00060 void (*rdft_calc)(struct RDFTContext *s, FFTSample *z); 00061 }; 00062 00068 int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans); 00069 void ff_rdft_end(RDFTContext *s); 00070 00071 void ff_rdft_init_arm(RDFTContext *s); 00072 00073 00074 #endif /* AVCODEC_RDFT_H */