interplayvideo.c File Reference

Interplay MVE Video Decoder by Mike Melanson (melan.nosp@m.son@.nosp@m.pcisy.nosp@m.s.ne.nosp@m.t) For more information about the Interplay MVE format, visit: http://www.pcisys.net/~melanson/codecs/interplay-mve.txt This code is written in such a way that the identifiers match up with the encoding descriptions in the document. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "avcodec.h"
#include "bytestream.h"
#include "hpeldsp.h"
#include "get_bits.h"
#include "internal.h"
Include dependency graph for interplayvideo.c:

Go to the source code of this file.

Data Structures

struct  IpvideoContext
 

Macros

#define BITSTREAM_READER_LE
 
#define PALETTE_COUNT   256
 

Typedefs

typedef struct IpvideoContext IpvideoContext
 

Functions

static int copy_from (IpvideoContext *s, AVFrame *src, AVFrame *dst, int delta_x, int delta_y)
 
static int ipvideo_decode_block_opcode_0x0 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x1 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x2 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x3 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x4 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x5 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x6 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x7 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x8 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x9 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xA (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xB (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xC (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xD (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xE (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xF (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x6_16 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x7_16 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x8_16 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x9_16 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xA_16 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xB_16 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xC_16 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xD_16 (IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xE_16 (IpvideoContext *s, AVFrame *frame)
 
static void ipvideo_decode_opcodes (IpvideoContext *s, AVFrame *frame)
 
static av_cold int ipvideo_decode_init (AVCodecContext *avctx)
 
static int ipvideo_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int ipvideo_decode_end (AVCodecContext *avctx)
 

Variables

static int(*const ipvideo_decode_block [])(IpvideoContext *s, AVFrame *frame)
 
static int(*const ipvideo_decode_block16 [])(IpvideoContext *s, AVFrame *frame)
 
AVCodec ff_interplay_video_decoder
 

Detailed Description

Interplay MVE Video Decoder by Mike Melanson (melan.nosp@m.son@.nosp@m.pcisy.nosp@m.s.ne.nosp@m.t) For more information about the Interplay MVE format, visit: http://www.pcisys.net/~melanson/codecs/interplay-mve.txt This code is written in such a way that the identifiers match up with the encoding descriptions in the document.

This decoder presently only supports a PAL8 output colorspace.

An Interplay video frame consists of 2 parts: The decoding map and the video data. A demuxer must load these 2 parts together in a single buffer before sending it through the stream to this decoder.

Definition in file interplayvideo.c.

Macro Definition Documentation

#define BITSTREAM_READER_LE

Definition at line 44 of file interplayvideo.c.

#define PALETTE_COUNT   256

Definition at line 48 of file interplayvideo.c.

Typedef Documentation

Function Documentation

static int ipvideo_decode_block_opcode_0x0 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 91 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x1 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 96 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x2 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 101 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x3 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 125 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x4 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 151 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x5 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 172 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x6 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 185 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x6_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 523 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x7 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 194 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x7_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 535 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x8 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 233 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x8_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 572 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x9 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 306 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x9_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 648 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xA ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 371 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xA_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 715 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xB ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 432 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xB_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 781 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xC ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 446 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xC_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 797 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xD ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 465 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xD_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 817 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xE ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 485 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xE_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 838 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xF ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 502 of file interplayvideo.c.

static av_cold int ipvideo_decode_end ( AVCodecContext avctx)
static

Definition at line 1007 of file interplayvideo.c.

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

Definition at line 955 of file interplayvideo.c.

static av_cold int ipvideo_decode_init ( AVCodecContext avctx)
static

Definition at line 933 of file interplayvideo.c.

static void ipvideo_decode_opcodes ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 879 of file interplayvideo.c.

Referenced by ipvideo_decode_frame().

Variable Documentation

AVCodec ff_interplay_video_decoder
Initial value:
= {
.name = "interplayvideo",
.priv_data_size = sizeof(IpvideoContext),
.long_name = NULL_IF_CONFIG_SMALL("Interplay MVE video"),
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define CODEC_CAP_PARAM_CHANGE
Codec supports changed parameters at any point.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int ipvideo_decode_end(AVCodecContext *avctx)
struct IpvideoContext IpvideoContext
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:375
static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868
static int ipvideo_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)

Definition at line 1017 of file interplayvideo.c.

int(* const ipvideo_decode_block[])(IpvideoContext *s, AVFrame *frame)
static
Initial value:
= {
}
static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x0(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x8(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x1(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x6(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0xE(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0xF(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0xB(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0xC(IpvideoContext *s, AVFrame *frame)

Definition at line 857 of file interplayvideo.c.

Referenced by ipvideo_decode_opcodes().

int(* const ipvideo_decode_block16[])(IpvideoContext *s, AVFrame *frame)
static
Initial value:
= {
}
static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x7_16(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x8_16(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0xE_16(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0xC_16(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x0(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x1(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0xD_16(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x6_16(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0xB_16(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0x9_16(IpvideoContext *s, AVFrame *frame)
static int ipvideo_decode_block_opcode_0xA_16(IpvideoContext *s, AVFrame *frame)

Definition at line 868 of file interplayvideo.c.

Referenced by ipvideo_decode_opcodes().