FFmpeg
Loading...
Searching...
No Matches
jpegxl_parse.h
Go to the documentation of this file.
1/*
2 * JPEG XL Header Parser
3 * Copyright (c) 2023 Leo Izen <leo.izen@gmail.com>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef AVCODEC_JPEGXL_PARSE_H
23#define AVCODEC_JPEGXL_PARSE_H
24
25#include <stdint.h>
26
27#include "libavutil/rational.h"
28
29#include "jpegxl.h"
30
31typedef struct FFJXLMetadata {
32 uint32_t width;
33 uint32_t height;
34 uint32_t coded_width;
35 uint32_t coded_height;
39 /*
40 * offset, in bits, of the animation header
41 * zero if not animated
42 */
49
50 /* used by the parser */
56
57/*
58 * copies as much of the codestream into the buffer as possible
59 * pass a shorter buflen to request less
60 * returns the number of bytes consumed from input, may be greater than input_len
61 * if the input doesn't end on an ISOBMFF-box boundary
62 */
63int ff_jpegxl_collect_codestream_header(const uint8_t *input_buffer, int input_len,
64 uint8_t *buffer, int buflen, int *copied);
65
66/*
67 * Parse the codestream header with the provided buffer. Returns negative upon failure,
68 * or the number of bits consumed upon success.
69 * The FFJXLMetadata parameter may be NULL, in which case it's ignored.
70 */
71int ff_jpegxl_parse_codestream_header(const uint8_t *buf, int buflen, FFJXLMetadata *meta, int validate);
72
73#endif /* AVCODEC_JPEGXL_PARSE_H */
FFJXLWhitePoint
Definition jpegxl.h:69
FFJXLPrimaries
Definition jpegxl.h:76
FFJXLColorSpace
Definition jpegxl.h:62
FFJXLTransferCharacteristic
Definition jpegxl.h:83
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)
Utilities for rational number calculation.
Rational number (pair of numerator and denominator).
Definition rational.h:58
uint32_t height
uint32_t coded_width
uint32_t num_extra_channels
uint32_t width
FFJXLWhitePoint wp
AVRational timebase
FFJXLPrimaries primaries
uint32_t coded_height
FFJXLTransferCharacteristic trc
FFJXLColorSpace csp
static char buffer[20]
Definition seek.c:32