24 #define BITSTREAM_READER_LE
60 #define jxl_bits(n) get_bits_long(gb, (n))
61 #define jxl_bits_skip(n) skip_bits_long(gb, (n))
62 #define jxl_u32(c0, c1, c2, c3, u0, u1, u2, u3) jpegxl_u32(gb, \
63 (const uint32_t[]){c0, c1, c2, c3}, (const uint32_t[]){u0, u1, u2, u3})
64 #define jxl_u64() jpegxl_u64(gb)
65 #define jxl_enum() jxl_u32(0, 1, 2, 18, 0, 0, 4, 6)
69 const uint32_t
constants[4],
const uint32_t ubits[4])
114 uint64_t height64 =
height;
119 return (uint32_t)((height64 * 12) / 10);
121 return (uint32_t)((height64 * 4) / 3);
123 return (uint32_t)((height64 * 3) / 2);
125 return (uint32_t)((height64 * 16) / 9);
127 return (uint32_t)((height64 * 5) / 4);
129 return (uint32_t)(height64 * 2);
199 jxl_u32(32, 16, 24, 1, 0, 0, 0, 6);
203 jxl_u32(8, 10, 12, 1, 0, 0, 0, 6);
214 uint32_t
type, name_len = 0;
223 jxl_u32(0, 3, 4, 1, 0, 0, 0, 3);
225 name_len =
jxl_u32(0, 0, 16, 48, 0, 4, 5, 10);
240 jxl_u32(1, 0, 3, 19, 0, 2, 4, 8);
248 int all_default, extra_fields = 0;
249 int xyb_encoded = 1, have_icc_profile = 0;
250 int animation_offset = 0;
251 uint32_t num_extra_channels;
289 jxl_u32(100, 1000, 1, 1, 0, 0, 10, 30);
290 jxl_u32(1, 1001, 1, 1, 0, 0, 8, 10);
291 jxl_u32(0, 0, 0, 0, 0, 3, 16, 32);
303 num_extra_channels =
jxl_u32(0, 1, 2, 1, 0, 0, 4, 12);
304 if (num_extra_channels > 4 && validate_level)
306 for (uint32_t
i = 0;
i < num_extra_channels;
i++) {
315 uint32_t color_space;
318 if (color_space > 63)
321 if (!have_icc_profile) {
324 if (white_point > 63)
328 jxl_u32(0, 524288, 1048576, 2097152, 19, 19, 20, 21);
329 jxl_u32(0, 524288, 1048576, 2097152, 19, 19, 20, 21);
338 for (
int i = 0;
i < 6;
i++)
339 jxl_u32(0, 524288, 1048576, 2097152, 19, 19, 20, 21);
366 for (
int i = 0;
i < 64;
i++) {
367 if (extensions & (UINT64_C(1) <<
i))
387 if (!have_icc_profile) {
389 if (bits_remaining &&
jxl_bits(bits_remaining))
396 return animation_offset;