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 "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
 
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 334 of file ljpegenc.c.

◆ VE

Definition at line 335 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 64 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 133 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 198 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 227 of file ljpegenc.c.

◆ ljpeg_encode_close()

static av_cold int ljpeg_encode_close ( AVCodecContext avctx)
static

Definition at line 281 of file ljpegenc.c.

◆ ljpeg_encode_init()

static av_cold int ljpeg_encode_init ( AVCodecContext avctx)
static

Definition at line 290 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 336 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 345 of file ljpegenc.c.

◆ ff_ljpeg_encoder

AVCodec ff_ljpeg_encoder
Initial value:

Definition at line 352 of file ljpegenc.c.

AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
ljpeg_encode_init
static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
Definition: ljpegenc.c:290
LJpegEncContext
Definition: ljpegenc.c:46
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
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:309
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:108
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:227
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:281
ljpeg_class
static const AVClass ljpeg_class
Definition: ljpegenc.c:345
AV_PIX_FMT_BGR0
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:240
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:336
OFFSET
#define OFFSET(x)
Definition: ljpegenc.c:334
VE
#define VE
Definition: ljpegenc.c:335
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:225
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:234
AV_CODEC_ID_LJPEG
@ AV_CODEC_ID_LJPEG
Definition: codec_id.h:58