FFmpeg
Data Structures | Macros | Functions | Variables
ljpegenc.c File Reference
#include "libavutil/frame.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "jpegtables.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 FFCodec 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 296 of file ljpegenc.c.

◆ VE

Definition at line 297 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 59 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 121 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 186 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 208 of file ljpegenc.c.

◆ ljpeg_encode_close()

static av_cold int ljpeg_encode_close ( AVCodecContext avctx)
static

Definition at line 261 of file ljpegenc.c.

◆ ljpeg_encode_init()

static av_cold int ljpeg_encode_init ( AVCodecContext avctx)
static

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

Definition at line 298 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 307 of file ljpegenc.c.

◆ ff_ljpeg_encoder

const FFCodec ff_ljpeg_encoder
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
ljpeg_encode_init
static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
Definition: ljpegenc.c:270
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:686
LJpegEncContext
Definition: ljpegenc.c:44
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:76
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:102
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:320
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:86
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
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:73
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
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:87
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_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:85
ljpeg_encode_frame
static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition: ljpegenc.c:208
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
ljpeg_encode_close
static av_cold int ljpeg_encode_close(AVCodecContext *avctx)
Definition: ljpegenc.c:261
ljpeg_class
static const AVClass ljpeg_class
Definition: ljpegenc.c:307
AV_PIX_FMT_BGR0
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:265
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: ljpegenc.c:298
OFFSET
#define OFFSET(x)
Definition: ljpegenc.c:296
VE
#define VE
Definition: ljpegenc.c:297
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:669
pred
static const float pred[4]
Definition: siprdata.h:259
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
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:78
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:77
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
AV_CODEC_ID_LJPEG
@ AV_CODEC_ID_LJPEG
Definition: codec_id.h:61