#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include "common.h"#include "avcodec.h"#include "dsputil.h"

Go to the source code of this file.
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 CHECK_STREAM_PTR | ( | n | ) |
Value:
if ((s->stream_ptr + n) > s->stream_end) { \ av_log(s->avctx, AV_LOG_ERROR, "Interplay video warning: stream_ptr out of bounds (%p >= %p)\n", \ s->stream_ptr + n, s->stream_end); \ return -1; \ }
Definition at line 77 of file interplayvideo.c.
Referenced by ipvideo_decode_block_opcode_0x2(), ipvideo_decode_block_opcode_0x3(), ipvideo_decode_block_opcode_0x4(), ipvideo_decode_block_opcode_0x5(), ipvideo_decode_block_opcode_0x7(), ipvideo_decode_block_opcode_0x8(), ipvideo_decode_block_opcode_0x9(), ipvideo_decode_block_opcode_0xA(), ipvideo_decode_block_opcode_0xB(), ipvideo_decode_block_opcode_0xC(), ipvideo_decode_block_opcode_0xD(), ipvideo_decode_block_opcode_0xE(), ipvideo_decode_block_opcode_0xF(), msvideo1_decode_16bit(), msvideo1_decode_8bit(), qtrle_decode_16bpp(), qtrle_decode_24bpp(), qtrle_decode_32bpp(), qtrle_decode_4bpp(), and qtrle_decode_8bpp().
| #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 84 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 99 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 114 of file interplayvideo.c.
Referenced by ipvideo_decode_block_opcode_0x1(), and ipvideo_decode_block_opcode_0x2().
| #define DEBUG_INTERPLAY 0 |
Definition at line 48 of file interplayvideo.c.
| #define PALETTE_COUNT 256 |
Definition at line 45 of file interplayvideo.c.
| static void debug_interplay | ( | const char * | format, | |
| ... | ||||
| ) | [inline, static] |
Definition at line 52 of file interplayvideo.c.
Referenced by ipvideo_decode_block_opcode_0x2(), ipvideo_decode_block_opcode_0x3(), ipvideo_decode_block_opcode_0x4(), ipvideo_decode_block_opcode_0x5(), and ipvideo_decode_opcodes().
| static int ipvideo_decode_block_opcode_0x0 | ( | IpvideoContext * | s | ) | [static] |
Definition at line 129 of file interplayvideo.c.
References COPY_FROM_PREVIOUS, IpvideoContext::current_frame, and IpvideoContext::pixel_ptr.
Referenced by ipvideo_decode_init().
| static int ipvideo_decode_block_opcode_0x1 | ( | IpvideoContext * | s | ) | [static] |
Definition at line 143 of file interplayvideo.c.
References COPY_FROM_SECOND_LAST, IpvideoContext::current_frame, and IpvideoContext::pixel_ptr.
Referenced by ipvideo_decode_init().
| static int ipvideo_decode_block_opcode_0x2 | ( | IpvideoContext * | s | ) | [static] |
Definition at line 157 of file interplayvideo.c.
References B, CHECK_STREAM_PTR, COPY_FROM_SECOND_LAST, IpvideoContext::current_frame, debug_interplay(), IpvideoContext::pixel_ptr, and IpvideoContext::stream_ptr.
Referenced by ipvideo_decode_init().

| static int ipvideo_decode_block_opcode_0x3 | ( | IpvideoContext * | s | ) | [static] |
Definition at line 183 of file interplayvideo.c.
References B, CHECK_STREAM_PTR, COPY_FROM_CURRENT, IpvideoContext::current_frame, debug_interplay(), IpvideoContext::pixel_ptr, and IpvideoContext::stream_ptr.
Referenced by ipvideo_decode_init().

| static int ipvideo_decode_block_opcode_0x4 | ( | IpvideoContext * | s | ) | [static] |
Definition at line 211 of file interplayvideo.c.
References B, CHECK_STREAM_PTR, COPY_FROM_PREVIOUS, IpvideoContext::current_frame, debug_interplay(), IpvideoContext::pixel_ptr, and IpvideoContext::stream_ptr.
Referenced by ipvideo_decode_init().

