Revision 844ea46a libavcodec/fft.c

View differences:

libavcodec/fft.c
34 34
{
35 35
    int i, j, m, n;
36 36
    float alpha, c1, s1, s2;
37
    int shuffle = 0;
38
    int av_unused has_vectors;
37 39

  
38 40
    s->nbits = nbits;
39 41
    n = 1 << nbits;
......
59 61
    s->imdct_calc = ff_imdct_calc;
60 62
    s->exptab1 = NULL;
61 63

  
62
    /* compute constant table for HAVE_SSE version */
63
#if defined(HAVE_MMX) \
64
    || (defined(HAVE_ALTIVEC) && !defined(ALTIVEC_USE_REFERENCE_C_CODE))
65
    {
66
        int has_vectors = mm_support();
67

  
68
        if (has_vectors) {
69
#if defined(HAVE_MMX)
70
            if (has_vectors & MM_3DNOWEXT) {
71
                /* 3DNowEx for K7/K8 */
72
                s->imdct_calc = ff_imdct_calc_3dn2;
73
                s->fft_calc = ff_fft_calc_3dn2;
74
            } else if (has_vectors & MM_3DNOW) {
75
                /* 3DNow! for K6-2/3 */
76
                s->fft_calc = ff_fft_calc_3dn;
77
            } else if (has_vectors & MM_SSE) {
78
                /* SSE for P3/P4 */
79
                s->imdct_calc = ff_imdct_calc_sse;
80
                s->fft_calc = ff_fft_calc_sse;
81
            }
82
#else /* HAVE_MMX */
83
            if (has_vectors & MM_ALTIVEC)
84
                s->fft_calc = ff_fft_calc_altivec;
64
#ifdef HAVE_MMX
65
    has_vectors = mm_support();
66
    shuffle = 1;
67
    if (has_vectors & MM_3DNOWEXT) {
68
        /* 3DNowEx for K7/K8 */
69
        s->imdct_calc = ff_imdct_calc_3dn2;
70
        s->fft_calc = ff_fft_calc_3dn2;
71
    } else if (has_vectors & MM_3DNOW) {
72
        /* 3DNow! for K6-2/3 */
73
        s->fft_calc = ff_fft_calc_3dn;
74
    } else if (has_vectors & MM_SSE) {
75
        /* SSE for P3/P4 */
76
        s->imdct_calc = ff_imdct_calc_sse;
77
        s->fft_calc = ff_fft_calc_sse;
78
    } else {
79
        shuffle = 0;
80
    }
81
#elif defined HAVE_ALTIVEC && !defined ALTIVEC_USE_REFERENCE_C_CODE
82
    has_vectors = mm_support();
83
    if (has_vectors & MM_ALTIVEC) {
84
        s->fft_calc = ff_fft_calc_altivec;
85
        shuffle = 1;
86
    }
85 87
#endif
86
        }
87
        if (s->fft_calc != ff_fft_calc_c) {
88

  
89
    /* compute constant table for HAVE_SSE version */
90
        if (shuffle) {
88 91
            int np, nblocks, np2, l;
89 92
            FFTComplex *q;
90 93

  
......
111 114
            } while (nblocks != 0);
112 115
            av_freep(&s->exptab);
113 116
        }
114
    }
115
#endif
116 117

  
117 118
    /* compute bit reverse table */
118 119

  

Also available in: Unified diff