FFmpeg
Data Structures | Macros | Functions | Variables
ljpegenc.c File Reference
#include "libavutil/frame.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "encode.h"
#include "idctdsp.h"
#include "internal.h"
#include "jpegtables.h"
#include "mathops.h"
#include "mjpegenc_common.h"
#include "mjpeg.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
 
const 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 306 of file ljpegenc.c.

◆ VE

Definition at line 307 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 65 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 127 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 192 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 214 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},
}

Definition at line 308 of file ljpegenc.c.

◆ ljpeg_class

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

Definition at line 317 of file ljpegenc.c.

◆ ff_ljpeg_encoder

const AVCodec ff_ljpeg_encoder
Initial value:

Definition at line 324 of file ljpegenc.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
ljpeg_encode_init
static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
Definition: ljpegenc.c:276
LJpegEncContext
Definition: ljpegenc.c:47
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
init
static int init
Definition: av_tx.c:47
AV_PIX_FMT_YUVJ422P
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:296
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
AV_PIX_FMT_YUVJ444P
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
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_PIX_FMT_YUVJ420P
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
ljpeg_encode_frame
static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition: ljpegenc.c:214
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
ljpeg_encode_close
static av_cold int ljpeg_encode_close(AVCodecContext *avctx)
Definition: ljpegenc.c:267
ljpeg_class
static const AVClass ljpeg_class
Definition: ljpegenc.c:317
AV_PIX_FMT_BGR0
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:230
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
options
static const AVOption options[]
Definition: ljpegenc.c:308
OFFSET
#define OFFSET(x)
Definition: ljpegenc.c:306
VE
#define VE
Definition: ljpegenc.c:307
pred
static const float pred[4]
Definition: siprdata.h:259
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233
AV_CODEC_ID_LJPEG
@ AV_CODEC_ID_LJPEG
Definition: codec_id.h:59