libavcodec/interplayvideo.c File Reference

Interplay MVE Video Decoder by Mike Melanson (melanson@pcisys.net) 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 <unistd.h>
#include "avcodec.h"
#include "bytestream.h"
#include "dsputil.h"

Go to the source code of this file.

Data Structures

struct  IpvideoContext

Defines

#define PALETTE_COUNT   256
#define DEBUG_INTERPLAY   0
#define CHECK_STREAM_PTR(n)
#define COPY_FROM_CURRENT()
#define COPY_FROM_PREVIOUS()
#define COPY_FROM_SECOND_LAST()

Functions

static void debug_interplay (const char *format,...)
static int ipvideo_decode_block_opcode_0x0 (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0x1 (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0x2 (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0x3 (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0x4 (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0x5 (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0x6 (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0x7 (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0x8 (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0x9 (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0xA (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0xB (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0xC (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0xD (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0xE (IpvideoContext *s)
static int ipvideo_decode_block_opcode_0xF (IpvideoContext *s)
static void ipvideo_decode_opcodes (IpvideoContext *s)
static av_cold int ipvideo_decode_init (AVCodecContext *avctx)
static int ipvideo_decode_frame (AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
static av_cold int ipvideo_decode_end (AVCodecContext *avctx)

Variables

static int(* ipvideo_decode_block [16])(IpvideoContext *s)
AVCodec interplay_video_decoder


Detailed Description

Interplay MVE Video Decoder by Mike Melanson (melanson@pcisys.net) 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.


Define Documentation

#define CHECK_STREAM_PTR (  ) 

 
#define COPY_FROM_CURRENT (  ) 

Value:

motion_offset = current_offset; \
    motion_offset += y * s->stride; \
    motion_offset += x; \
    if (motion_offset < 0) { \
        av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset < 0 (%d)\n", motion_offset); \
        return -1; \
    } else if (motion_offset > s->upper_motion_limit_offset) { \
        av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset above limit (%d >= %d)\n", \
            motion_offset, s->upper_motion_limit_offset); \
        return -1; \
    } \
    s->dsp.put_pixels_tab[0][0](s->pixel_ptr, \
        s->current_frame.data[0] + motion_offset, s->stride, 8);

Definition at line 85 of file interplayvideo.c.

Referenced by ipvideo_decode_block_opcode_0x3().

 
#define COPY_FROM_PREVIOUS (  ) 

Value:

motion_offset = current_offset; \
    motion_offset += y * s->stride; \
    motion_offset += x; \
    if (motion_offset < 0) { \
        av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset < 0 (%d)\n", motion_offset); \
        return -1; \
    } else if (motion_offset > s->upper_motion_limit_offset) { \
        av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset above limit (%d >= %d)\n", \
            motion_offset, s->upper_motion_limit_offset); \
        return -1; \
    } \
    s->dsp.put_pixels_tab[0][0](s->pixel_ptr, \
        s->last_frame.data[0] + motion_offset, s->stride, 8);

Definition at line 100 of file interplayvideo.c.

Referenced by ipvideo_decode_block_opcode_0x0(), ipvideo_decode_block_opcode_0x4(), and ipvideo_decode_block_opcode_0x5().

 
#define COPY_FROM_SECOND_LAST (  ) 

Value:

motion_offset = current_offset; \
    motion_offset += y * s->stride; \
    motion_offset += x; \
    if (motion_offset < 0) { \
        av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset < 0 (%d)\n", motion_offset); \
        return -1; \
    } else if (motion_offset > s->upper_motion_limit_offset) { \
        av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset above limit (%d >= %d)\n", \
            motion_offset, s->upper_motion_limit_offset); \
        return -1; \
    } \
    s->dsp.put_pixels_tab[0][0](s->pixel_ptr, \
        s->second_last_frame.data[0] + motion_offset, s->stride, 8);

Definition at line 115 of file interplayvideo.c.

Referenced by ipvideo_decode_block_opcode_0x1(), and ipvideo_decode_block_opcode_0x2().

#define DEBUG_INTERPLAY   0

Definition at line 49 of file interplayvideo.c.

#define PALETTE_COUNT   256

Definition at line 46 of file interplayvideo.c.


Function Documentation

static void debug_interplay ( const char *  format,
  ... 
) [inline, static]

static int ipvideo_decode_block_opcode_0x0 ( IpvideoContext s  )  [static]

Definition at line 130 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0x1 ( IpvideoContext s  )  [static]

Definition at line 144 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0x2 ( IpvideoContext s  )  [static]

Definition at line 158 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0x3 ( IpvideoContext s  )  [static]

Definition at line 184 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0x4 ( IpvideoContext s  )  [static]

Definition at line 212 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0x5 ( IpvideoContext s  )  [static]

Definition at line 235 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0x6 ( IpvideoContext s  )  [static]

Definition at line 255 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0x7 ( IpvideoContext s  )  [static]

Definition at line 264 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0x8 ( IpvideoContext s  )  [static]

Definition at line 325 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0x9 ( IpvideoContext s  )  [static]

Definition at line 475 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0xA ( IpvideoContext s  )  [static]

Definition at line 565 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0xB ( IpvideoContext s  )  [static]

Definition at line 663 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0xC ( IpvideoContext s  )  [static]

Definition at line 681 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0xD ( IpvideoContext s  )  [static]

Definition at line 704 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0xE ( IpvideoContext s  )  [static]

Definition at line 734 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static int ipvideo_decode_block_opcode_0xF ( IpvideoContext s  )  [static]

Definition at line 754 of file interplayvideo.c.

Referenced by ipvideo_decode_init().

static av_cold int ipvideo_decode_end ( AVCodecContext avctx  )  [static]

Definition at line 922 of file interplayvideo.c.

static int ipvideo_decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
const uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 879 of file interplayvideo.c.

static av_cold int ipvideo_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 838 of file interplayvideo.c.

static void ipvideo_decode_opcodes ( IpvideoContext s  )  [static]

Definition at line 783 of file interplayvideo.c.

Referenced by ipvideo_decode_frame().


Variable Documentation

Initial value:

Definition at line 935 of file interplayvideo.c.

int(* ipvideo_decode_block[16])(IpvideoContext *s) [static]


Generated on Fri Oct 26 02:35:43 2012 for FFmpeg by  doxygen 1.5.8