FFmpeg
Data Structures | Macros | Functions | Variables
interplayvideo.c File Reference
#include <stdio.h>
#include <string.h>
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "hpeldsp.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, AVFrame *frame, 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)
 
const FFCodec 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

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 42 of file interplayvideo.c.

◆ PALETTE_COUNT

#define PALETTE_COUNT   256

Definition at line 50 of file interplayvideo.c.

Function Documentation

◆ copy_from()

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

◆ ipvideo_decode_block_opcode_0x0()

static int ipvideo_decode_block_opcode_0x0 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 105 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x1()

static int ipvideo_decode_block_opcode_0x1 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 110 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x2()

static int ipvideo_decode_block_opcode_0x2 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 115 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x3()

static int ipvideo_decode_block_opcode_0x3 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 139 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x4()

static int ipvideo_decode_block_opcode_0x4 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 165 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x5()

static int ipvideo_decode_block_opcode_0x5 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 186 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x6()

static int ipvideo_decode_block_opcode_0x6 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 199 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x7()

static int ipvideo_decode_block_opcode_0x7 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 208 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x8()

static int ipvideo_decode_block_opcode_0x8 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 252 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x9()

static int ipvideo_decode_block_opcode_0x9 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 330 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xA()

static int ipvideo_decode_block_opcode_0xA ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 400 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xB()

static int ipvideo_decode_block_opcode_0xB ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 466 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xC()

static int ipvideo_decode_block_opcode_0xC ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 480 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xD()

static int ipvideo_decode_block_opcode_0xD ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 499 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xE()

static int ipvideo_decode_block_opcode_0xE ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 524 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xF()

static int ipvideo_decode_block_opcode_0xF ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 541 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x6_16()

static int ipvideo_decode_block_opcode_0x6_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 562 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x7_16()

static int ipvideo_decode_block_opcode_0x7_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 574 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x8_16()

static int ipvideo_decode_block_opcode_0x8_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 611 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x9_16()

static int ipvideo_decode_block_opcode_0x9_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 687 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xA_16()

static int ipvideo_decode_block_opcode_0xA_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 754 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xB_16()

static int ipvideo_decode_block_opcode_0xB_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 820 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xC_16()

static int ipvideo_decode_block_opcode_0xC_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 836 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xD_16()

static int ipvideo_decode_block_opcode_0xD_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 856 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xE_16()

static int ipvideo_decode_block_opcode_0xE_16 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 877 of file interplayvideo.c.

◆ ipvideo_format_06_firstpass()

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

Definition at line 918 of file interplayvideo.c.

◆ ipvideo_format_06_secondpass()

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

Definition at line 934 of file interplayvideo.c.

◆ ipvideo_decode_format_06_opcodes()

static void ipvideo_decode_format_06_opcodes ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 953 of file interplayvideo.c.

Referenced by ipvideo_decode_frame().

◆ ipvideo_format_10_firstpass()

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

Definition at line 992 of file interplayvideo.c.

◆ ipvideo_format_10_secondpass()

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

Definition at line 1004 of file interplayvideo.c.

◆ ipvideo_decode_format_10_opcodes()

static void ipvideo_decode_format_10_opcodes ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 1023 of file interplayvideo.c.

Referenced by ipvideo_decode_frame().

◆ ipvideo_decode_format_11_opcodes()

static void ipvideo_decode_format_11_opcodes ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 1104 of file interplayvideo.c.

Referenced by ipvideo_decode_frame().

◆ ipvideo_decode_init()

static av_cold int ipvideo_decode_init ( AVCodecContext avctx)
static

Definition at line 1160 of file interplayvideo.c.

◆ ipvideo_decode_frame()

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

Definition at line 1190 of file interplayvideo.c.

◆ ipvideo_decode_end()

static av_cold int ipvideo_decode_end ( AVCodecContext avctx)
static

Definition at line 1345 of file interplayvideo.c.

Variable Documentation

◆ ipvideo_decode_block

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

◆ ipvideo_decode_block16

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

◆ ipvideo_format_06_passes

void(* const ipvideo_format_06_passes[])(IpvideoContext *s, AVFrame *frame, int16_t op)
static

