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 #include "libavcodec/dsputil.h" 00020 #include "fft.h" 00021 00022 av_cold void ff_fft_init_mmx(FFTContext *s) 00023 { 00024 #if HAVE_YASM 00025 int has_vectors = mm_support(); 00026 if (has_vectors & FF_MM_SSE && HAVE_SSE) { 00027 /* SSE for P3/P4/K8 */ 00028 s->imdct_calc = ff_imdct_calc_sse; 00029 s->imdct_half = ff_imdct_half_sse; 00030 s->fft_permute = ff_fft_permute_sse; 00031 s->fft_calc = ff_fft_calc_sse; 00032 } else if (has_vectors & FF_MM_3DNOWEXT && HAVE_AMD3DNOWEXT) { 00033 /* 3DNowEx for K7 */ 00034 s->imdct_calc = ff_imdct_calc_3dn2; 00035 s->imdct_half = ff_imdct_half_3dn2; 00036 s->fft_calc = ff_fft_calc_3dn2; 00037 } else if (has_vectors & FF_MM_3DNOW && HAVE_AMD3DNOW) { 00038 /* 3DNow! for K6-2/3 */ 00039 s->imdct_calc = ff_imdct_calc_3dn; 00040 s->imdct_half = ff_imdct_half_3dn; 00041 s->fft_calc = ff_fft_calc_3dn; 00042 } 00043 #endif 00044 }