FFmpeg
Macros | Functions | Variables
sgirledec.c File Reference
#include "libavutil/common.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"

Go to the source code of this file.

Macros

#define RBG323_TO_BGR8(x)
 Convert SGI RBG323 pixel into AV_PIX_FMT_BGR8 SGI RGB data is packed as 8bpp, (msb)3R 2B 3G(lsb) More...
 
#define INC_XY(n)
 

Functions

static av_cold int sgirle_decode_init (AVCodecContext *avctx)
 
static av_always_inline void rbg323_to_bgr8 (uint8_t *dst, const uint8_t *src, int size)
 
static int decode_sgirle8 (AVCodecContext *avctx, uint8_t *dst, const uint8_t *src, int src_size, int width, int height, ptrdiff_t linesize)
 
static int sgirle_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 

Variables

const FFCodec ff_sgirle_decoder
 

Detailed Description

Silicon Graphics RLE 8-bit video decoder

Note
Data is packed in rbg323 with rle, contained in mv or mov. The algorithm and pixfmt are subtly different from SGI images.

Definition in file sgirledec.c.

Macro Definition Documentation

◆ RBG323_TO_BGR8

#define RBG323_TO_BGR8 (   x)
Value:
((((x) << 3) & 0xC0) | \
(((x) << 3) & 0x38) | \
(((x) >> 5) & 7))

Convert SGI RBG323 pixel into AV_PIX_FMT_BGR8 SGI RGB data is packed as 8bpp, (msb)3R 2B 3G(lsb)

Definition at line 45 of file sgirledec.c.

◆ INC_XY

#define INC_XY (   n)
Value:
x += n; \
if (x >= width) { \
y++; \
if (y >= height) \
return 0; \
x = 0; \
}

Function Documentation

◆ sgirle_decode_init()

static av_cold int sgirle_decode_init ( AVCodecContext avctx)
static

Definition at line 35 of file sgirledec.c.

◆ rbg323_to_bgr8()

static av_always_inline void rbg323_to_bgr8 ( uint8_t *  dst,
const uint8_t *  src,
int  size 
)
static

Definition at line 49 of file sgirledec.c.

Referenced by decode_sgirle8().

◆ decode_sgirle8()

static int decode_sgirle8 ( AVCodecContext avctx,
uint8_t *  dst,
const uint8_t *  src,
int  src_size,
int  width,
int  height,
ptrdiff_t  linesize 
)
static
Parameters
[out]dstDestination buffer
[in]srcSource buffer
src_sizeSource buffer size (bytes)
widthWidth of destination buffer (pixels)
heightHeight of destination buffer (pixels)
linesizeLine size of destination buffer (bytes)
Returns
<0 on error

Definition at line 66 of file sgirledec.c.

Referenced by sgirle_decode_frame().

◆ sgirle_decode_frame()

static int sgirle_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 113 of file sgirledec.c.

Variable Documentation

◆ ff_sgirle_decoder

const FFCodec ff_sgirle_decoder
Initial value:
= {
.p.name = "sgirle",
CODEC_LONG_NAME("Silicon Graphics RLE 8-bit video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 134 of file sgirledec.c.

sgirle_decode_init
static av_cold int sgirle_decode_init(AVCodecContext *avctx)
Definition: sgirledec.c:35
width
#define width
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
height
#define height
sgirle_decode_frame
static int sgirle_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: sgirledec.c:113
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_CODEC_ID_SGIRLE
@ AV_CODEC_ID_SGIRLE
Definition: codec_id.h:235