summaryrefslogtreecommitdiff
path: root/libavformat/ipmovie.c
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2017-06-25 21:59:02 +0200
committerPaul B Mahol <onemda@gmail.com>2017-06-27 15:08:39 +0200
commit19f6fd199e46c5a56f09a768ece4246b48bd86dd (patch)
tree4b57dcf33224e9ee574e2bd7fb4a308588cbc055 /libavformat/ipmovie.c
parent8f87bfb4b7ddeb27c318aa45144d7fc45930039b (diff)
downloadffmpeg-19f6fd199e46c5a56f09a768ece4246b48bd86dd.tar.gz
Interplay MVE: Implement frame format 0x06
This implements the 0x06 frame format for Interplay MVE movies. The format is relatively simple. The video data consists of two parts: 16 bits per 8x8 block movement data a number of 8x8 blocks of pixel data For each 8x8 block of pixel data the movement data is consulted. There are 3 possible meanings of the movement data: * zero : copy the 8x8 block from the pixel data * negative : copy the 8x8 block from the previous frame from an offset determined by the actual value of the entry -0xC000. * positive : copy the 8x8 block from the current frame from an offset determined by the actual value of the entry -0x4000 Decoding happens in two passes, in the fist pass only new pixeldata is copied, during the second pass data is copied from the previous and current frames. The codec expects that the current frame being decoded to still has the data from 2 frames ago on it when decoding starts. Signed-off-by: Hein-Pieter van Braam <hp@tmm.cx>
Diffstat (limited to 'libavformat/ipmovie.c')
-rw-r--r--libavformat/ipmovie.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index a9ffca4872..7f2454b0f0 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -58,7 +58,7 @@
#define OPCODE_INIT_AUDIO_BUFFERS 0x03
#define OPCODE_START_STOP_AUDIO 0x04
#define OPCODE_INIT_VIDEO_BUFFERS 0x05
-#define OPCODE_UNKNOWN_06 0x06
+#define OPCODE_VIDEO_DATA_06 0x06
#define OPCODE_SEND_BUFFER 0x07
#define OPCODE_AUDIO_FRAME 0x08
#define OPCODE_SILENCE_FRAME 0x09
@@ -444,7 +444,6 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
s->video_width, s->video_height);
break;
- case OPCODE_UNKNOWN_06:
case OPCODE_UNKNOWN_0E:
case OPCODE_UNKNOWN_10:
case OPCODE_UNKNOWN_12:
@@ -537,8 +536,18 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
avio_skip(pb, opcode_size);
break;
+ case OPCODE_VIDEO_DATA_06:
+ av_log(s->avf, AV_LOG_TRACE, "set video data format 0x06\n");
+ s->frame_format = 0x06;
+
+ /* log position and move on for now */
+ s->video_chunk_offset = avio_tell(pb);
+ s->video_chunk_size = opcode_size;
+ avio_skip(pb, opcode_size);
+ break;
+
case OPCODE_VIDEO_DATA_11:
- av_log(s->avf, AV_LOG_TRACE, "set video data\n");
+ av_log(s->avf, AV_LOG_TRACE, "set video data format 0x11\n");
s->frame_format = 0x11;
/* log position and move on for now */