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"
Include dependency graph for smc.c:

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()
 

Typedefs

typedef struct SmcContext SmcContext
 

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 ADVANCE_BLOCK ( )
Value:
{ \
pixel_ptr += 4; \
if (pixel_ptr >= width) \
{ \
pixel_ptr = 0; \
row_ptr += stride * 4; \
} \
total_blocks--; \
if (total_blocks < 0) \
{ \
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:668
int stride
Definition: mace.c:144
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:246
static int width
Definition: tests/utils.c:158
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return
#define AV_LOG_INFO
Definition: log.h:156

Definition at line 64 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 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 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().

Typedef Documentation

typedef struct SmcContext SmcContext

Function Documentation

static av_cold int smc_decode_end ( AVCodecContext avctx)
static

Definition at line 455 of file smc.c.

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

Definition at line 425 of file smc.c.

static av_cold int smc_decode_init ( AVCodecContext avctx)
static

Definition at line 413 of file smc.c.

static void smc_decode_stream ( SmcContext s)
static

Definition at line 80 of file smc.c.

Referenced by smc_decode_frame().

Variable Documentation

AVCodec ff_smc_decoder
Initial value:
= {
.name = "smc",
.priv_data_size = sizeof(SmcContext),
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("QuickTime Graphics (SMC)"),
}
static av_cold int smc_decode_init(AVCodecContext *avctx)
Definition: smc.c:413
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:425
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int smc_decode_end(AVCodecContext *avctx)
Definition: smc.c:455
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:375
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868
struct SmcContext SmcContext

Definition at line 464 of file smc.c.