Libav
Data Structures | Macros | Functions | Variables
ljpegenc.c File Reference

lossless JPEG encoder. More...

#include "libavutil/frame.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "idctdsp.h"
#include "internal.h"
#include "jpegtables.h"
#include "mjpegenc_common.h"
#include "mjpeg.h"
#include "mjpegenc.h"

Go to the source code of this file.

Data Structures

struct  LJpegEncContext
 

Macros

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

Functions

static int ljpeg_encode_bgr (AVCodecContext *avctx, PutBitContext *pb, const AVFrame *frame)
 
static void ljpeg_encode_yuv_mb (LJpegEncContext *s, PutBitContext *pb, const AVFrame *frame, int predictor, int mb_x, int mb_y)
 
static int ljpeg_encode_yuv (AVCodecContext *avctx, PutBitContext *pb, const AVFrame *frame)
 
static int ljpeg_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
 
static av_cold int ljpeg_encode_close (AVCodecContext *avctx)
 
static av_cold int ljpeg_encode_init (AVCodecContext *avctx)
 

Variables

static const AVOption options []
 
static const AVClass ljpeg_class
 
AVCodec ff_ljpeg_encoder
 

Detailed Description

lossless JPEG encoder.

Definition in file ljpegenc.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 333 of file ljpegenc.c.

◆ VE

Definition at line 334 of file ljpegenc.c.

Function Documentation

◆ ljpeg_encode_bgr()

static int ljpeg_encode_bgr ( AVCodecContext avctx,
PutBitContext pb,
const AVFrame frame 
)
static

Definition at line 63 of file ljpegenc.c.

Referenced by ljpeg_encode_frame().

◆ ljpeg_encode_yuv_mb()

static void ljpeg_encode_yuv_mb ( LJpegEncContext s,
PutBitContext pb,
const AVFrame frame,
int  predictor,
int  mb_x,
int  mb_y 
)
inlinestatic

Definition at line 124 of file ljpegenc.c.

Referenced by ljpeg_encode_yuv().

◆ ljpeg_encode_yuv()

static int ljpeg_encode_yuv ( AVCodecContext avctx,
PutBitContext pb,
const AVFrame frame 
)
static

Definition at line 189 of file ljpegenc.c.

Referenced by ljpeg_encode_frame().

◆ ljpeg_encode_frame()

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

Definition at line 218 of file ljpegenc.c.

◆ ljpeg_encode_close()

static av_cold int ljpeg_encode_close ( AVCodecContext avctx)
static

Definition at line 267 of file ljpegenc.c.

◆ ljpeg_encode_init()

static av_cold int ljpeg_encode_init ( AVCodecContext avctx)
static

Definition at line 276 of file ljpegenc.c.

Variable Documentation

◆ options

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

Definition at line 335 of file ljpegenc.c.

◆ ljpeg_class

const AVClass ljpeg_class
static
Initial value:
= {
.class_name = "ljpeg",
.item_name = av_default_item_name,
.option = options,
}
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
av_default_item_name
Definition: dnxhdenc.c:55
static const AVOption options[]
Definition: ljpegenc.c:335

Definition at line 344 of file ljpegenc.c.

◆ ff_ljpeg_encoder

AVCodec ff_ljpeg_encoder
Initial value:
= {
.name = "ljpeg",
.long_name = NULL_IF_CONFIG_SMALL("Lossless JPEG"),
.priv_data_size = sizeof(LJpegEncContext),
.priv_class = &ljpeg_class,
.encode2 = ljpeg_encode_frame,
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:64
static const AVClass ljpeg_class
Definition: ljpegenc.c:344
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:72
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:148
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:63
static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition: ljpegenc.c:218
static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
Definition: ljpegenc.c:276
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:71
static av_cold int ljpeg_encode_close(AVCodecContext *avctx)
Definition: ljpegenc.c:267
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:62
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:257
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:59
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:73
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:582
AVPixelFormat
Pixel format.
Definition: pixfmt.h:57

Definition at line 351 of file ljpegenc.c.