FFmpeg
Loading...
Searching...
No Matches
sunrastenc.c File Reference
#include "libavutil/attributes.h"
#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)
 
#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)
Value:

Definition at line 197 of file sunrastenc.c.

◆ VE

Definition at line 198 of file sunrastenc.c.

Function Documentation

◆ sunrast_image_write_header()

static void sunrast_image_write_header ( AVCodecContext * avctx)
static

Definition at line 43 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 57 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 141 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 174 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 VE
Definition amfenc_av1.c:30
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
cl_device_type type

Definition at line 199 of file sunrastenc.c.

◆ sunrast_class

const AVClass sunrast_class
static
Initial value:
= {
.class_name = "sunrast",
.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 205 of file sunrastenc.c.

◆ ff_sunrast_encoder

const FFCodec ff_sunrast_encoder
Initial value:
= {
.p.name = "sunrast",
CODEC_LONG_NAME("Sun Rasterfile image"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(SUNRASTContext),
.p.priv_class = &sunrast_class,
}
#define CODEC_PIXFMTS(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#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
@ AV_CODEC_ID_SUNRAST
Definition codec_id.h:160
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition pixfmt.h:84
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition pixfmt.h:76
@ 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:82
static int sunrast_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition sunrastenc.c:174
static av_cold int sunrast_encode_init(AVCodecContext *avctx)
Definition sunrastenc.c:141
static const AVClass sunrast_class
Definition sunrastenc.c:205

Definition at line 212 of file sunrastenc.c.