| 81 | } |
| 82 | |
| 83 | void print_error_stats(const ErrorStats &stats, const char *test_name) { |
| 84 | fl::printf("\n=== %s ===\n", test_name); |
| 85 | fl::printf("Total pixels: %d\n", stats.total_pixels); |
| 86 | fl::printf("Pixels with error: %d (%.1f%%)\n", |
| 87 | stats.pixels_with_error, |
| 88 | 100.0 * stats.pixels_with_error / stats.total_pixels); |
| 89 | fl::printf("Max error: %d (%.1f%%)\n", stats.max_error, 100.0 * stats.max_error / 255); |
| 90 | fl::printf("Avg error: %.2f\n", stats.avg_error); |
| 91 | fl::printf("Std dev: %.2f\n", stats.std_dev); |
| 92 | fl::printf("\nError distribution:\n"); |
| 93 | fl::printf(" >1 LSB (>1): %d pixels (%.1f%%)\n", |
| 94 | stats.pixels_over_1bit, |
| 95 | 100.0 * stats.pixels_over_1bit / stats.total_pixels); |
| 96 | fl::printf(" >2 LSB (>2): %d pixels (%.1f%%)\n", |
| 97 | stats.pixels_over_2bit, |
| 98 | 100.0 * stats.pixels_over_2bit / stats.total_pixels); |
| 99 | fl::printf(" >4 LSB (>4): %d pixels (%.1f%%)\n", |
| 100 | stats.pixels_over_4bit, |
| 101 | 100.0 * stats.pixels_over_4bit / stats.total_pixels); |
| 102 | |
| 103 | fl::printf("\nHistogram (first 20 buckets):\n"); |
| 104 | for (int i = 0; i < 20 && i <= stats.max_error; i++) { |
| 105 | if (stats.histogram[i] > 0) { |
| 106 | fl::printf(" Error=%2d: %4d pixels (%.1f%%)\n", |
| 107 | i, stats.histogram[i], |
| 108 | 100.0 * stats.histogram[i] / stats.total_pixels); |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | FL_TEST_CASE("chasing_spirals - float vs q31 accuracy (t=1000)") { |
| 114 | const uint16_t W = 32; |
no test coverage detected