- float offset, total_weight;
- combine_two_samples(w1, w2, &offset, &total_weight);
+ float offset, total_weight, sum_sq_error;
+ combine_two_samples(w1, w2, &offset, &total_weight, &sum_sq_error);
+
+ // If the interpolation error is larger than that of one level
+ // at 8-bit precision, don't combine.
+ if (sum_sq_error > 1.0f / (256.0f * 256.0f)) {
+ continue;
+ }