| static int ipvideo_decode_block_opcode_0x5 | ( | IpvideoContext * | s | ) | [static] |
Definition at line 234 of file interplayvideo.c.
References CHECK_STREAM_PTR, COPY_FROM_PREVIOUS, IpvideoContext::current_frame, debug_interplay(), IpvideoContext::pixel_ptr, and IpvideoContext::stream_ptr.
Referenced by ipvideo_decode_init().

| static int ipvideo_decode_block_opcode_0x6 | ( | IpvideoContext * | s | ) | [static] |
Definition at line 254 of file interplayvideo.c.
References av_log(), AV_LOG_ERROR, and IpvideoContext::avctx.
Referenced by ipvideo_decode_init().

| static int ipvideo_decode_block_opcode_0x7 | ( | IpvideoContext * | s | ) | [static] |
Definition at line 263 of file interplayvideo.c.
References B, CHECK_STREAM_PTR, IpvideoContext::line_inc, IpvideoContext::pixel_ptr, IpvideoContext::stream_ptr, and IpvideoContext::stride.
Referenced by ipvideo_decode_init().
| static int ipvideo_decode_block_opcode_0x8 | ( | IpvideoContext * | s | ) | [static] |
Definition at line 326 of file interplayvideo.c.
References B, CHECK_STREAM_PTR, IpvideoContext::line_inc, P, IpvideoContext::pixel_ptr, and IpvideoContext::stream_ptr.
Referenced by ipvideo_decode_init().
| static int ipvideo_decode_block_opcode_0x9 | ( | IpvideoContext * | s | ) | [static] |
Definition at line 476 of file interplayvideo.c.
References B, CHECK_STREAM_PTR, IpvideoContext::line_inc, P, IpvideoContext::pixel_ptr, IpvideoContext::stream_ptr, and IpvideoContext::stride.
Referenced by ipvideo_decode_init().
| static int ipvideo_decode_block_opcode_0xA | ( | IpvideoContext * | s | ) | [static] |
Definition at line 580 of file interplayvideo.c.
References B, CHECK_STREAM_PTR, IpvideoContext::line_inc, P, IpvideoContext::pixel_ptr, and IpvideoContext::stream_ptr.
Referenced by ipvideo_decode_init().
| static int ipvideo_decode_block_opcode_0xB | ( | IpvideoContext * | s | ) | [static] |
Definition at line 678 of file interplayvideo.c.
References CHECK_STREAM_PTR, IpvideoContext::line_inc, IpvideoContext::pixel_ptr, and IpvideoContext::stream_ptr.
Referenced by ipvideo_decode_init().
| static int ipvideo_decode_block_opcode_0xC | ( | IpvideoContext * | s | ) | [static] |
Definition at line 696 of file interplayvideo.c.
References CHECK_STREAM_PTR, IpvideoContext::pixel_ptr, IpvideoContext::stream_ptr, and IpvideoContext::stride.
Referenced by ipvideo_decode_init().
| static int ipvideo_decode_block_opcode_0xD | ( | IpvideoContext * | s | ) | [static] |
Definition at line 719 of file interplayvideo.c.
References CHECK_STREAM_PTR, IpvideoContext::line_inc, P, IpvideoContext::pixel_ptr, and IpvideoContext::stream_ptr.
Referenced by ipvideo_decode_init().
| static int ipvideo_decode_block_opcode_0xE | ( | IpvideoContext * | s | ) | [static] |
Definition at line 749 of file interplayvideo.c.
References CHECK_STREAM_PTR, IpvideoContext::line_inc, IpvideoContext::pixel_ptr, and IpvideoContext::stream_ptr.
Referenced by ipvideo_decode_init().
| static int ipvideo_decode_block_opcode_0xF | ( | IpvideoContext * | s | ) | [static] |
Definition at line 769 of file interplayvideo.c.
References CHECK_STREAM_PTR, IpvideoContext::line_inc, IpvideoContext::pixel_ptr, and IpvideoContext::stream_ptr.
Referenced by ipvideo_decode_init().
| static int ipvideo_decode_end | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 939 of file interplayvideo.c.
References IpvideoContext::last_frame, AVCodecContext::priv_data, AVCodecContext::release_buffer, s, and IpvideoContext::second_last_frame.
| static int ipvideo_decode_frame | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 896 of file interplayvideo.c.
References av_log(), AV_LOG_ERROR, IpvideoContext::buf, IpvideoContext::current_frame, IpvideoContext::decoding_map, IpvideoContext::decoding_map_size, AVCodecContext::get_buffer, ipvideo_decode_opcodes(), IpvideoContext::last_frame, NULL, AVCodecContext::palctrl, AVPaletteControl::palette_changed, AVCodecContext::priv_data, AVCodecContext::release_buffer, s, IpvideoContext::second_last_frame, and IpvideoContext::size.

