FFmpeg
Data Structures | Macros | Functions | Variables
interplayvideo.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "bytestream.h"
#include "decode.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)
 
const 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

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 43 of file interplayvideo.c.

◆ PALETTE_COUNT

#define PALETTE_COUNT   256

Definition at line 51 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 106 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x1()

static int ipvideo_decode_block_opcode_0x1 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 111 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x2()

static int ipvideo_decode_block_opcode_0x2 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 116 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x3()

static int ipvideo_decode_block_opcode_0x3 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 140 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x4()

static int ipvideo_decode_block_opcode_0x4 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 166 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x5()

static int ipvideo_decode_block_opcode_0x5 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 187 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x6()

static int ipvideo_decode_block_opcode_0x6 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 200 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x7()

static int ipvideo_decode_block_opcode_0x7 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 209 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x8()

static int ipvideo_decode_block_opcode_0x8 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 253 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0x9()

static int ipvideo_decode_block_opcode_0x9 ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 331 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xA()

static int ipvideo_decode_block_opcode_0xA ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 401 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xB()

static int ipvideo_decode_block_opcode_0xB ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 467 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xC()

static int ipvideo_decode_block_opcode_0xC ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 481 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xD()

static int ipvideo_decode_block_opcode_0xD ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 500 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xE()

static int ipvideo_decode_block_opcode_0xE ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 525 of file interplayvideo.c.

◆ ipvideo_decode_block_opcode_0xF()

static int ipvideo_decode_block_opcode_0xF ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 542 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 563 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 575 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 612 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 688 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 755 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 821 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 837 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 857 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 878 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 919 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 935 of file interplayvideo.c.

◆ ipvideo_decode_format_06_opcodes()

static void ipvideo_decode_format_06_opcodes ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 954 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 993 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 1005 of file interplayvideo.c.

◆ ipvideo_decode_format_10_opcodes()

static void ipvideo_decode_format_10_opcodes ( IpvideoContext s,
AVFrame frame 
)
static

Definition at line 1024 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 1105 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 1161 of file interplayvideo.c.

◆ ipvideo_decode_frame()

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

Definition at line 1191 of file interplayvideo.c.

◆ ipvideo_decode_end()

static av_cold int ipvideo_decode_end ( AVCodecContext avctx)
static

Definition at line 1348 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 AVCodec ff_interplay_video_decoder
Initial value:
= {
.name = "interplayvideo",
.long_name = NULL_IF_CONFIG_SMALL("Interplay MVE video"),
.priv_data_size = sizeof(IpvideoContext),
}

Definition at line 1360 of file interplayvideo.c.

ipvideo_decode_init
static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
Definition: interplayvideo.c:1161
FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:42
ipvideo_decode_block_opcode_0xB
static int ipvideo_decode_block_opcode_0xB(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:467
ipvideo_decode_block_opcode_0x3
static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:140
ipvideo_decode_block_opcode_0x2
static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:116
ipvideo_decode_block_opcode_0xC
static int ipvideo_decode_block_opcode_0xC(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:481
ipvideo_decode_block_opcode_0x9
static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:331
ipvideo_format_10_secondpass
static void ipvideo_format_10_secondpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
Definition: interplayvideo.c:1005
init
static int init
Definition: av_tx.c:47
ipvideo_decode_block_opcode_0x7_16
static int ipvideo_decode_block_opcode_0x7_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:575
ipvideo_decode_block_opcode_0x8_16
static int ipvideo_decode_block_opcode_0x8_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:612
ipvideo_decode_block_opcode_0x4
static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:166
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
ipvideo_decode_block_opcode_0x6
static int ipvideo_decode_block_opcode_0x6(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:200
ipvideo_decode_block_opcode_0x9_16
static int ipvideo_decode_block_opcode_0x9_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:688
ipvideo_decode_block_opcode_0xA
static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:401
ipvideo_decode_block_opcode_0x1
static int ipvideo_decode_block_opcode_0x1(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:111
ipvideo_format_10_firstpass
static void ipvideo_format_10_firstpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
Definition: interplayvideo.c:993
AV_CODEC_ID_INTERPLAY_VIDEO
@ AV_CODEC_ID_INTERPLAY_VIDEO
Definition: codec_id.h:89
ipvideo_decode_frame
static int ipvideo_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: interplayvideo.c:1191
ipvideo_decode_block_opcode_0x6_16
static int ipvideo_decode_block_opcode_0x6_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:563
ipvideo_format_06_firstpass
static void ipvideo_format_06_firstpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
Definition: interplayvideo.c:919
ipvideo_decode_block_opcode_0xE
static int ipvideo_decode_block_opcode_0xE(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:525
ipvideo_decode_end
static av_cold int ipvideo_decode_end(AVCodecContext *avctx)
Definition: interplayvideo.c:1348
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:106
ipvideo_decode_block_opcode_0x8
static int ipvideo_decode_block_opcode_0x8(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:253
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
ipvideo_format_06_secondpass
static void ipvideo_format_06_secondpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
Definition: interplayvideo.c:935
ipvideo_decode_block_opcode_0x5
static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:187
ipvideo_decode_block_opcode_0xB_16
static int ipvideo_decode_block_opcode_0xB_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:821
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: internal.h:50
ipvideo_decode_block_opcode_0xC_16
static int ipvideo_decode_block_opcode_0xC_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:837
ipvideo_decode_block_opcode_0xF
static int ipvideo_decode_block_opcode_0xF(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:542
ipvideo_decode_block_opcode_0x7
static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:209
AV_CODEC_CAP_PARAM_CHANGE
#define AV_CODEC_CAP_PARAM_CHANGE
Codec supports changed parameters at any point.
Definition: codec.h:121
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:878
ipvideo_decode_block_opcode_0xD
static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:500
ipvideo_decode_block_opcode_0xD_16
static int ipvideo_decode_block_opcode_0xD_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:857
IpvideoContext
Definition: interplayvideo.c:53
ipvideo_decode_block_opcode_0xA_16
static int ipvideo_decode_block_opcode_0xA_16(IpvideoContext *s, AVFrame *frame)
Definition: interplayvideo.c:755