aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mjpeg.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2007-04-01 14:28:48 +0000
committerDiego Biurrun <diego@biurrun.de>2007-04-01 14:28:48 +0000
commitefb0c399caa3be581a6c605cefd35f7560f3d740 (patch)
treea1c0dd493270060b92f00c6bb4036b9d833d2e5a /libavcodec/mjpeg.c
parentb966340546c84dfaf83bbaa1d5f8c8570eb8a2f3 (diff)
downloadffmpeg-efb0c399caa3be581a6c605cefd35f7560f3d740.tar.gz
support for the THP game format by Marco Gerards, mgerards xs4all nl
Originally committed as revision 8587 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mjpeg.c')
-rw-r--r--libavcodec/mjpeg.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index ed6016f939..a2362df9dc 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -2044,6 +2044,8 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
uint8_t x = *(src++);
*(dst++) = x;
+ if (avctx->codec_id != CODEC_ID_THP)
+ {
if (x == 0xff)
{
while(src<buf_end && x == 0xff)
@@ -2054,6 +2056,7 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
else if (x)
break;
}
+ }
}
init_get_bits(&s->gb, s->buffer, (dst - s->buffer)*8);
@@ -2583,6 +2586,19 @@ AVCodec mjpeg_decoder = {
NULL
};
+AVCodec thp_decoder = {
+ "thp",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_THP,
+ sizeof(MJpegDecodeContext),
+ mjpeg_decode_init,
+ NULL,
+ mjpeg_decode_end,
+ mjpeg_decode_frame,
+ CODEC_CAP_DR1,
+ NULL
+};
+
AVCodec mjpegb_decoder = {
"mjpegb",
CODEC_TYPE_VIDEO,