comparison fft-test.c @ 5417:3eca9008175b libavcodec

print max and mse
author michael
date Sun, 29 Jul 2007 09:58:36 +0000
parents e9f8a337c5ce
children 95234f2e0bdd
comparison
equal deleted inserted replaced
5416:90d90aecc83c 5417:3eca9008175b
142 } 142 }
143 143
144 void check_diff(float *tab1, float *tab2, int n) 144 void check_diff(float *tab1, float *tab2, int n)
145 { 145 {
146 int i; 146 int i;
147 double max= 0;
148 double error= 0;
147 149
148 for(i=0;i<n;i++) { 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 av_log(NULL, AV_LOG_ERROR, "ERROR %d: %f %f\n", 153 av_log(NULL, AV_LOG_ERROR, "ERROR %d: %f %f\n",
151 i, tab1[i], tab2[i]); 154 i, tab1[i], tab2[i]);
152 } 155 }
153 } 156 error+= e*e;
157 if(e>max) max= e;
158 }
159 av_log(NULL, AV_LOG_INFO, "max:%f e:%g\n", max, sqrt(error)/n);
154 } 160 }
155 161
156 162
157 void help(void) 163 void help(void)
158 { 164 {