aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
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
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')
-rw-r--r--libavcodec/allcodecs.c1
-rw-r--r--libavcodec/avcodec.h2
-rw-r--r--libavcodec/mjpeg.c16
3 files changed, 19 insertions, 0 deletions
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 6045c93d65..b247cbe34f 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -130,6 +130,7 @@ void avcodec_register_all(void)
REGISTER_DECODER(SVQ3, svq3);
REGISTER_ENCDEC (TARGA, targa);
REGISTER_DECODER(THEORA, theora);
+ REGISTER_DECODER(THP, thp);
REGISTER_DECODER(TIERTEXSEQVIDEO, tiertexseqvideo);
REGISTER_DECODER(TIFF, tiff);
REGISTER_DECODER(TRUEMOTION1, truemotion1);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 6dbd355bd8..1d8427a9dd 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -158,6 +158,7 @@ enum CodecID {
CODEC_ID_FFH264,
CODEC_ID_DXA,
CODEC_ID_DNXHD,
+ CODEC_ID_THP,
/* various pcm "codecs" */
CODEC_ID_PCM_S16LE= 0x10000,
@@ -2329,6 +2330,7 @@ extern AVCodec svq1_decoder;
extern AVCodec svq3_decoder;
extern AVCodec targa_decoder;
extern AVCodec theora_decoder;
+extern AVCodec thp_decoder;
extern AVCodec tiertexseqvideo_decoder;
extern AVCodec tiff_decoder;
extern AVCodec truemotion1_decoder;
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,