36#define UNCHECKED_BITSTREAM_READER 0
37#define BITSTREAM_READER_LE
44#define JXL_FLAG_NOISE 1
45#define JXL_FLAG_PATCHES 2
46#define JXL_FLAG_SPLINES 16
47#define JXL_FLAG_USE_LF_FRAME 32
48#define JXL_FLAG_SKIP_ADAPTIVE_LF_SMOOTH 128
50#define MAX_PREFIX_ALPHABET_SIZE (1u << 15)
52#define clog1p(x) (ff_log2(x) + !!(x))
53#define unpack_signed(x) (((x) & 1 ? -(x)-1 : (x))/2)
54#define div_ceil(x, y) (((x) - 1) / (y) + 1)
55#define vlm(a,b) {.sym = (a), .len = (b)}
171 vlm(0, 2),
vlm(4, 2),
vlm(3, 2),
vlm(2, 3),
vlm(0, 2),
vlm(4, 2),
vlm(3, 2),
vlm(1, 4),
172 vlm(0, 2),
vlm(4, 2),
vlm(3, 2),
vlm(2, 3),
vlm(0, 2),
vlm(4, 2),
vlm(3, 2),
vlm(5, 4),
177 vlm(10, 3),
vlm(12, 7),
vlm(7, 3),
vlm(3, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(5, 4),
178 vlm(10, 3),
vlm(4, 4),
vlm(7, 3),
vlm(1, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(2, 4),
179 vlm(10, 3),
vlm(0, 5),
vlm(7, 3),
vlm(3, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(5, 4),
180 vlm(10, 3),
vlm(4, 4),
vlm(7, 3),
vlm(1, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(2, 4),
181 vlm(10, 3),
vlm(11, 6),
vlm(7, 3),
vlm(3, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(5, 4),
182 vlm(10, 3),
vlm(4, 4),
vlm(7, 3),
vlm(1, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(2, 4),
183 vlm(10, 3),
vlm(0, 5),
vlm(7, 3),
vlm(3, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(5, 4),
184 vlm(10, 3),
vlm(4, 4),
vlm(7, 3),
vlm(1, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(2, 4),
185 vlm(10, 3),
vlm(13, 7),
vlm(7, 3),
vlm(3, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(5, 4),
186 vlm(10, 3),
vlm(4, 4),
vlm(7, 3),
vlm(1, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(2, 4),
187 vlm(10, 3),
vlm(0, 5),
vlm(7, 3),
vlm(3, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(5, 4),
188 vlm(10, 3),
vlm(4, 4),
vlm(7, 3),
vlm(1, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(2, 4),
189 vlm(10, 3),
vlm(11, 6),
vlm(7, 3),
vlm(3, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(5, 4),
190 vlm(10, 3),
vlm(4, 4),
vlm(7, 3),
vlm(1, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(2, 4),
191 vlm(10, 3),
vlm(0, 5),
vlm(7, 3),
vlm(3, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(5, 4),
192 vlm(10, 3),
vlm(4, 4),
vlm(7, 3),
vlm(1, 4),
vlm(6, 3),
vlm(8, 3),
vlm(9, 3),
vlm(2, 4),
196 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15,
215 uint32_t c0, uint32_t
c1, uint32_t
c2, uint32_t c3,
216 uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3)
219 const uint32_t ubits [4] = {u0, u1, u2, u3};
220 uint32_t ret, choice =
get_bits(gb, 2);
232 uint64_t
shift = 12, ret;
283 *hybrid_uint = token;
321 if (dec->
state < (1 << 16))
323 dec->
state &= 0xFFFFFFFF;
330 uint32_t context, uint32_t *hybrid_uint)
385 int len = 0,
shift, omit_log = -1, omit_pos = -1;
386 int prev = 0, num_same = 0;
387 uint32_t total_count = 0;
388 uint8_t logcounts[258] = { 0 };
389 uint8_t same[258] = { 0 };
390 const int table_size = 1 << log_alphabet_size;
401 dist->
freq[v2] = (1 << 12) - dist->
freq[v1];
407 dist->
freq[x] = 1 << 12;
444 if (logcounts[
i] == 13) {
450 if (logcounts[
i] > omit_log) {
451 omit_log = logcounts[
i];
455 if (omit_pos < 0 || omit_pos + 1 < dist->
alphabet_size && logcounts[omit_pos + 1] == 13)
460 num_same = same[
i] - 1;
461 prev =
i > 0 ? dist->
freq[
i - 1] : 0;
464 dist->
freq[
i] = prev;
467 if (
i == omit_pos || !logcounts[
i])
469 if (logcounts[
i] == 1) {
472 int bitcount =
FFMIN(
FFMAX(0,
shift - ((12 - logcounts[
i] + 1) >> 1)), logcounts[
i] - 1);
473 dist->
freq[
i] = (1 << (logcounts[
i] - 1)) + (
get_bitsz(gb, bitcount) << (logcounts[
i] - 1 - bitcount));
476 total_count += dist->
freq[
i];
478 dist->
freq[omit_pos] = (1 << 12) - total_count;
541 for (
int i = 0;
i < 256;
i++)
548 for (
int j =
index; j > 0; j--)
568 uint32_t bucket_size, table_size;
569 uint8_t overfull[256], underfull[256];
570 int overfull_pos = 0, underfull_pos = 0;
573 table_size = 1 << log_alphabet_size;
576 for (
int i = 0;
i < table_size;
i++) {
588 overfull[overfull_pos++] =
i;
589 else if (dist->
cutoffs[
i] < bucket_size)
590 underfull[underfull_pos++] =
i;
595 underfull[underfull_pos++] =
i;
598 while (overfull_pos) {
603 u = underfull[--underfull_pos];
604 o = overfull[--overfull_pos];
605 by = bucket_size - dist->
cutoffs[
u];
609 if (dist->
cutoffs[o] < bucket_size)
610 underfull[underfull_pos++] = o;
611 else if (dist->
cutoffs[o] > bucket_size)
612 overfull[overfull_pos++] = o;
615 for (
int i = 0;
i < table_size;
i++) {
616 if (dist->
cutoffs[
i] == bucket_size) {
630 int nsym, tree_select,
bits;
636 for (
int i = 0;
i < nsym;
i++)
647 lens[0] = 1, lens[1] = 1, lens[2] = 0, lens[3] = 0;
648 if (symbols[1] < symbols[0])
649 FFSWAP(int16_t, symbols[0], symbols[1]);
653 lens[0] = 1, lens[1] = 2, lens[2] = 2, lens[3] = 0;
654 if (symbols[2] < symbols[1])
655 FFSWAP(int16_t, symbols[1], symbols[2]);
660 lens[0] = 1, lens[1] = 2, lens[2] = 3, lens[3] = 3;
661 if (symbols[3] < symbols[2])
662 FFSWAP(int16_t, symbols[2], symbols[3]);
665 lens[0] = 2, lens[1] = 2, lens[2] = 2, lens[3] = 2;
667 if (symbols[1] < symbols[0])
668 FFSWAP(int16_t, symbols[0], symbols[1]);
669 if (symbols[3] < symbols[2])
670 FFSWAP(int16_t, symbols[2], symbols[3]);
671 if (symbols[1] <= symbols[2])
673 FFSWAP(int16_t, symbols[1], symbols[2]);
688 int8_t level1_lens[18] = { 0 };
689 int8_t level1_lens_s[18] = { 0 };
690 int16_t level1_syms[18] = { 0 };
691 uint32_t level1_codecounts[19] = { 0 };
693 int8_t *level2_lens, *level2_lens_s;
694 int16_t *level2_syms;
695 uint32_t *level2_codecounts;
697 int repeat_count_prev = 0, repeat_count_zero = 0, prev = 8;
698 int total_code = 0,
len, hskip, num_codes = 0, ret;
700 VLC level1_vlc = { 0 };
712 level1_codecounts[0] = hskip;
713 for (
int i = hskip;
i < 18;
i++) {
719 level1_codecounts[
len]++;
721 total_code += (32 >>
len);
724 if (total_code >= 32) {
725 level1_codecounts[0] += 18 -
i - 1;
730 if (total_code != 32 && num_codes >= 2 || num_codes < 1) {
735 for (
int i = 1;
i < 19;
i++)
736 level1_codecounts[
i] += level1_codecounts[
i - 1];
738 for (
int i = 17;
i >= 0;
i--) {
739 int idx = --level1_codecounts[level1_lens[
i]];
740 level1_lens_s[idx] = level1_lens[
i];
741 level1_syms[idx] =
i;
756 level2_lens = (int8_t *)buf;
774 if (repeat_count_prev)
775 extra += 4 * (repeat_count_prev - 2) - repeat_count_prev;
777 for (
int j = 0; j < extra; j++)
778 level2_lens[
i + j] = prev;
779 total_code += (32768 >> prev) * extra;
781 repeat_count_prev += extra;
782 repeat_count_zero = 0;
783 level2_codecounts[prev] += extra;
784 }
else if (
len == 17) {
786 if (repeat_count_zero > 0)
787 extra += 8 * (repeat_count_zero - 2) - repeat_count_zero;
790 repeat_count_prev = 0;
791 repeat_count_zero += extra;
792 level2_codecounts[0] += extra;
794 level2_lens[
i] =
len;
795 repeat_count_prev = repeat_count_zero = 0;
797 total_code += (32768 >>
len);
800 level2_codecounts[
len]++;
802 if (total_code >= 32768) {
808 if (total_code != 32768 && level2_codecounts[0] < dist->
alphabet_size - 1) {
814 level2_codecounts[
i] += level2_codecounts[
i - 1];
817 int idx = --level2_codecounts[level2_lens[
i]];
818 level2_lens_s[idx] = level2_lens[
i];
819 level2_syms[idx] =
i;
930 memset(dec, 0,
sizeof(*dec));
946 uint32_t hybrid_uint;
960 if (
b1 >=
'a' &&
b1 <=
'z' ||
b1 >=
'A' &&
b1 <=
'Z')
962 else if (
b1 >=
'0' &&
b1 <=
'9' ||
b1 ==
'.' ||
b1 ==
',')
966 else if (
b1 > 1 &&
b1 < 16)
968 else if (
b1 > 240 &&
b1 < 255)
975 if (
b2 >=
'a' &&
b2 <=
'z' ||
b2 >=
'A' &&
b2 <=
'Z')
977 else if (
b2 >=
'0' &&
b2 <=
'9' ||
b2 ==
'.' ||
b2 ==
',')
986 return 1 + p1 + p2 * 8;
1052 }
else if (meta->
trc > 0) {
1053 if (meta->
trc > 45355 && meta->
trc < 45555)
1055 else if (meta->
trc > 35614 && meta->
trc < 35814)
1088 uint32_t last = 0, last2 = 0;
1090 uint64_t enc_size =
jxl_u64(gb);
1091 uint64_t output_size = 0;
1092 int out_size_shift = 0;
1094 if (!enc_size || enc_size > (1 << 22))
1120 if (out_size_shift < 63) {
1121 output_size += (ret & UINT64_C(0x7F)) << out_size_shift;
1122 if (!(ret & 0x80)) {
1123 out_size_shift = 63;
1125 out_size_shift += 7;
1126 if (out_size_shift > 56) {
1131 }
else if (output_size < 132) {
1147 uint64_t extensions =
jxl_u64(gb), extensions_len = 0;
1155 for (
int i = 0;
i < 64;
i++) {
1156 if (extensions & (UINT64_C(1) <<
i))
1157 extensions_len +=
jxl_u64(gb);
1162 if (extensions_len > INT_MAX ||
get_bits_left(gb) < extensions_len)
1172 int all_default, do_yCbCr = 0, num_passes = 1, ret;
1173 int group_size_shift = 1, lf_level = 0, save_as_ref = 0;
1174 int have_crop = 0, full_frame = 1, resets_canvas = 1, upsampling = 1;
1179 uint32_t name_len, num_groups, num_lf_groups, group_dim, lf_group_dim, toc_count;
1196 upsampling =
jxl_u32(gb, 1, 2, 4, 8, 0, 0, 0, 0);
1202 group_size_shift =
get_bits(gb, 2);
1206 num_passes =
jxl_u32(gb, 1, 2, 3, 4, 0, 0, 0, 3);
1207 if (num_passes != 1) {
1208 int num_ds =
jxl_u32(gb, 0, 1, 2, 3, 0, 0, 0, 1);
1211 for (
int i = 0;
i < num_ds;
i++)
1212 jxl_u32(gb, 0, 1, 2, 0, 0, 0, 0, 3);
1221 uint32_t ux0 =
jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30);
1222 uint32_t uy0 =
jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30);
1226 width =
jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30);
1228 full_frame = x0 <= 0 && y0 <= 0 && width + x0 >= meta->
coded_width
1237 jxl_u32(gb, 0, 1, 2, 3, 0, 0, 0, 2);
1259 (resets_canvas && !
frame->is_last && (!
duration || save_as_ref)
1262 name_len = 8 *
jxl_u32(gb, 0, 0, 16, 48, 0, 4, 5, 10);
1311 group_dim = 128 << group_size_shift;
1312 lf_group_dim = group_dim << 3;
1315 if (num_groups == 1 && num_passes == 1)
1318 toc_count = 2 + num_lf_groups + num_groups * num_passes;
1327 " exceeds max size of %" PRIu32
"x%" PRIu32
", aborting parser\n",
1339 if (end < 0 || end > toc_count) {
1343 for (uint32_t
i = 0;
i < end;
i++) {
1354 for (uint32_t
i = 0;
i < toc_count;
i++) {
1355 frame->body_length += 8 *
jxl_u32(gb, 0, 1024, 17408, 4211712, 10, 14, 22, 30);
1370 if (
ctx->skip > buf_size)
1374 buf_size -=
ctx->skip;
1389 size = bytestream2_get_be32(&gb);
1394 size = bytestream2_get_be64(&gb);
1413 const uint8_t *buf,
int buf_size)
1415 int ret, cs_buflen, header_skip;
1416 const uint8_t *cs_buffer;
1419 if (
ctx->skip > buf_size)
1423 buf_size -=
ctx->skip;
1431 ctx->collected_size = ret;
1436 cs_buffer =
ctx->cs_buffer;
1440 cs_buflen = buf_size;
1443 if (!
ctx->codestream_length) {
1445 if (header_skip < 0)
1447 ctx->codestream_length = header_skip;
1452 return ctx->collected_size;
1460 if (!
ctx->skipped_icc &&
ctx->codestream.meta.have_icc_profile) {
1464 ctx->skipped_icc = 1;
1476 ctx->codestream_length +=
ctx->codestream.frame.total_length;
1477 if (
ctx->codestream.frame.is_last)
1478 return ctx->codestream_length / 8;
1486 const uint8_t **poutbuf,
int *poutbuf_size,
1487 const uint8_t *buf,
int buf_size)
1491 const uint8_t *pbuf =
ctx->pc.buffer;
1492 int pindex =
ctx->pc.index;
1497 if (!
ctx->pc.index) {
1498 if (
ctx->pc.overread)
1504 if ((!
ctx->container || !
ctx->codestream_length) && !
ctx->next) {
1513 if (
ctx->container &&
ctx->next >= 0) {
1520 ctx->next = ret +
ctx->skip;
1524 next =
ctx->next -
ctx->pc.index;
1527 if (next > buf_size)
1535 *poutbuf_size = buf_size;
1537 ctx->codestream_length = 0;
1538 ctx->collected_size = 0;
1542 ctx->skipped_icc = 0;
1544 memset(&
ctx->codestream, 0,
sizeof(
ctx->codestream));
static char * split(char *message, char delim)
static AVFormatContext * ctx
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static av_cold void close(AVCodecParserContext *s)
static uint32_t BS_FUNC read(BSCTX *bc, unsigned int n)
Return n bits from the buffer, n has to be in the 0-32 range.
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
void(* flush)(AVBSFContext *ctx)
static const struct @033145243110221005363036244076252070150076110330 constants[]
static int rle(uint8_t *dst, const uint8_t *src, int compressed_size, int uncompressed_size)
static const uint8_t bits[8]
bitstream reader API header.
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, int bits, int max_depth)
Parse a vlc code.
static int get_bits_left(GetBitContext *gb)
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static const uint8_t * align_get_bits(GetBitContext *s)
static int get_bits_count(const GetBitContext *s)
static void skip_bits1(GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static av_always_inline int get_bitsz(GetBitContext *s, int n)
Read 0-25 bits.
@ AV_CODEC_ID_JPEGXL_ANIM
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
#define AVERROR_BUFFER_TOO_SMALL
Buffer too small.
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define FF_JPEGXL_CONTAINER_SIGNATURE_LE
@ JPEGXL_FRAME_SKIP_PROGRESSIVE
@ JPEGXL_FRAME_REFERENCE_ONLY
FFJXLTransferCharacteristic
#define FF_JPEGXL_CODESTREAM_SIGNATURE_LE
static uint32_t read_ans_symbol(GetBitContext *gb, JXLEntropyDecoder *dec, const JXLSymbolDistribution *dist)
static int jpegxl_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static uint32_t toc_context(uint32_t x)
static int skip_boxes(JXLParseContext *ctx, const uint8_t *buf, int buf_size)
static void populate_fields(AVCodecParserContext *s, AVCodecContext *avctx, const FFJXLMetadata *meta)
static int skip_icc_profile(void *avctx, JXLParseContext *ctx, GetBitContext *gb)
static int64_t entropy_decoder_read_symbol(GetBitContext *gb, JXLEntropyDecoder *dec, uint32_t context)
static const uint8_t prefix_codelen_map[18]
static int read_dist_clustering(GetBitContext *gb, JXLEntropyDecoder *dec, JXLDistributionBundle *bundle)
static av_always_inline uint32_t jxl_u32(GetBitContext *gb, uint32_t c0, uint32_t c1, uint32_t c2, uint32_t c3, uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3)
static int parse_frame_header(void *avctx, JXLParseContext *ctx, GetBitContext *gb)
static int read_hybrid_uint_conf(GetBitContext *gb, JXLHybridUintConf *conf, int log_alphabet_size)
static int read_simple_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolDistribution *dist)
const FFCodecParser ff_jpegxl_parser
static void entropy_decoder_close(JXLEntropyDecoder *dec)
static const VLCElem dist_prefix_table[128]
static const VLCElem level0_table[16]
static int gen_alias_map(JXLEntropyDecoder *dec, JXLSymbolDistribution *dist, int log_alphabet_size)
static void dist_bundle_close(JXLDistributionBundle *bundle)
static uint64_t jxl_u64(GetBitContext *gb)
static int decode_hybrid_varlen_uint(GetBitContext *gb, JXLEntropyDecoder *dec, const JXLDistributionBundle *bundle, uint32_t context, uint32_t *hybrid_uint)
static int entropy_decoder_init(void *avctx, GetBitContext *gb, JXLEntropyDecoder *dec, int num_dist)
static int read_hybrid_uint(GetBitContext *gb, const JXLHybridUintConf *conf, uint32_t token, uint32_t *hybrid_uint)
static int read_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolDistribution *dist)
#define MAX_PREFIX_ALPHABET_SIZE
static av_always_inline uint8_t jxl_u8(GetBitContext *gb)
Read a variable-length 8-bit integer.
static int populate_distribution(GetBitContext *gb, JXLSymbolDistribution *dist, int log_alphabet_size)
static int64_t try_parse(AVCodecParserContext *s, AVCodecContext *avctx, JXLParseContext *ctx, const uint8_t *buf, int buf_size)
static uint32_t read_prefix_symbol(GetBitContext *gb, const JXLSymbolDistribution *dist)
static int read_distribution_bundle(GetBitContext *gb, JXLEntropyDecoder *dec, JXLDistributionBundle *bundle, int num_dist, int disallow_lz77)
#define JXL_FLAG_USE_LF_FRAME
static uint32_t icc_context(uint64_t i, uint32_t b1, uint32_t b2)
static int skip_extensions(GetBitContext *gb)
static int shift(int a, int b)
#define u(width, name, range_min, range_max)
int ff_jpegxl_collect_codestream_header(const uint8_t *input_buffer, int input_len, uint8_t *buffer, int buflen, int *copied)
int ff_jpegxl_parse_codestream_header(const uint8_t *buf, int buflen, FFJXLMetadata *meta, int validate)
Macro definitions for various function/variable attributes.
Utility Preprocessor macros.
#define FFSWAP(type, a, b)
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
static float distance(float x, float y, int band)
av_cold void ff_parse_close(AVCodecParserContext *s)
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
#define PARSER_CODEC_LIST(...)
#define AV_PIX_FMT_RGBF32
#define AV_PIX_FMT_RGBAF32
@ AVALPHA_MODE_STRAIGHT
Alpha channel is independent of color values.
@ AVALPHA_MODE_PREMULTIPLIED
Alpha channel is multiplied into color values.
#define AV_PIX_FMT_RGBA64
#define AV_PIX_FMT_GRAYF32
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_YA8
8 bits gray, 8 bits alpha
#define AV_PIX_FMT_GRAY16
@ AVCOL_PRI_SMPTE432
SMPTE ST 432-1 (2010) / P3 D65 / Display P3.
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
@ AVCOL_PRI_SMPTE431
SMPTE ST 431-2 (2011) / DCI P3.
@ AVCOL_PRI_BT2020
ITU-R BT2020.
@ AVCOL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
@ AVCOL_TRC_SMPTE428
SMPTE ST 428-1.
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
@ AVCOL_TRC_BT709
also ITU-R BT1361
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
main external API structure.
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
enum AVColorSpace colorspace
YUV colorspace type.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
enum AVAlphaMode alpha_mode
Indicates how the alpha channel of the video is represented.
JXLHybridUintConf lz_len_conf
JXLSymbolDistribution * dists
JXLDistributionBundle bundle
FFJXLFrameEncoding encoding
int64_t codestream_length
uint8_t cs_buffer[4096+AV_INPUT_BUFFER_PADDING_SIZE]
#define av_malloc_array(a, b)
static double b1(void *priv, double x, double y)
static double b2(void *priv, double x, double y)
int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags, void *logctx)
Build VLC decoding tables suitable for use with get_vlc2()
void ff_vlc_free(VLC *vlc)