| static int ipvideo_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 854 of file interplayvideo.c.
References av_log(), AV_LOG_ERROR, IpvideoContext::avctx, IpvideoContext::current_frame, IpvideoContext::decoding_map_size, IpvideoContext::dsp, dsputil_init(), AVCodecContext::has_b_frames, AVCodecContext::height, ipvideo_decode_block, ipvideo_decode_block_opcode_0x0(), ipvideo_decode_block_opcode_0x1(), ipvideo_decode_block_opcode_0x2(), ipvideo_decode_block_opcode_0x3(), ipvideo_decode_block_opcode_0x4(), ipvideo_decode_block_opcode_0x5(), ipvideo_decode_block_opcode_0x6(), ipvideo_decode_block_opcode_0x7(), ipvideo_decode_block_opcode_0x8(), ipvideo_decode_block_opcode_0x9(), ipvideo_decode_block_opcode_0xA(), ipvideo_decode_block_opcode_0xB(), ipvideo_decode_block_opcode_0xC(), ipvideo_decode_block_opcode_0xD(), ipvideo_decode_block_opcode_0xE(), ipvideo_decode_block_opcode_0xF(), IpvideoContext::last_frame, NULL, AVCodecContext::palctrl, AVCodecContext::pix_fmt, PIX_FMT_PAL8, AVCodecContext::priv_data, s, IpvideoContext::second_last_frame, and AVCodecContext::width.

| static void ipvideo_decode_opcodes | ( | IpvideoContext * | s | ) | [static] |
Definition at line 798 of file interplayvideo.c.
References av_log(), AV_LOG_ERROR, IpvideoContext::avctx, IpvideoContext::buf, IpvideoContext::current_frame, debug_interplay(), IpvideoContext::decoding_map, IpvideoContext::dsp, AVCodecContext::height, ipvideo_decode_block, IpvideoContext::line_inc, memcpy, AVCodecContext::palctrl, AVPaletteControl::palette, PALETTE_COUNT, IpvideoContext::pixel_ptr, IpvideoContext::size, IpvideoContext::stream_end, IpvideoContext::stream_ptr, IpvideoContext::stride, IpvideoContext::upper_motion_limit_offset, and AVCodecContext::width.
Referenced by ipvideo_decode_frame().

Initial value:
{
"interplayvideo",
CODEC_TYPE_VIDEO,
CODEC_ID_INTERPLAY_VIDEO,
sizeof(IpvideoContext),
ipvideo_decode_init,
NULL,
ipvideo_decode_end,
ipvideo_decode_frame,
CODEC_CAP_DR1,
}
Definition at line 952 of file interplayvideo.c.
Referenced by avcodec_register_all().
int(* ipvideo_decode_block[16])(IpvideoContext *s) [static] |
Referenced by ipvideo_decode_init(), and ipvideo_decode_opcodes().
1.5.5