FFmpeg
Macros | Functions
jpegxl_parse.c File Reference
#include <stdint.h>
#include "bytestream.h"
#include "get_bits.h"
#include "jpegxl.h"
#include "jpegxl_parse.h"

Go to the source code of this file.

Macros

#define UNCHECKED_BITSTREAM_READER   0
 
#define BITSTREAM_READER_LE
 

Functions

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 av_always_inline uint32_t jxl_enum (GetBitContext *gb)
 
static uint64_t jxl_u64 (GetBitContext *gb)
 
static uint32_t jpegxl_width_from_ratio (uint32_t height, int ratio)
 
static int jpegxl_read_size_header (GetBitContext *gb, FFJXLMetadata *meta, int validate)
 validate a Jpeg XL Size Header More...
 
static int jpegxl_read_preview_header (GetBitContext *gb, int validate)
 validate a Jpeg XL Preview Header More...
 
static void jpegxl_get_bit_depth (GetBitContext *gb, FFJXLMetadata *meta)
 get a Jpeg XL BitDepth Header. More...
 
static int jpegxl_read_extra_channel_info (GetBitContext *gb, FFJXLMetadata *meta, int validate)
 validate a Jpeg XL Extra Channel Info bundle More...
 
static int jpegxl_skip_extensions (GetBitContext *gb)
 
int ff_jpegxl_parse_codestream_header (const uint8_t *buf, int buflen, FFJXLMetadata *meta, int validate)
 
int ff_jpegxl_collect_codestream_header (const uint8_t *input_buffer, int input_len, uint8_t *buffer, int buflen, int *copied)
 

Macro Definition Documentation

◆ UNCHECKED_BITSTREAM_READER

#define UNCHECKED_BITSTREAM_READER   0

Definition at line 25 of file jpegxl_parse.c.

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 26 of file jpegxl_parse.c.

Function Documentation

◆ jxl_u32()

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

◆ jxl_enum()

static av_always_inline uint32_t jxl_enum ( GetBitContext gb)
static

◆ jxl_u64()

static uint64_t jxl_u64 ( GetBitContext gb)
static

Definition at line 53 of file jpegxl_parse.c.

Referenced by jpegxl_skip_extensions().

◆ jpegxl_width_from_ratio()

static uint32_t jpegxl_width_from_ratio ( uint32_t  height,
int  ratio 
)
static

Definition at line 83 of file jpegxl_parse.c.

Referenced by jpegxl_read_preview_header(), and jpegxl_read_size_header().

◆ jpegxl_read_size_header()

static int jpegxl_read_size_header ( GetBitContext gb,
FFJXLMetadata meta,
int  validate 
)
static

validate a Jpeg XL Size Header

Returns
>= 0 upon valid size, < 0 upon invalid size found

Definition at line 112 of file jpegxl_parse.c.

Referenced by ff_jpegxl_parse_codestream_header().

◆ jpegxl_read_preview_header()

static int jpegxl_read_preview_header ( GetBitContext gb,
int  validate 
)
static

validate a Jpeg XL Preview Header

Returns
>= 0 upon valid size, < 0 upon invalid size found

Definition at line 145 of file jpegxl_parse.c.

Referenced by ff_jpegxl_parse_codestream_header().

◆ jpegxl_get_bit_depth()

static void jpegxl_get_bit_depth ( GetBitContext gb,
FFJXLMetadata meta 
)
static

get a Jpeg XL BitDepth Header.

These cannot be invalid.

Definition at line 171 of file jpegxl_parse.c.

Referenced by ff_jpegxl_parse_codestream_header(), and jpegxl_read_extra_channel_info().

◆ jpegxl_read_extra_channel_info()

static int jpegxl_read_extra_channel_info ( GetBitContext gb,
FFJXLMetadata meta,
int  validate 
)
static

validate a Jpeg XL Extra Channel Info bundle

Returns
>= 0 upon valid, < 0 upon invalid

Definition at line 190 of file jpegxl_parse.c.

Referenced by ff_jpegxl_parse_codestream_header().

◆ jpegxl_skip_extensions()

static int jpegxl_skip_extensions ( GetBitContext gb)
static

Definition at line 230 of file jpegxl_parse.c.

Referenced by ff_jpegxl_parse_codestream_header().

◆ ff_jpegxl_parse_codestream_header()

int ff_jpegxl_parse_codestream_header ( const uint8_t *  buf,
int  buflen,
FFJXLMetadata meta,
int  validate 
)

◆ ff_jpegxl_collect_codestream_header()

int ff_jpegxl_collect_codestream_header ( const uint8_t *  input_buffer,
int  input_len,
uint8_t *  buffer,
int  buflen,
int copied 
)

Definition at line 449 of file jpegxl_parse.c.

Referenced by jpegxl_anim_probe(), jpegxl_anim_read_header(), and try_parse().