comparison x86/fft.c @ 12475:9fef0a8ddd63 libavcodec

Move mm_support() from libavcodec to libavutil, make it a public function and rename it to av_get_cpu_flags().
author stefano
date Wed, 08 Sep 2010 15:07:14 +0000
parents a5ddb39627fd
children
comparison
equal deleted inserted replaced
12474:cf54b8e98e7a 12475:9fef0a8ddd63
14 * You should have received a copy of the GNU Lesser General Public 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 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 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */ 17 */
18 18
19 #include "libavutil/cpu.h"
19 #include "libavcodec/dsputil.h" 20 #include "libavcodec/dsputil.h"
20 #include "fft.h" 21 #include "fft.h"
21 22
22 av_cold void ff_fft_init_mmx(FFTContext *s) 23 av_cold void ff_fft_init_mmx(FFTContext *s)
23 { 24 {
24 #if HAVE_YASM 25 #if HAVE_YASM
25 int has_vectors = mm_support(); 26 int has_vectors = av_get_cpu_flags();
26 if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) { 27 if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) {
27 /* SSE for P3/P4/K8 */ 28 /* SSE for P3/P4/K8 */
28 s->imdct_calc = ff_imdct_calc_sse; 29 s->imdct_calc = ff_imdct_calc_sse;
29 s->imdct_half = ff_imdct_half_sse; 30 s->imdct_half = ff_imdct_half_sse;
30 s->fft_permute = ff_fft_permute_sse; 31 s->fft_permute = ff_fft_permute_sse;
44 } 45 }
45 46
46 #if CONFIG_DCT 47 #if CONFIG_DCT
47 av_cold void ff_dct_init_mmx(DCTContext *s) 48 av_cold void ff_dct_init_mmx(DCTContext *s)
48 { 49 {
49 int has_vectors = mm_support(); 50 int has_vectors = av_get_cpu_flags();
50 if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) 51 if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE)
51 s->dct32 = ff_dct32_float_sse; 52 s->dct32 = ff_dct32_float_sse;
52 } 53 }
53 #endif 54 #endif
54 55