FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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

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

Definition at line 336 of file ljpegenc.c.

Definition at line 337 of file ljpegenc.c.

Function Documentation

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().

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

Referenced by ljpeg_encode_yuv().

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

Definition at line 197 of file ljpegenc.c.

Referenced by ljpeg_encode_frame().

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

Definition at line 226 of file ljpegenc.c.

static av_cold int ljpeg_encode_close ( AVCodecContext avctx)
static

Definition at line 280 of file ljpegenc.c.

Referenced by ljpeg_encode_init().

static av_cold int ljpeg_encode_init ( AVCodecContext avctx)
static

Definition at line 289 of file ljpegenc.c.

Variable Documentation

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},
}
#define NULL
Definition: coverity.c:32
static const float pred[4]
Definition: siprdata.h:259
#define OFFSET(x)
Definition: ljpegenc.c:336
#define VE
Definition: ljpegenc.c:337

Definition at line 338 of file ljpegenc.c.

const AVClass ljpeg_class
static
Initial value:
= {
.class_name = "ljpeg",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
av_default_item_name
static const AVOption options[]
Definition: ljpegenc.c:338

Definition at line 347 of file ljpegenc.c.

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,
.pix_fmts = (const enum AVPixelFormat[]){
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:67
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static const AVClass ljpeg_class
Definition: ljpegenc.c:347
#define AV_CODEC_CAP_INTRA_ONLY
Codec is intra only.
Definition: avcodec.h:1087
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:75
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:96
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:1057
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:66
static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition: ljpegenc.c:226
static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
Definition: ljpegenc.c:289
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:74
static av_cold int ljpeg_encode_close(AVCodecContext *avctx)
Definition: ljpegenc.c:280
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:65
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:254
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:262
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:76
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 354 of file ljpegenc.c.