FFmpeg
Loading...
Searching...
No Matches
ljpegenc.c File Reference

lossless JPEG encoder. More...

#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)
 
#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)
Value:

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},
}
#define VE
Definition amfenc_av1.c:30
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
static const float pred[4]
Definition siprdata.h:259

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,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 307 of file ljpegenc.c.

◆ ff_ljpeg_encoder

const FFCodec ff_ljpeg_encoder
Initial value:
= {
.p.name = "ljpeg",
CODEC_LONG_NAME("Lossless JPEG"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(LJpegEncContext),
.p.priv_class = &ljpeg_class,
}
#define CODEC_PIXFMTS(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
#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:147
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition codec.h:98
@ AV_CODEC_ID_LJPEG
Definition codec_id.h:59
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int ljpeg_encode_close(AVCodecContext *avctx)
Definition ljpegenc.c:261
static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
Definition ljpegenc.c:270
static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition ljpegenc.c:208
static const AVClass ljpeg_class
Definition ljpegenc.c:307
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition pixfmt.h:766
@ AVCOL_RANGE_JPEG
Full range content.
Definition pixfmt.h:783
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition pixfmt.h:265
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:77
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition pixfmt.h:102
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
@ 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_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition pixfmt.h:76
@ 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_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

Definition at line 314 of file ljpegenc.c.