FFmpeg
Loading...
Searching...
No Matches
vmdvideo.c File Reference

Sierra VMD video decoder by Vladimir "VAG" Gneushev (vagsoft at mail.ru) for more information on the Sierra VMD format, visit: http://www.pcisys.net/~melanson/codecs/. More...

#include <string.h>
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "bytestream.h"

Go to the source code of this file.

Data Structures

struct  VmdVideoContext
 

Macros

#define VMD_HEADER_SIZE   0x330
 
#define PALETTE_COUNT   256
 
#define QUEUE_SIZE   0x1000
 
#define QUEUE_MASK   0x0FFF
 

Functions

static int lz_unpack (const unsigned char *src, int src_len, unsigned char *dest, int dest_len)
 
static int rle_unpack (const unsigned char *src, unsigned char *dest, int src_count, int src_size, int dest_len)
 
static int vmd_decode (VmdVideoContext *s, AVFrame *frame)
 
static av_cold int vmdvideo_decode_end (AVCodecContext *avctx)
 
static av_cold int vmdvideo_decode_init (AVCodecContext *avctx)
 
static int vmdvideo_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 

Variables

const FFCodec ff_vmdvideo_decoder
 

Detailed Description

Sierra VMD video decoder by Vladimir "VAG" Gneushev (vagsoft at mail.ru) for more information on the Sierra VMD format, visit: http://www.pcisys.net/~melanson/codecs/.

The video decoder outputs PAL8 colorspace data. The decoder expects a 0x330-byte VMD file header to be transmitted via extradata during codec initialization. Each encoded frame that is sent to this decoder is expected to be prepended with the appropriate 16-byte frame information record from the VMD file.

Definition in file vmdvideo.c.

Macro Definition Documentation

◆ VMD_HEADER_SIZE

#define VMD_HEADER_SIZE   0x330

Definition at line 47 of file vmdvideo.c.

Referenced by vmd_probe(), vmd_read_header(), and vmdvideo_decode_init().

◆ PALETTE_COUNT

#define PALETTE_COUNT   256

Definition at line 48 of file vmdvideo.c.

◆ QUEUE_SIZE

#define QUEUE_SIZE   0x1000

Definition at line 65 of file vmdvideo.c.

Referenced by lz_unpack().

◆ QUEUE_MASK

#define QUEUE_MASK   0x0FFF

Definition at line 66 of file vmdvideo.c.

Referenced by lz_unpack().

Function Documentation

◆ lz_unpack()

static int lz_unpack ( const unsigned char * src,
int src_len,
unsigned char * dest,
int dest_len )
static

Definition at line 68 of file vmdvideo.c.

Referenced by vmd_decode().

◆ rle_unpack()

static int rle_unpack ( const unsigned char * src,
unsigned char * dest,
int src_count,
int src_size,
int dest_len )
static

Definition at line 141 of file vmdvideo.c.

Referenced by vmd_decode().

◆ vmd_decode()

static int vmd_decode ( VmdVideoContext * s,
AVFrame * frame )
static

Definition at line 185 of file vmdvideo.c.

Referenced by vmdvideo_decode_frame().

◆ vmdvideo_decode_end()

static av_cold int vmdvideo_decode_end ( AVCodecContext * avctx)
static

Definition at line 377 of file vmdvideo.c.

◆ vmdvideo_decode_init()

static av_cold int vmdvideo_decode_init ( AVCodecContext * avctx)
static

Definition at line 388 of file vmdvideo.c.

◆ vmdvideo_decode_frame()

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

Definition at line 434 of file vmdvideo.c.

Variable Documentation

◆ ff_vmdvideo_decoder

const FFCodec ff_vmdvideo_decoder
Initial value:
= {
.p.name = "vmdvideo",
CODEC_LONG_NAME("Sierra VMD video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(VmdVideoContext),
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#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_VMDVIDEO
Definition codec_id.h:102
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int vmdvideo_decode_end(AVCodecContext *avctx)
Definition vmdvideo.c:377
static int vmdvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition vmdvideo.c:434
static av_cold int vmdvideo_decode_init(AVCodecContext *avctx)
Definition vmdvideo.c:388

Definition at line 467 of file vmdvideo.c.