FFmpeg
Loading...
Searching...
No Matches
sgienc.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "encode.h"
#include "sgi.h"
#include "rle.h"

Go to the source code of this file.

Data Structures

struct  SgiContext
 

Macros

#define SGI_SINGLE_CHAN   2
 
#define SGI_MULTI_CHAN   3
 
#define OFFSET(x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static av_cold int encode_init (AVCodecContext *avctx)
 
static int sgi_rle_encode (PutByteContext *pbc, const uint8_t *src, int w, int bpp)
 
static int encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 

Variables

static const AVOption options []
 
static const AVClass sgi_class
 
const FFCodec ff_sgi_encoder
 

Macro Definition Documentation

◆ SGI_SINGLE_CHAN

#define SGI_SINGLE_CHAN   2

Definition at line 33 of file sgienc.c.

Referenced by encode_frame().

◆ SGI_MULTI_CHAN

#define SGI_MULTI_CHAN   3

Definition at line 34 of file sgienc.c.

Referenced by encode_frame().

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(SgiContext, x)

Definition at line 263 of file sgienc.c.

◆ VE

Definition at line 264 of file sgienc.c.

Function Documentation

◆ encode_init()

static av_cold int encode_init ( AVCodecContext * avctx)
static

Definition at line 42 of file sgienc.c.

◆ sgi_rle_encode()

static int sgi_rle_encode ( PutByteContext * pbc,
const uint8_t * src,
int w,
int bpp )
static

Definition at line 54 of file sgienc.c.

Referenced by encode_frame().

◆ encode_frame()

static int encode_frame ( AVCodecContext * avctx,
AVPacket * pkt,
const AVFrame * frame,
int * got_packet )
static

Definition at line 95 of file sgienc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "rle", "Use run-length compression", OFFSET(rle), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
{ NULL },
}
#define VE
Definition amfenc_av1.c:30
#define NULL
Definition coverity.c:32
static int rle(uint8_t *dst, const uint8_t *src, int compressed_size, int uncompressed_size)
Definition exr.c:217
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258

Definition at line 265 of file sgienc.c.

◆ sgi_class

const AVClass sgi_class
static
Initial value:
= {
.class_name = "sgi",
.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 271 of file sgienc.c.

◆ ff_sgi_encoder

const FFCodec ff_sgi_encoder
Initial value:
= {
.p.name = "sgi",
CODEC_LONG_NAME("SGI image"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_SGI,
.priv_data_size = sizeof(SgiContext),
.p.priv_class = &sgi_class,
.init = encode_init,
}
static av_cold int encode_init(AVCodecContext *avctx)
Definition asvenc.c:373
#define CODEC_PIXFMTS(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame, AVPacket *pkt)
Definition ffmpeg_enc.c:694
#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_SGI
Definition codec_id.h:151
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
@ AV_PIX_FMT_GRAY16BE
Y , 16bpp, big-endian.
Definition pixfmt.h:104
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition pixfmt.h:75
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_RGB48BE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Definition pixfmt.h:109
@ AV_PIX_FMT_RGBA64BE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition pixfmt.h:202
@ AV_PIX_FMT_RGBA64LE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition pixfmt.h:203
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition pixfmt.h:100
@ AV_PIX_FMT_RGB48LE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
Definition pixfmt.h:110
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-endian.
Definition pixfmt.h:105
static const AVClass sgi_class
Definition sgienc.c:271

Definition at line 278 of file sgienc.c.