FFmpeg
Data Structures | Macros | Functions | Variables
smc.c File Reference
#include <string.h>
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"

Go to the source code of this file.

Data Structures

struct  SmcContext
 

Macros

#define CPAIR   2
 
#define CQUAD   4
 
#define COCTET   8
 
#define COLORS_PER_TABLE   256
 
#define GET_BLOCK_COUNT()   (opcode & 0x10) ? (1 + bytestream2_get_byte(gb)) : 1 + (opcode & 0x0F);
 
#define ADVANCE_BLOCK()
 

Functions

static int smc_decode_stream (SmcContext *s, GetByteContext *gb)
 
static av_cold int smc_decode_init (AVCodecContext *avctx)
 
static int smc_decode_frame (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
 
static av_cold int smc_decode_end (AVCodecContext *avctx)
 

Variables

const FFCodec ff_smc_decoder
 

Detailed Description

QT SMC Video Decoder by Mike Melanson (melan.nosp@m.son@.nosp@m.pcisy.nosp@m.s.ne.nosp@m.t) For more information about the SMC format, visit: http://www.pcisys.net/~melanson/codecs/

The SMC decoder outputs PAL8 colorspace data.

Definition in file smc.c.

Macro Definition Documentation

◆ CPAIR

#define CPAIR   2

Definition at line 38 of file smc.c.

◆ CQUAD

#define CQUAD   4

Definition at line 39 of file smc.c.

◆ COCTET

#define COCTET   8

Definition at line 40 of file smc.c.

◆ COLORS_PER_TABLE

#define COLORS_PER_TABLE   256

Definition at line 42 of file smc.c.

◆ GET_BLOCK_COUNT

#define GET_BLOCK_COUNT ( )    (opcode & 0x10) ? (1 + bytestream2_get_byte(gb)) : 1 + (opcode & 0x0F);

Definition at line 57 of file smc.c.

◆ ADVANCE_BLOCK

#define ADVANCE_BLOCK ( )
Value:
{ \
pixel_ptr += 4; \
if (pixel_ptr >= width) \
{ \
pixel_ptr = 0; \
row_ptr += stride * 4; \
} \
total_blocks--; \
if (total_blocks < !!n_blocks) \
{ \
av_log(s->avctx, AV_LOG_ERROR, "block counter just went negative (this should not happen)\n"); \
} \
}

Definition at line 60 of file smc.c.

Function Documentation

◆ smc_decode_stream()

static int smc_decode_stream ( SmcContext s,
GetByteContext gb 
)
static

Definition at line 76 of file smc.c.

Referenced by smc_decode_frame().

◆ smc_decode_init()

static av_cold int smc_decode_init ( AVCodecContext avctx)
static

Definition at line 410 of file smc.c.

◆ smc_decode_frame()

static int smc_decode_frame ( AVCodecContext avctx,
AVFrame rframe,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 424 of file smc.c.

◆ smc_decode_end()

static av_cold int smc_decode_end ( AVCodecContext avctx)
static

Definition at line 462 of file smc.c.

Variable Documentation

◆ ff_smc_decoder

const FFCodec ff_smc_decoder
Initial value:
= {
.p.name = "smc",
CODEC_LONG_NAME("QuickTime Graphics (SMC)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_SMC,
.priv_data_size = sizeof(SmcContext),
.close = smc_decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 471 of file smc.c.

SmcContext
Definition: smc.c:44
smc_decode_frame
static int smc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition: smc.c:424
smc_decode_init
static av_cold int smc_decode_init(AVCodecContext *avctx)
Definition: smc.c:410
AV_CODEC_ID_SMC
@ AV_CODEC_ID_SMC
Definition: codec_id.h:101
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
width
#define width
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
s
#define s(width, name)
Definition: cbs_vp9.c:198
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:366
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
stride
#define stride
Definition: h264pred_template.c:537
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
smc_decode_end
static av_cold int smc_decode_end(AVCodecContext *avctx)
Definition: smc.c:462