FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
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 "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"
#include "hpeldsp.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  IpvideoContext
 

Macros

#define BITSTREAM_READER_LE
 
#define PALETTE_COUNT   256
 

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_format_06_firstpass (IpvideoContext *s, AVFrame *frame, int16_t opcode)
 
static void ipvideo_format_06_secondpass (IpvideoContext *s, AVFrame *frame, int16_t opcode)
 
static void ipvideo_decode_format_06_opcodes (IpvideoContext *s, AVFrame *frame)
 
static void ipvideo_format_10_firstpass (IpvideoContext *s, AVFrame *frame, int16_t opcode)
 
static void ipvideo_format_10_secondpass (IpvideoContext *s, AVFrame *frame, int16_t opcode)
 
static void ipvideo_decode_format_10_opcodes (IpvideoContext *s, AVFrame *frame)
 
static void ipvideo_decode_format_11_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)
 
static void(*const ipvideo_format_06_passes [])(IpvideoContext *s, AVFrame *frame, int16_t op)
 
static void(*const ipvideo_format_10_passes [])(IpvideoContext *s, AVFrame *frame, int16_t op)
 
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 43 of file interplayvideo.c.

#define PALETTE_COUNT   256

Definition at line 50 of file interplayvideo.c.

Function Documentation

static int copy_from ( IpvideoContext s,
AVFrame src,
AVFrame dst,
int  delta_x,
int  delta_y 
)
static
static int ipvideo_decode_block_opcode_0x0 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 100 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x1 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 105 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x2 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 110 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x3 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 134 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x4 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 160 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x5 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 181 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x6 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 194 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x7 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 203 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x8 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 247 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x9 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 325 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xA ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 395 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xB ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 461 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xC ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 475 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xD ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 494 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xE ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 519 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xF ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 536 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x6_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 557 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x7_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 569 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x8_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 606 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0x9_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 682 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xA_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 749 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xB_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 815 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xC_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 831 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xD_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 851 of file interplayvideo.c.

static int ipvideo_decode_block_opcode_0xE_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 872 of file interplayvideo.c.

static void ipvideo_format_06_firstpass ( IpvideoContext s,
AVFrame frame,
int16_t  opcode 
)
static

Definition at line 913 of file interplayvideo.c.

static void ipvideo_format_06_secondpass ( IpvideoContext s,
AVFrame frame,
int16_t  opcode 
)
static

Definition at line 929 of file interplayvideo.c.

static void ipvideo_decode_format_06_opcodes ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 948 of file interplayvideo.c.

Referenced by ipvideo_decode_frame().

static void ipvideo_format_10_firstpass ( IpvideoContext s,
AVFrame frame,
int16_t  opcode 
)
static

Definition at line 987 of file interplayvideo.c.

static void ipvideo_format_10_secondpass ( IpvideoContext s,
AVFrame frame,
int16_t  opcode 
)
static

Definition at line 999 of file interplayvideo.c.

static void ipvideo_decode_format_10_opcodes ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 1018 of file interplayvideo.c.

Referenced by ipvideo_decode_frame().

static void ipvideo_decode_format_11_opcodes ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 1099 of file interplayvideo.c.

Referenced by ipvideo_decode_frame().

static av_cold int ipvideo_decode_init ( AVCodecContext avctx)
static

Definition at line 1155 of file interplayvideo.c.

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

Definition at line 1201 of file interplayvideo.c.

static av_cold int ipvideo_decode_end ( AVCodecContext avctx)
static

Definition at line 1365 of file interplayvideo.c.

Variable Documentation

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 891 of file interplayvideo.c.

Referenced by ipvideo_decode_format_11_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 902 of file interplayvideo.c.

Referenced by ipvideo_decode_format_11_opcodes().

void(* const ipvideo_format_06_passes[])(IpvideoContext *s, AVFrame *frame, int16_t op)
static
Initial value:
= {
}
static void ipvideo_format_06_secondpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
static void ipvideo_format_06_firstpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)

Definition at line 944 of file interplayvideo.c.

Referenced by ipvideo_decode_format_06_opcodes().

void(* const ipvideo_format_10_passes[])(IpvideoContext *s, AVFrame *frame, int16_t op)
static
Initial value:
= {
}
static void ipvideo_format_10_secondpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
static void ipvideo_format_10_firstpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)

Definition at line 1014 of file interplayvideo.c.

Referenced by ipvideo_decode_format_10_opcodes().

AVCodec ff_interplay_video_decoder
Initial value:
= {
.name = "interplayvideo",
.long_name = NULL_IF_CONFIG_SMALL("Interplay MVE video"),
.priv_data_size = sizeof(IpvideoContext),
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
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 ipvideo_decode_end(AVCodecContext *avctx)
static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
#define AV_CODEC_CAP_PARAM_CHANGE
Codec supports changed parameters at any point.
Definition: avcodec.h:1073
static int ipvideo_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:1002

Definition at line 1377 of file interplayvideo.c.