aboutsummaryrefslogtreecommitdiff
path: root/image/codecs/indeo/indeo.h
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-06 08:13:10 -0400
committerPaul Gilbert2016-09-10 10:08:12 -0400
commitc165826316a71b378e3493a4a5fb6a6e1740bbab (patch)
treefc657dae321669b08bb962510002dd8d0c01535a /image/codecs/indeo/indeo.h
parent5f0962696f97df2cce27d065d99b04243de59334 (diff)
downloadscummvm-rg350-c165826316a71b378e3493a4a5fb6a6e1740bbab.tar.gz
scummvm-rg350-c165826316a71b378e3493a4a5fb6a6e1740bbab.tar.bz2
scummvm-rg350-c165826316a71b378e3493a4a5fb6a6e1740bbab.zip
IMAGE: Created Indeo decoder base class for shared Indeo4/5 functionality
Diffstat (limited to 'image/codecs/indeo/indeo.h')
-rw-r--r--image/codecs/indeo/indeo.h37
1 files changed, 33 insertions, 4 deletions
diff --git a/image/codecs/indeo/indeo.h b/image/codecs/indeo/indeo.h
index d689994b03..c84f257f27 100644
--- a/image/codecs/indeo/indeo.h
+++ b/image/codecs/indeo/indeo.h
@@ -21,11 +21,13 @@
*/
#include "common/scummsys.h"
+#include "graphics/managed_surface.h"
+#include "image/codecs/codec.h"
-/* Common structures and macros shared by both Indeo4 and Indeo5 decoders,
- * derived from ffmpeg. We don't currently support Indeo5 decoding, but
- * just in case we eventually need it, this is kept as a separate file
- * like it is in ffmpeg.
+/* Common structures, macros, and base class shared by both Indeo4 and
+ * Indeo5 decoders, derived from ffmpeg. We don't currently support Indeo5
+ * decoding, but just in case we eventually need it, this is kept as a separate
+ * file like it is in ffmpeg.
*
* Original copyright note: * Intel Indeo 4 (IV41, IV42, etc.) video decoder for ffmpeg
* written, produced, and directed by Alan Smithee
@@ -330,6 +332,33 @@ struct IVI45DecContext {
int got_p_frame;
};
+class IndeoDecoderBase : public Codec {
+protected:
+ IVI45DecContext _ctx;
+ Graphics::PixelFormat _pixelFormat;
+ Graphics::ManagedSurface *_surface;
+protected:
+ /**
+ * Returns the pixel format for the decoder's surface
+ */
+ virtual Graphics::PixelFormat getPixelFormat() const { return _pixelFormat; }
+
+ /**
+ * Decode the Indeo picture header.
+ * @returns 0 = Ok, negative number = error
+ */
+ virtual int decodePictureHeader() = 0;
+
+ /**
+ * Decodes the Indeo frame from the bit reader already
+ * loaded into the context
+ */
+ int decodeIndeoFrame();
+public:
+ IndeoDecoderBase(uint16 width, uint16 height);
+ virtual ~IndeoDecoderBase();
+};
+
/*------------------------------------------------------------------------*/
/**