Revision 77a78e9b libavcodec/x86/lpc_mmx.c

View differences:

libavcodec/x86/lpc_mmx.c
69 69
#undef WELCH
70 70
}
71 71

  
72
static void lpc_compute_autocorr_sse2(const int32_t *data, int len, int lag,
72
static void lpc_compute_autocorr_sse2(const double *data, int len, int lag,
73 73
                                   double *autoc)
74 74
{
75
    double tmp[len + lag + 2];
76
    double *data1 = tmp + lag;
77 75
    int j;
78 76

  
79
    if((x86_reg)data1 & 15)
80
        data1++;
81

  
82
    apply_welch_window_sse2(data, len, data1);
83

  
84
    for(j=0; j<lag; j++)
85
        data1[j-lag]= 0.0;
86
    data1[len] = 0.0;
77
    if((x86_reg)data & 15)
78
        data++;
87 79

  
88 80
    for(j=0; j<lag; j+=2){
89 81
        x86_reg i = -len*sizeof(double);
......
114 106
                "movsd     %%xmm1,  8(%1)           \n\t"
115 107
                "movsd     %%xmm2, 16(%1)           \n\t"
116 108
                :"+&r"(i)
117
                :"r"(autoc+j), "r"(data1+len), "r"(data1+len-j)
109
                :"r"(autoc+j), "r"(data+len), "r"(data+len-j)
118 110
                :"memory"
119 111
            );
120 112
        } else {
......
137 129
                "movsd     %%xmm0, %1               \n\t"
138 130
                "movsd     %%xmm1, %2               \n\t"
139 131
                :"+&r"(i), "=m"(autoc[j]), "=m"(autoc[j+1])
140
                :"r"(data1+len), "r"(data1+len-j)
132
                :"r"(data+len), "r"(data+len-j)
141 133
            );
142 134
        }
143 135
    }
......
148 140
    int mm_flags = av_get_cpu_flags();
149 141

  
150 142
    if (mm_flags & (AV_CPU_FLAG_SSE2|AV_CPU_FLAG_SSE2SLOW)) {
143
        c->lpc_apply_welch_window = apply_welch_window_sse2;
151 144
        c->lpc_compute_autocorr = lpc_compute_autocorr_sse2;
152 145
    }
153 146
}

Also available in: Unified diff