summaryrefslogtreecommitdiff
path: root/libavcodec/indeo3.c
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2004-09-21 17:31:46 +0000
committerAlex Beregszaszi <alex@rtfs.hu>2004-09-21 17:31:46 +0000
commitf970a8e682d8da038bbabffffd1d30b184b62cf3 (patch)
tree80a3e05cade0e3aae61328fa8c7d5617391e716e /libavcodec/indeo3.c
parent6cb38650e8f579f83172ecd081dd7086ed33e048 (diff)
greyscale decoding (option to skip u,v planes) support
Originally committed as revision 3487 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/indeo3.c')
-rw-r--r--libavcodec/indeo3.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index 14ff02858d..a27c3ba4f2 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -223,6 +223,9 @@ static unsigned long iv_decode_frame(Indeo3DecodeContext *s,
hdr_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
min(hdr_width, 160));
+ if (!(s->avctx->flags & CODEC_FLAG_GRAY))
+ {
+
buf_pos = buf + 16 + offs2;
offs = le2me_32(*(uint32_t *)buf_pos);
buf_pos += 4;
@@ -239,6 +242,8 @@ static unsigned long iv_decode_frame(Indeo3DecodeContext *s,
chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
min(chroma_width, 40));
+ }
+
return 8;
}
@@ -1080,6 +1085,8 @@ static int indeo3_decode_frame(AVCodecContext *avctx,
dest += s->frame.linesize[0];
}
+ if (!(s->avctx->flags & CODEC_FLAG_GRAY))
+ {
src = s->cur_frame->Ubuf;
dest = s->frame.data[1];
for (y = 0; y < s->height / 4; y++) {
@@ -1095,6 +1102,7 @@ static int indeo3_decode_frame(AVCodecContext *avctx,
src += s->cur_frame->uv_w;
dest += s->frame.linesize[2];
}
+ }
*data_size=sizeof(AVFrame);
*(AVFrame*)data= s->frame;