Make a guess at the value before doing the binary search, cuts the number of conditionals by half. Not as much gain as I hoped but something.

This commit is contained in:
Jorge Rodriguez
2014-09-15 14:01:11 -07:00
parent 7602c99e77
commit 600d80387e
2 changed files with 23 additions and 13 deletions

View File

@ -799,10 +799,6 @@ void test_suite(int argc, char **argv)
else
barbara = "barbara.png";
test_format<unsigned short>(barbara, 0.5, 2.0, STBIR_TYPE_UINT16, STBIR_COLORSPACE_SRGB);
test_32();
// check what cases we need normalization for
#if 1
{
@ -877,6 +873,8 @@ void test_suite(int argc, char **argv)
test_premul();
test_32();
// Some tests to make sure errors don't pop up with strange filter/dimension combinations.
stbir_resize(image88, 8, 8, 0, output88, 4, 16, 0, STBIR_TYPE_UINT8, 1, STBIR_ALPHA_CHANNEL_NONE, 0, STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_FILTER_BOX, STBIR_FILTER_CATMULLROM, STBIR_COLORSPACE_SRGB, &g_context);
stbir_resize(image88, 8, 8, 0, output88, 4, 16, 0, STBIR_TYPE_UINT8, 1, STBIR_ALPHA_CHANNEL_NONE, 0, STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_FILTER_CATMULLROM, STBIR_FILTER_BOX, STBIR_COLORSPACE_SRGB, &g_context);