FFmpeg
|
#include <string.h>
#include "libavutil/avutil.h"
#include "libavutil/csp.h"
#include "libavutil/error.h"
#include "libavutil/frame.h"
#include "libavutil/libm.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "libavutil/version.h"
#include "avcodec.h"
#include "encode.h"
#include "codec_internal.h"
#include <jxl/encode.h>
#include <jxl/thread_parallel_runner.h>
#include "libjxl.h"
Go to the source code of this file.
Data Structures | |
struct | LibJxlEncodeContext |
Macros | |
#define | OFFSET(x) offsetof(LibJxlEncodeContext, x) |
#define | VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
Functions | |
static float | quality_to_distance (float quality) |
Map a quality setting for -qscale roughly from libjpeg quality numbers to libjxl's butteraugli distance for photographic content. More... | |
static int | libjxl_init_jxl_encoder (AVCodecContext *avctx) |
Initalize the encoder on a per-frame basis. More... | |
static av_cold int | libjxl_encode_init (AVCodecContext *avctx) |
Global encoder initialization. More... | |
static int | libjxl_populate_primaries (void *avctx, JxlColorEncoding *jxl_color, enum AVColorPrimaries prm) |
Populate a JxlColorEncoding with the given enum AVColorPrimaries. More... | |
static int | libjxl_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) |
Encode an entire frame. More... | |
static av_cold int | libjxl_encode_close (AVCodecContext *avctx) |
Variables | |
static const AVOption | libjxl_encode_options [] |
static const AVClass | libjxl_encode_class |
const FFCodec | ff_libjxl_encoder |
JPEG XL encoder using libjxl
Definition in file libjxlenc.c.
#define OFFSET | ( | x | ) | offsetof(LibJxlEncodeContext, x) |
Definition at line 471 of file libjxlenc.c.
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
Definition at line 472 of file libjxlenc.c.
Map a quality setting for -qscale roughly from libjpeg quality numbers to libjxl's butteraugli distance for photographic content.
Setting distance explicitly is preferred, but this will allow qscale to be used as a fallback.
This function is continuous and injective on [0, 100] which makes it monotonic.
quality | 0.0 to 100.0 quality setting, libjpeg quality |
Definition at line 75 of file libjxlenc.c.
Referenced by libjxl_init_jxl_encoder().
|
static |
Initalize the encoder on a per-frame basis.
All of these need to be set once each time the encoder is reset, which it must be each frame to make the image2 muxer work.
Definition at line 96 of file libjxlenc.c.
Referenced by libjxl_encode_frame().
|
static |
Global encoder initialization.
This only needs to be run once, not every frame.
Definition at line 162 of file libjxlenc.c.
|
static |
Populate a JxlColorEncoding with the given enum AVColorPrimaries.
Definition at line 195 of file libjxlenc.c.
Referenced by libjxl_encode_frame().
|
static |
Encode an entire frame.
Currently animation, is not supported by this encoder, so this will always reinitialize a new still image and encode a one-frame image (for image2 and image2pipe).
Definition at line 247 of file libjxlenc.c.
|
static |
Definition at line 450 of file libjxlenc.c.
|
static |
Definition at line 474 of file libjxlenc.c.
|
static |
Definition at line 484 of file libjxlenc.c.
const FFCodec ff_libjxl_encoder |
Definition at line 491 of file libjxlenc.c.