FFmpeg
Data Structures | Macros | Functions | Variables
sunrastenc.c File Reference
#include "libavutil/opt.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "encode.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
 
const FFCodec 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 196 of file sunrastenc.c.

◆ VE

Definition at line 197 of file sunrastenc.c.

Function Documentation

◆ sunrast_image_write_header()

static void sunrast_image_write_header ( AVCodecContext avctx)
static

Definition at line 42 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 56 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 140 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 173 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 },
}

Definition at line 198 of file sunrastenc.c.

◆ sunrast_class

const AVClass sunrast_class
static
Initial value:
= {
.class_name = "sunrast",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 204 of file sunrastenc.c.

◆ ff_sunrast_encoder

const FFCodec ff_sunrast_encoder
Initial value:
= {
.p.name = "sunrast",
.p.long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(SUNRASTContext),
.p.priv_class = &sunrast_class,
.p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 211 of file sunrastenc.c.

AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
AV_PIX_FMT_MONOWHITE
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
Definition: pixfmt.h:75
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
init
static int init
Definition: av_tx.c:47
options
static const AVOption options[]
Definition: sunrastenc.c:198
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:263
SUNRASTContext
Definition: sunrastenc.c:30
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
sunrast_encode_init
static av_cold int sunrast_encode_init(AVCodecContext *avctx)
Definition: sunrastenc.c:140
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
OFFSET
#define OFFSET(x)
Definition: sunrastenc.c:196
VE
#define VE
Definition: sunrastenc.c:197
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
sunrast_encode_frame
static int sunrast_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: sunrastenc.c:173
FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: codec_internal.h:31
AV_PIX_FMT_PAL8
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:77
sunrast_class
static const AVClass sunrast_class
Definition: sunrastenc.c:204
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_CODEC_ID_SUNRAST
@ AV_CODEC_ID_SUNRAST
Definition: codec_id.h:160