FFmpeg
Data Structures | Macros | Functions | Variables
jpeglsenc.c File Reference
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "encode.h"
#include "get_bits.h"
#include "put_bits.h"
#include "put_golomb.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 FFCodec 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 457 of file jpeglsenc.c.

◆ VE

Definition at line 458 of file jpeglsenc.c.

Function Documentation

◆ put_marker_byteu()

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

Definition at line 52 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 61 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 89 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 122 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 144 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 249 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 272 of file jpeglsenc.c.

◆ encode_jpegls_init()

static av_cold int encode_jpegls_init ( AVCodecContext avctx)
static

Definition at line 422 of file jpeglsenc.c.

◆ encode_jpegls_close()

static av_cold int encode_jpegls_close ( AVCodecContext avctx)
static

Definition at line 449 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, .unit = "pred" },
{ "left", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, .unit = "pred" },
{ "plane", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, .unit = "pred" },
{ "median", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, .unit = "pred" },
{ NULL},
}

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

◆ ff_jpegls_encoder

const FFCodec ff_jpegls_encoder
Initial value:

Definition at line 475 of file jpeglsenc.c.

AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
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: codec_internal.h:43
encode_jpegls_close
static av_cold int encode_jpegls_close(AVCodecContext *avctx)
Definition: jpeglsenc.c:449
JPEGLSContext
Definition: jpeglsenc.c:42
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:76
encode_jpegls_init
static av_cold int encode_jpegls_init(AVCodecContext *avctx)
Definition: jpeglsenc.c:422
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:462
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:320
VE
#define VE
Definition: jpeglsenc.c:458
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:159
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:110
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:237
OFFSET
#define OFFSET(x)
Definition: jpeglsenc.c:457
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:75
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
options
static const AVOption options[]
Definition: jpeglsenc.c:459
pred
static const float pred[4]
Definition: siprdata.h:259
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_CODEC_ID_JPEGLS
@ AV_CODEC_ID_JPEGLS
Definition: codec_id.h:63
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
encode_picture_ls
static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition: jpeglsenc.c:272
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
jpegls_class
static const AVClass jpegls_class
Definition: jpeglsenc.c:468
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299