#include "idct.h"
#include "idct_reference.h"
#include "idct_float.h"
+#include "idct_imprecise_int.h"
// Generate random coefficients in the range [-15..15].
void gen_random_coeffs(int16_t* dst, size_t len)
void* userdata = idct_alloc(quant);
- for (unsigned i = 0; i < 255*8; ++i) {
- uint32_t reference_value = i / 8;
+ for (unsigned i = -255*8; i < 255*16; ++i) {
+ int reference_value = i / 8 + 128;
+ if (reference_value < 0) {
+ reference_value = 0;
+ } else if (reference_value > 255) {
+ reference_value = 255;
+ }
coeff[0] = i;
(*idct)(coeff, userdata, output);
printf("idct_float:\n");
test_all_idct(idct_float_alloc, idct_float_free, idct_float);
+
+ printf("idct_imprecise_int:\n");
+ test_all_idct(idct_imprecise_int_alloc, idct_imprecise_int_free, idct_imprecise_int);
printf("All tests pass.\n");
return 0;