Revision 86c624af

View differences:

libavcodec/fft-test.c
144 144
void check_diff(float *tab1, float *tab2, int n)
145 145
{
146 146
    int i;
147
    double max= 0;
148
    double error= 0;
147 149

  
148 150
    for(i=0;i<n;i++) {
149
        if (fabsf(tab1[i] - tab2[i]) >= 1e-3) {
151
        double e= fabsf(tab1[i] - tab2[i]);
152
        if (e >= 1e-3) {
150 153
            av_log(NULL, AV_LOG_ERROR, "ERROR %d: %f %f\n",
151 154
                   i, tab1[i], tab2[i]);
152 155
        }
156
        error+= e*e;
157
        if(e>max) max= e;
153 158
    }
159
    av_log(NULL, AV_LOG_INFO, "max:%f e:%g\n", max, sqrt(error)/n);
154 160
}
155 161

  
156 162

  

Also available in: Unified diff