◆ ipvideo_format_10_passes

void(* const ipvideo_format_10_passes[])(IpvideoContext *s, AVFrame *frame, int16_t op)
static

◆ ff_interplay_video_decoder

const FFCodec ff_interplay_video_decoder
Initial value:
= {
.p.name = "interplayvideo",
CODEC_LONG_NAME("Interplay MVE video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(IpvideoContext),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 1357 of file interplayvideo.c.

ipvideo_decode_init
static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
Definition: interplayvideo.c:1160
ipvideo_decode_block_opcode_0xB
static int ipvideo_decode_block_opcode_0xB(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:466
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
ipvideo_decode_block_opcode_0x3
static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:139
ipvideo_decode_block_opcode_0x2
static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:115
ipvideo_decode_block_opcode_0xC
static int ipvideo_decode_block_opcode_0xC(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:480
ipvideo_decode_block_opcode_0x9
static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:330
ipvideo_format_10_secondpass
static void ipvideo_format_10_secondpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
Definition: interplayvideo.c:1004
ipvideo_decode_block_opcode_0x7_16
static int ipvideo_decode_block_opcode_0x7_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:574
ipvideo_decode_block_opcode_0x8_16
static int ipvideo_decode_block_opcode_0x8_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:611
ipvideo_decode_block_opcode_0x4
static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:165
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
ipvideo_decode_frame
static int ipvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: interplayvideo.c:1190
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
ipvideo_decode_block_opcode_0x6
static int ipvideo_decode_block_opcode_0x6(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:199
ipvideo_decode_block_opcode_0x9_16
static int ipvideo_decode_block_opcode_0x9_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:687
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
ipvideo_decode_block_opcode_0xA
static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:400
ipvideo_decode_block_opcode_0x1
static int ipvideo_decode_block_opcode_0x1(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:110
ipvideo_format_10_firstpass
static void ipvideo_format_10_firstpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
Definition: interplayvideo.c:992
AV_CODEC_ID_INTERPLAY_VIDEO
@ AV_CODEC_ID_INTERPLAY_VIDEO
Definition: codec_id.h:91
ipvideo_decode_block_opcode_0x6_16
static int ipvideo_decode_block_opcode_0x6_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:562
ipvideo_format_06_firstpass
static void ipvideo_format_06_firstpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
Definition: interplayvideo.c:918
ipvideo_decode_block_opcode_0xE
static int ipvideo_decode_block_opcode_0xE(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:524
ipvideo_decode_end
static av_cold int ipvideo_decode_end(AVCodecContext *avctx)
Definition: interplayvideo.c:1345
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
ipvideo_decode_block_opcode_0x0
static int ipvideo_decode_block_opcode_0x0(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:105
ipvideo_decode_block_opcode_0x8
static int ipvideo_decode_block_opcode_0x8(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:252
ipvideo_format_06_secondpass
static void ipvideo_format_06_secondpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
Definition: interplayvideo.c:934
ipvideo_decode_block_opcode_0x5
static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:186
ipvideo_decode_block_opcode_0xB_16
static int ipvideo_decode_block_opcode_0xB_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:820
ipvideo_decode_block_opcode_0xC_16
static int ipvideo_decode_block_opcode_0xC_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:836
ipvideo_decode_block_opcode_0xF
static int ipvideo_decode_block_opcode_0xF(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:541
ipvideo_decode_block_opcode_0x7
static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:208
AV_CODEC_CAP_PARAM_CHANGE
#define AV_CODEC_CAP_PARAM_CHANGE
Codec supports changed parameters at any point.
Definition: codec.h:115
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
ipvideo_decode_block_opcode_0xE_16
static int ipvideo_decode_block_opcode_0xE_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:877
ipvideo_decode_block_opcode_0xD
static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:499
ipvideo_decode_block_opcode_0xD_16
static int ipvideo_decode_block_opcode_0xD_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:856
IpvideoContext
Definition: interplayvideo.c:52
ipvideo_decode_block_opcode_0xA_16
static int ipvideo_decode_block_opcode_0xA_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:754