FFmpeg
Data Structures | Macros | Functions | Variables
jpeglsenc.c File Reference
#include "libavutil/opt.h"
#include "avcodec.h"
#include "bytestream.h"
#include "encode.h"
#include "get_bits.h"
#include "put_bits.h"
#include "golomb.h"
#include "internal.h"
#include "mathops.h"
#include "mjpeg.h"
#include "jpegls.h"

Go to the source code of this file.

Data Structures

struct  JPEGLSContext
 

Macros

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

Functions

static void put_marker_byteu (PutByteContext *pb, enum JpegMarker code)
 
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 *tmp, const void *in, int last2, int w, int stride, int comp, int bits)
 Encode one line of image. More...
 
static void ls_store_lse (JLSState *state, PutByteContext *pb)
 
static int encode_picture_ls (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
 
static av_cold int encode_jpegls_init (AVCodecContext *avctx)
 
static av_cold int encode_jpegls_close (AVCodecContext *avctx)
 

Variables

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

Detailed Description

JPEG-LS encoder.

Definition in file jpeglsenc.c.

Macro Definition Documentation

◆ UNCHECKED_BITSTREAM_READER

#define UNCHECKED_BITSTREAM_READER   1

Definition at line 28 of file jpeglsenc.c.

◆ OFFSET

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

Definition at line 458 of file jpeglsenc.c.

◆ VE

Definition at line 459 of file jpeglsenc.c.

Function Documentation

◆ put_marker_byteu()

static void put_marker_byteu ( PutByteContext pb,
enum JpegMarker  code 
)
inlinestatic

Definition at line 51 of file jpeglsenc.c.

Referenced by encode_picture_ls(), and ls_store_lse().

◆ 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 60 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 88 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 121 of file jpeglsenc.c.

Referenced by ls_encode_line().

◆ ls_encode_line()

static void ls_encode_line ( JLSState state,
PutBitContext pb,
void *  tmp,
const void *  in,
int  last2,
int  w,
int  stride,
int  comp,
int  bits 
)
inlinestatic

Encode one line of image.

Definition at line 143 of file jpeglsenc.c.

Referenced by encode_picture_ls().

◆ ls_store_lse()

static void ls_store_lse ( JLSState state,
PutByteContext pb 
)
static

Definition at line 248 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 271 of file jpeglsenc.c.

◆ encode_jpegls_init()

static av_cold int encode_jpegls_init ( AVCodecContext avctx)
static

Definition at line 423 of file jpeglsenc.c.

◆ encode_jpegls_close()

static av_cold int encode_jpegls_close ( AVCodecContext avctx)
static

Definition at line 450 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},
}

Definition at line 460 of file jpeglsenc.c.

◆ jpegls_class

const AVClass jpegls_class
static
Initial value:
= {
.class_name = "jpegls",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 469 of file jpeglsenc.c.

◆ ff_jpegls_encoder

const AVCodec ff_jpegls_encoder
Initial value:

Definition at line 476 of file jpeglsenc.c.

FF_CODEC_CAP_INIT_THREADSAFE
#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:42
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
encode_jpegls_close
static av_cold int encode_jpegls_close(AVCodecContext *avctx)
Definition: jpeglsenc.c:450
JPEGLSContext
Definition: jpeglsenc.c:41
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
encode_jpegls_init
static av_cold int encode_jpegls_init(AVCodecContext *avctx)
Definition: jpeglsenc.c:423
init
static int init
Definition: av_tx.c:47
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:388
VE
#define VE
Definition: jpeglsenc.c:459
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:296
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:113
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
OFFSET
#define OFFSET(x)
Definition: jpeglsenc.c:458
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:68
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
FF_CODEC_CAP_INIT_CLEANUP
#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:50
options
static const AVOption options[]
Definition: jpeglsenc.c:460
pred
static const float pred[4]
Definition: siprdata.h:259
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_CODEC_ID_JPEGLS
@ AV_CODEC_ID_JPEGLS
Definition: codec_id.h:61
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
encode_picture_ls
static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition: jpeglsenc.c:271
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
jpegls_class
static const AVClass jpegls_class
Definition: jpeglsenc.c:469
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233