*
* The block_size is the largest multiple of vl that <= 256, because overflow would occur when
* vl > 256 (255 * 256 <= UINT16_MAX).
- *
+ *
* We accumulate 8-bit data into a 16-bit accumulator and then
* move the data into the 32-bit accumulator at the last iteration.
*/
vuint8m4_t v_src1 = __riscv_vle8_v_u8m4(src1, vl);
vbool2_t v_mask = __riscv_vmsne_vv_u8m4_b2(v_src0, v_src1, vl);
found_diff = __riscv_vfirst_m_b2(v_mask, vl);
- if (found_diff >= 0)
+ if (found_diff >= 0)
return len + (uint32_t)found_diff;
src0 += vl, src1 += vl, len += vl;
} while (len < 256);
*
* Copyright (C) 2023 SiFive, Inc. All rights reserved.
* Contributed by Alex Chiang <alex.chiang@sifive.com>
- *
+ *
* For conditions of distribution and use, see copyright notice in zlib.h
*/
int32_t green_stop = num_pix;
for (int32_t x = 0; i < red_stop; x += 3, ++i) {
- buf[x] = 255;
+ buf[x] = 255;
buf[x + 1] = 0;
- buf[x + 2] = 0;
+ buf[x + 2] = 0;
}
for (int32_t x = 3 * i; i < blue_stop; x+= 3, ++i) {
- buf[x] = 0;
- buf[x + 1] = 255;
- buf[x + 2] = 0;
+ buf[x] = 0;
+ buf[x + 1] = 255;
+ buf[x + 2] = 0;
}
for (int32_t x = 3 * i; i < green_stop; x += 3, ++i) {
- buf[x] = 0;
- buf[x + 1] = 0;
- buf[x + 2] = 255;
+ buf[x] = 0;
+ buf[x + 1] = 0;
+ buf[x + 2] = 255;
}
}
static inline int decode_png(png_parse_dat *dat, png_bytepp out_bytes, size_t in_size, uint32_t &width, uint32_t &height) {
png_structp png = NULL;
png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
-
+
if (!png) abort();
png_infop info = NULL;
info = png_create_info_struct(png);
if (color_type != PNG_COLOR_TYPE_RGB) {
fprintf(stderr, "expected an 8 bpp RGB image\n");
abort();
- }
+ }
if (im_size > in_size) {
*out_bytes = (png_bytep)realloc(*out_bytes, im_size);
}
CHECK_ERR(err, "inflate with dict");
}
-
+
err = PREFIX(inflateGetDictionary)(&d_stream, NULL, &check_dictionary_len);
CHECK_ERR(err, "inflateGetDictionary");
#ifndef S390_DFLTCC_INFLATE
if (check_dictionary_len < sizeof(dictionary))
error("bad dictionary length\n");
#endif
-
+
err = PREFIX(inflateGetDictionary)(&d_stream, check_dictionary, &check_dictionary_len);
CHECK_ERR(err, "inflateGetDictionary");
#ifndef S390_DFLTCC_INFLATE