diff mjpeg.c @ 4761:4effe3bde31b libavcodec

support for the THP game format by Marco Gerards, mgerards xs4all nl
author diego
date Sun, 01 Apr 2007 14:28:48 +0000
parents f4a14f5afd8a
children da0598df2e53
line wrap: on
line diff
--- a/mjpeg.c	Sun Apr 01 11:40:36 2007 +0000
+++ b/mjpeg.c	Sun Apr 01 14:28:48 2007 +0000
@@ -2044,6 +2044,8 @@
                         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 @@
                             else if (x)
                                 break;
                         }
+                        }
                     }
                     init_get_bits(&s->gb, s->buffer, (dst - s->buffer)*8);
 
@@ -2583,6 +2586,19 @@
     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,