FFmpeg  4.0
Data Structures | Macros | Functions | Variables
sunrastenc.c File Reference
#include "libavutil/opt.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "sunrast.h"

Go to the source code of this file.

Data Structures

struct  SUNRASTContext
 

Macros

#define GET_VALUE   y >= avctx->height ? 0 : x >= len ? ptr[len-1] : ptr[x]
 
#define OFFSET(x)   offsetof(SUNRASTContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static void sunrast_image_write_header (AVCodecContext *avctx)
 
static void sunrast_image_write_image (AVCodecContext *avctx, const uint8_t *pixels, const uint32_t *palette_data, int linesize)
 
static av_cold int sunrast_encode_init (AVCodecContext *avctx)
 
static int sunrast_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 

Variables

static const AVOption options []
 
static const AVClass sunrast_class
 
static const AVCodecDefault sunrast_defaults []
 
AVCodec ff_sunrast_encoder
 

Macro Definition Documentation

◆ GET_VALUE

#define GET_VALUE   y >= avctx->height ? 0 : x >= len ? ptr[len-1] : ptr[x]

◆ OFFSET

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

Definition at line 212 of file sunrastenc.c.

◆ VE

Definition at line 213 of file sunrastenc.c.

Function Documentation

◆ sunrast_image_write_header()

static void sunrast_image_write_header ( AVCodecContext avctx)
static

Definition at line 41 of file sunrastenc.c.

Referenced by sunrast_encode_frame().

◆ sunrast_image_write_image()

static void sunrast_image_write_image ( AVCodecContext avctx,
const uint8_t pixels,
const uint32_t *  palette_data,
int  linesize 
)
static

Definition at line 55 of file sunrastenc.c.

Referenced by sunrast_encode_frame().

◆ sunrast_encode_init()

static av_cold int sunrast_encode_init ( AVCodecContext avctx)
static

Definition at line 139 of file sunrastenc.c.

◆ sunrast_encode_frame()

static int sunrast_encode_frame ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int got_packet_ptr 
)
static

Definition at line 188 of file sunrastenc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "rle", "Use run-length compression", OFFSET(type), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define VE
Definition: sunrastenc.c:213
cl_device_type type
#define OFFSET(x)
Definition: sunrastenc.c:212

Definition at line 214 of file sunrastenc.c.

◆ sunrast_class

const AVClass sunrast_class
static
Initial value:
= {
.class_name = "sunrast",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption options[]
Definition: sunrastenc.c:214

Definition at line 220 of file sunrastenc.c.

◆ sunrast_defaults

const AVCodecDefault sunrast_defaults[]
static
Initial value:
= {
{ "coder", "rle" },
{ NULL },
}
#define NULL
Definition: coverity.c:32

Definition at line 228 of file sunrastenc.c.

◆ ff_sunrast_encoder

AVCodec ff_sunrast_encoder
Initial value:
= {
.name = "sunrast",
.long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
.priv_data_size = sizeof(SUNRASTContext),
.priv_class = &sunrast_class,
}
static const AVCodecDefault sunrast_defaults[]
Definition: sunrastenc.c:228
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static int sunrast_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: sunrastenc.c:188
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:73
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVCodecDefault defaults[]
Definition: amfenc_h264.c:361
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:65
static av_cold int sunrast_encode_init(AVCodecContext *avctx)
Definition: sunrastenc.c:139
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:266
Y , 8bpp.
Definition: pixfmt.h:70
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:71
static const AVClass sunrast_class
Definition: sunrastenc.c:220
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 234 of file sunrastenc.c.