FFmpeg  4.0
Data Structures | Macros | Functions | Variables
jpeglsenc.c File Reference

JPEG-LS encoder. More...

#include "avcodec.h"
#include "get_bits.h"
#include "put_bits.h"
#include "golomb.h"
#include "internal.h"
#include "mathops.h"
#include "mjpeg.h"
#include "mjpegenc.h"
#include "jpegls.h"

Go to the source code of this file.

Data Structures

struct  JPEGLSContext
 

Macros

#define OFFSET(x)   offsetof(JPEGLSContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static void ls_encode_regular (JLSState *state, PutBitContext *pb, int Q, int err)
 Encode error from regular symbol. More...
 
static void ls_encode_runterm (JLSState *state, PutBitContext *pb, int RItype, int err, int limit_add)
 Encode error from run termination. More...
 
static void ls_encode_run (JLSState *state, PutBitContext *pb, int run, int comp, int trail)
 Encode run value as specified by JPEG-LS standard. More...
 
static void ls_encode_line (JLSState *state, PutBitContext *pb, void *last, void *cur, int last2, int w, int stride, int comp, int bits)
 Encode one line of image. More...
 
static void ls_store_lse (JLSState *state, PutBitContext *pb)
 
static int encode_picture_ls (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
 
static av_cold int encode_init_ls (AVCodecContext *ctx)
 

Variables

static const AVOption options []
 
static const AVClass jpegls_class
 
AVCodec ff_jpegls_encoder
 

Detailed Description

JPEG-LS encoder.

Definition in file jpeglsenc.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(JPEGLSContext, x)

Definition at line 448 of file jpeglsenc.c.

◆ VE

Definition at line 449 of file jpeglsenc.c.

Function Documentation

◆ ls_encode_regular()

static void ls_encode_regular ( JLSState state,
PutBitContext pb,
int  Q,
int  err 
)
inlinestatic

Encode error from regular symbol.

Definition at line 47 of file jpeglsenc.c.

Referenced by ls_encode_line().

◆ ls_encode_runterm()

static void ls_encode_runterm ( JLSState state,
PutBitContext pb,
int  RItype,
int  err,
int  limit_add 
)
inlinestatic

Encode error from run termination.

Definition at line 75 of file jpeglsenc.c.

Referenced by ls_encode_line().

◆ ls_encode_run()

static void ls_encode_run ( JLSState state,
PutBitContext pb,
int  run,
int  comp,
int  trail 
)
inlinestatic

Encode run value as specified by JPEG-LS standard.

Definition at line 108 of file jpeglsenc.c.

Referenced by ls_encode_line().

◆ ls_encode_line()

static void ls_encode_line ( JLSState state,
PutBitContext pb,
void last,
void cur,
int  last2,
int  w,
int  stride,
int  comp,
int  bits 
)
inlinestatic

Encode one line of image.

Definition at line 130 of file jpeglsenc.c.

Referenced by encode_picture_ls().

◆ ls_store_lse()

static void ls_store_lse ( JLSState state,
PutBitContext pb 
)
static

Definition at line 233 of file jpeglsenc.c.

Referenced by encode_picture_ls().

◆ encode_picture_ls()

static int encode_picture_ls ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame pict,
int got_packet 
)
static

Definition at line 256 of file jpeglsenc.c.

◆ encode_init_ls()

static av_cold int encode_init_ls ( AVCodecContext ctx)
static

Definition at line 428 of file jpeglsenc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "pred", "Prediction method", OFFSET(pred), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE, "pred" },
{ "left", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "pred" },
{ "plane", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "pred" },
{ "median", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "pred" },
{ NULL},
}
#define NULL
Definition: coverity.c:32
#define VE
Definition: jpeglsenc.c:449
static const float pred[4]
Definition: siprdata.h:259
#define OFFSET(x)
Definition: jpeglsenc.c:448

Definition at line 450 of file jpeglsenc.c.

◆ jpegls_class

const AVClass jpegls_class
static
Initial value:
= {
.class_name = "jpegls",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption options[]
Definition: jpeglsenc.c:450

Definition at line 459 of file jpeglsenc.c.

◆ ff_jpegls_encoder

AVCodec ff_jpegls_encoder
Initial value:
= {
.name = "jpegls",
.long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"),
.priv_data_size = sizeof(JPEGLSContext),
.priv_class = &jpegls_class,
.encode2 = encode_picture_ls,
.pix_fmts = (const enum AVPixelFormat[]) {
},
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
}
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:48
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:64
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define AV_CODEC_CAP_INTRA_ONLY
Codec is intra only.
Definition: avcodec.h:1045
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:40
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition: jpeglsenc.c:256
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:1015
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:352
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:65
static const AVClass jpegls_class
Definition: jpeglsenc.c:459
static av_cold int encode_init_ls(AVCodecContext *ctx)
Definition: jpeglsenc.c:428
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:266
Y , 8bpp.
Definition: pixfmt.h:70
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 466 of file jpeglsenc.c.