static void test_mul32shift(void) { int x, y; for(y = 0; y < height; y++) { uint32_t *data = img + y * width; for(x = 0; x < width ; x++) { uint32_t x = *data; uint8_t a, b, c, d; a = x >> 24; b = (uint8_t)(x >> 16); c = (uint8_t)(x >> 8); d = (uint8_t)x; a *= K; b *= K; c *= K; d *= K; *data++ = ((uint32_t)a << 24) | ((uint32_t)b << 16) | ((uint16_t)c << 8) | d; } } } static void test_mul32tab(void) { int x, y; for(y = 0; y < height; y++) { uint32_t *data = img + y * width; for(x = 0; x < width ; x++) { uint32_t x = *data; uint8_t t[4]; t[0] = x >> 24; t[1] = (uint8_t)(x >> 16); t[2] = (uint8_t)(x >> 8); t[3] = (uint8_t)x; t[0] *= K; t[1] *= K; t[2] *= K; t[3] *= K; *data++ = ((uint32_t)t[0] << 24) | ((uint32_t)t[1] << 16) | ((uint16_t)t[2] << 8) | t[3]; } } }