FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
smc.c File Reference

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/. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.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(&s->gb)) : 1 + (opcode & 0x0F);
 
#define ADVANCE_BLOCK()
 

Functions

static void smc_decode_stream (SmcContext *s)
 
static av_cold int smc_decode_init (AVCodecContext *avctx)
 
static int smc_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int smc_decode_end (AVCodecContext *avctx)
 

Variables

AVCodec 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

#define CPAIR   2

Definition at line 40 of file smc.c.

Referenced by smc_decode_stream().

#define CQUAD   4

Definition at line 41 of file smc.c.

Referenced by smc_decode_stream().

#define COCTET   8

Definition at line 42 of file smc.c.

Referenced by smc_decode_stream().

#define COLORS_PER_TABLE   256

Definition at line 44 of file smc.c.

Referenced by smc_decode_stream().

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

Definition at line 61 of file smc.c.

Referenced by smc_decode_stream().

#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_INFO, "warning: block counter just went negative (this should not happen)\n"); \
} \
}
const char * s
Definition: avisynth_c.h:768
#define av_log(a,...)
uint16_t width
Definition: gdv.c:47
return
#define AV_LOG_INFO
Standard information.
Definition: log.h:187
GLint GLenum GLboolean GLsizei stride
Definition: opengl_enc.c:105
if(ret< 0)
Definition: vf_mcdeint.c:279

Definition at line 64 of file smc.c.

Referenced by smc_decode_stream().

Function Documentation

static void smc_decode_stream ( SmcContext s)
static

Definition at line 80 of file smc.c.

Referenced by smc_decode_frame().

static av_cold int smc_decode_init ( AVCodecContext avctx)
static

Definition at line 417 of file smc.c.

static int smc_decode_frame ( AVCodecContext avctx,
void data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 431 of file smc.c.

static av_cold int smc_decode_end ( AVCodecContext avctx)
static

Definition at line 464 of file smc.c.

Variable Documentation

AVCodec ff_smc_decoder
Initial value:
= {
.name = "smc",
.long_name = NULL_IF_CONFIG_SMALL("QuickTime Graphics (SMC)"),
.priv_data_size = sizeof(SmcContext),
.close = smc_decode_end,
.capabilities = AV_CODEC_CAP_DR1,
}
static av_cold int smc_decode_init(AVCodecContext *avctx)
Definition: smc.c:417
Definition: smc.c:46
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static int smc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: smc.c:431
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static av_cold int smc_decode_end(AVCodecContext *avctx)
Definition: smc.c:464
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:1002

Definition at line 473 of file smc.c.