FFmpeg
|
#include <errno.h>
#include <stdint.h>
#include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/error.h"
#include "libavutil/intmath.h"
#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavutil/pixfmt.h"
#include "bytestream.h"
#include "codec_id.h"
#include "get_bits.h"
#include "jpegxl.h"
#include "jpegxl_parse.h"
#include "parser.h"
#include "vlc.h"
Go to the source code of this file.
Data Structures | |
struct | JXLHybridUintConf |
struct | JXLSymbolDistribution |
struct | JXLDistributionBundle |
struct | JXLEntropyDecoder |
struct | JXLFrame |
struct | JXLCodestream |
struct | JXLParseContext |
Macros | |
#define | UNCHECKED_BITSTREAM_READER 0 |
JPEG XL parser Copyright (c) 2023 Leo Izen leo.i zen@ gmail .comMore... | |
#define | BITSTREAM_READER_LE |
#define | JXL_FLAG_NOISE 1 |
#define | JXL_FLAG_PATCHES 2 |
#define | JXL_FLAG_SPLINES 16 |
#define | JXL_FLAG_USE_LF_FRAME 32 |
#define | JXL_FLAG_SKIP_ADAPTIVE_LF_SMOOTH 128 |
#define | MAX_PREFIX_ALPHABET_SIZE (1u << 15) |
#define | clog1p(x) (ff_log2(x) + !!(x)) |
#define | unpack_signed(x) (((x) & 1 ? -(x)-1 : (x))/2) |
#define | div_ceil(x, y) (((x) - 1) / (y) + 1) |
#define | vlm(a, b) {.sym = (a), .len = (b)} |
Functions | |
static av_always_inline uint8_t | jxl_u8 (GetBitContext *gb) |
Read a variable-length 8-bit integer. More... | |
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 uint64_t | jxl_u64 (GetBitContext *gb) |
static int | read_hybrid_uint_conf (GetBitContext *gb, JXLHybridUintConf *conf, int log_alphabet_size) |
static int | read_hybrid_uint (GetBitContext *gb, const JXLHybridUintConf *conf, uint32_t token, uint32_t *hybrid_uint) |
static uint32_t | read_prefix_symbol (GetBitContext *gb, const JXLSymbolDistribution *dist) |
static uint32_t | read_ans_symbol (GetBitContext *gb, JXLEntropyDecoder *dec, const JXLSymbolDistribution *dist) |
static int | decode_hybrid_varlen_uint (GetBitContext *gb, JXLEntropyDecoder *dec, const JXLDistributionBundle *bundle, uint32_t context, uint32_t *hybrid_uint) |
static int | populate_distribution (GetBitContext *gb, JXLSymbolDistribution *dist, int log_alphabet_size) |
static void | dist_bundle_close (JXLDistributionBundle *bundle) |
static int | read_distribution_bundle (GetBitContext *gb, JXLEntropyDecoder *dec, JXLDistributionBundle *bundle, int num_dist, int disallow_lz77) |
static int | read_dist_clustering (GetBitContext *gb, JXLEntropyDecoder *dec, JXLDistributionBundle *bundle) |
static int | gen_alias_map (JXLEntropyDecoder *dec, JXLSymbolDistribution *dist, int log_alphabet_size) |
static int | read_simple_vlc_prefix (GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolDistribution *dist) |
static int | read_vlc_prefix (GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolDistribution *dist) |
static void | entropy_decoder_close (JXLEntropyDecoder *dec) |
static int | entropy_decoder_init (void *avctx, GetBitContext *gb, JXLEntropyDecoder *dec, int num_dist) |
static int64_t | entropy_decoder_read_symbol (GetBitContext *gb, JXLEntropyDecoder *dec, uint32_t context) |
static uint32_t | icc_context (uint64_t i, uint32_t b1, uint32_t b2) |
static uint32_t | toc_context (uint32_t x) |
static void | populate_fields (AVCodecParserContext *s, AVCodecContext *avctx, const FFJXLMetadata *meta) |
static int | skip_icc_profile (void *avctx, JXLParseContext *ctx, GetBitContext *gb) |
static int | skip_extensions (GetBitContext *gb) |
static int | parse_frame_header (void *avctx, JXLParseContext *ctx, GetBitContext *gb) |
static int | skip_boxes (JXLParseContext *ctx, const uint8_t *buf, int buf_size) |
static int | try_parse (AVCodecParserContext *s, AVCodecContext *avctx, JXLParseContext *ctx, const uint8_t *buf, int buf_size) |
static int | jpegxl_parse (AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) |
Variables | |
static const VLCElem | level0_table [16] |
static const VLCElem | dist_prefix_table [128] |
static const uint8_t | prefix_codelen_map [18] |
const AVCodecParser | ff_jpegxl_parser |
#define UNCHECKED_BITSTREAM_READER 0 |
JPEG XL parser Copyright (c) 2023 Leo Izen leo.i zen@ gmail .com
This file is part of FFmpeg.
FFmpeg is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
FFmpeg is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with FFmpeg; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Definition at line 35 of file jpegxl_parser.c.
#define BITSTREAM_READER_LE |
Definition at line 36 of file jpegxl_parser.c.
#define JXL_FLAG_NOISE 1 |
Definition at line 43 of file jpegxl_parser.c.
#define JXL_FLAG_PATCHES 2 |
Definition at line 44 of file jpegxl_parser.c.
#define JXL_FLAG_SPLINES 16 |
Definition at line 45 of file jpegxl_parser.c.
#define JXL_FLAG_USE_LF_FRAME 32 |
Definition at line 46 of file jpegxl_parser.c.
#define JXL_FLAG_SKIP_ADAPTIVE_LF_SMOOTH 128 |
Definition at line 47 of file jpegxl_parser.c.
#define MAX_PREFIX_ALPHABET_SIZE (1u << 15) |
Definition at line 49 of file jpegxl_parser.c.
#define clog1p | ( | x | ) | (ff_log2(x) + !!(x)) |
Definition at line 51 of file jpegxl_parser.c.
#define unpack_signed | ( | x | ) | (((x) & 1 ? -(x)-1 : (x))/2) |
Definition at line 52 of file jpegxl_parser.c.
#define div_ceil | ( | x, | |
y | |||
) | (((x) - 1) / (y) + 1) |
Definition at line 53 of file jpegxl_parser.c.
|
static |
Read a variable-length 8-bit integer.
Used when populating the ANS frequency tables.
Definition at line 202 of file jpegxl_parser.c.
Referenced by populate_distribution().
|
static |
Definition at line 213 of file jpegxl_parser.c.
Referenced by parse_frame_header(), and read_distribution_bundle().
|
static |
Definition at line 229 of file jpegxl_parser.c.
Referenced by parse_frame_header(), skip_extensions(), and skip_icc_profile().
|
static |
Definition at line 259 of file jpegxl_parser.c.
Referenced by read_distribution_bundle().
|
static |
Definition at line 277 of file jpegxl_parser.c.
Referenced by decode_hybrid_varlen_uint().
|
inlinestatic |
Definition at line 299 of file jpegxl_parser.c.
Referenced by decode_hybrid_varlen_uint().
|
static |
Definition at line 307 of file jpegxl_parser.c.
Referenced by decode_hybrid_varlen_uint().
|
static |
Definition at line 327 of file jpegxl_parser.c.
Referenced by entropy_decoder_read_symbol(), and read_dist_clustering().
|
static |
Definition at line 382 of file jpegxl_parser.c.
Referenced by read_distribution_bundle().
|
static |
Definition at line 482 of file jpegxl_parser.c.
Referenced by entropy_decoder_close(), and read_dist_clustering().
|
static |
Definition at line 831 of file jpegxl_parser.c.
Referenced by entropy_decoder_init(), and read_dist_clustering().
|
static |
Definition at line 495 of file jpegxl_parser.c.
Referenced by read_distribution_bundle().
|
static |
Definition at line 565 of file jpegxl_parser.c.
Referenced by read_distribution_bundle().
|
static |
Definition at line 627 of file jpegxl_parser.c.
Referenced by read_vlc_prefix().
|
static |
Definition at line 685 of file jpegxl_parser.c.
Referenced by read_distribution_bundle().
|
static |
Definition at line 917 of file jpegxl_parser.c.
Referenced by entropy_decoder_init(), parse_frame_header(), and skip_icc_profile().
|
static |
Definition at line 925 of file jpegxl_parser.c.
Referenced by parse_frame_header(), and skip_icc_profile().
|
static |
Definition at line 942 of file jpegxl_parser.c.
Referenced by parse_frame_header(), and skip_icc_profile().
|
inlinestatic |
Definition at line 954 of file jpegxl_parser.c.
Referenced by skip_icc_profile().
|
inlinestatic |
Definition at line 988 of file jpegxl_parser.c.
Referenced by parse_frame_header().
|
static |
Definition at line 993 of file jpegxl_parser.c.
Referenced by try_parse().
|
static |
Definition at line 1079 of file jpegxl_parser.c.
Referenced by try_parse().
|
static |
Definition at line 1139 of file jpegxl_parser.c.
Referenced by parse_frame_header().
|
static |
Definition at line 1164 of file jpegxl_parser.c.
Referenced by try_parse().
|
static |
Definition at line 1353 of file jpegxl_parser.c.
Referenced by jpegxl_parse().
|
static |
Definition at line 1399 of file jpegxl_parser.c.
Referenced by jpegxl_parse().
|
static |
Definition at line 1472 of file jpegxl_parser.c.
|
static |
|
static |
Definition at line 175 of file jpegxl_parser.c.
Referenced by populate_distribution().
|
static |
Definition at line 194 of file jpegxl_parser.c.
Referenced by read_vlc_prefix().
const AVCodecParser ff_jpegxl_parser |
Definition at line 1536 of file jpegxl_parser.c.