[Scummvm-git-logs] scummvm master -> 25f0db3eb6bb2000368fc95acd3e7d9703891d32

bluegr noreply at scummvm.org
Wed Sep 4 07:14:09 UTC 2024


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
64a95c3b43 IMAGE: Add codec accuracy options
ac0688bf61 VIDEO: Add codec accuracy options
25f0db3eb6 VCRUISE: Add fast video decoder option


Commit: 64a95c3b432e9d7bcb7bd072a4f993fd7aeee8fd
    https://github.com/scummvm/scummvm/commit/64a95c3b432e9d7bcb7bd072a4f993fd7aeee8fd
Author: elasota (1137273+elasota at users.noreply.github.com)
Date: 2024-09-04T10:14:05+03:00

Commit Message:
IMAGE: Add codec accuracy options

Changed paths:
  A image/codec-options.h
    image/codecs/codec.h
    image/codecs/mjpeg.cpp
    image/codecs/mjpeg.h
    image/jpeg.cpp
    image/jpeg.h


diff --git a/image/codec-options.h b/image/codec-options.h
new file mode 100644
index 00000000000..768b0a33b32
--- /dev/null
+++ b/image/codec-options.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IMAGE_CODEC_OPTIONS_H
+#define IMAGE_CODEC_OPTIONS_H
+
+namespace Image {
+
+enum class CodecAccuracy {
+	Fast,
+	Default,
+	Accurate,
+};
+
+} // End of namespace Image
+
+#endif
diff --git a/image/codecs/codec.h b/image/codecs/codec.h
index 8109c50766d..0540dda82fb 100644
--- a/image/codecs/codec.h
+++ b/image/codecs/codec.h
@@ -25,6 +25,8 @@
 #include "graphics/surface.h"
 #include "graphics/pixelformat.h"
 
+#include "image/codec-options.h"
+
 namespace Common {
 class SeekableReadStream;
 }
@@ -116,6 +118,11 @@ public:
 	 */
 	virtual void setDither(DitherType type, const byte *palette) {}
 
+	/**
+	 * Set the decoding accuracy of the codec, if supported
+	 */
+	virtual void setCodecAccuracy(CodecAccuracy accuracy) {}
+
 	/**
 	 * Create a dither table, as used by QuickTime codecs.
 	 */
diff --git a/image/codecs/mjpeg.cpp b/image/codecs/mjpeg.cpp
index 397553e6366..51d42731a15 100644
--- a/image/codecs/mjpeg.cpp
+++ b/image/codecs/mjpeg.cpp
@@ -46,6 +46,7 @@ MJPEGDecoder::MJPEGDecoder() : Codec() {
 		_pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0);
 
 	_surface = 0;
+	_accuracy = CodecAccuracy::Default;
 }
 
 MJPEGDecoder::~MJPEGDecoder() {
@@ -204,6 +205,7 @@ const Graphics::Surface *MJPEGDecoder::decodeFrame(Common::SeekableReadStream &s
 
 	Common::MemoryReadStream convertedStream(data, outputSize, DisposeAfterUse::YES);
 	JPEGDecoder jpeg;
+	jpeg.setCodecAccuracy(_accuracy);
 	jpeg.setOutputPixelFormat(_pixelFormat);
 
 	if (!jpeg.loadStream(convertedStream)) {
@@ -224,4 +226,8 @@ const Graphics::Surface *MJPEGDecoder::decodeFrame(Common::SeekableReadStream &s
 	return _surface;
 }
 
+void MJPEGDecoder::setCodecAccuracy(CodecAccuracy accuracy) {
+	_accuracy = accuracy;
+}
+
 } // End of namespace Image
diff --git a/image/codecs/mjpeg.h b/image/codecs/mjpeg.h
index c68ecc0d85e..ea62520915e 100644
--- a/image/codecs/mjpeg.h
+++ b/image/codecs/mjpeg.h
@@ -46,12 +46,14 @@ public:
 	~MJPEGDecoder() override;
 
 	const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream) override;
+	void setCodecAccuracy(CodecAccuracy accuracy) override;
 	Graphics::PixelFormat getPixelFormat() const override { return _pixelFormat; }
 	bool setOutputPixelFormat(const Graphics::PixelFormat &format) override { _pixelFormat = format; return true; }
 
 private:
 	Graphics::PixelFormat _pixelFormat;
 	Graphics::Surface *_surface;
+	CodecAccuracy _accuracy;
 };
 
 } // End of namespace Image
diff --git a/image/jpeg.cpp b/image/jpeg.cpp
index ffb197ae005..e1340054ea6 100644
--- a/image/jpeg.cpp
+++ b/image/jpeg.cpp
@@ -47,6 +47,7 @@ namespace Image {
 JPEGDecoder::JPEGDecoder() :
 		_surface(),
 		_colorSpace(kColorSpaceRGB),
+		_accuracy(CodecAccuracy::Default),
 		_requestedPixelFormat(getByteOrderRgbPixelFormat()) {
 }
 
@@ -77,6 +78,10 @@ const Graphics::Surface *JPEGDecoder::decodeFrame(Common::SeekableReadStream &st
 	return getSurface();
 }
 
+void JPEGDecoder::setCodecAccuracy(CodecAccuracy accuracy) {
+	_accuracy = accuracy;
+}
+
 Graphics::PixelFormat JPEGDecoder::getPixelFormat() const {
 	return _surface.format;
 }
@@ -243,6 +248,11 @@ bool JPEGDecoder::loadStream(Common::SeekableReadStream &stream) {
 	// Initialize the decompression structure
 	jpeg_create_decompress(&cinfo);
 
+	if (_accuracy <= CodecAccuracy::Fast)
+		cinfo.dct_method = JDCT_FASTEST;
+	else if (_accuracy >= CodecAccuracy::Accurate)
+		cinfo.dct_method = JDCT_ISLOW;
+
 	// Initialize our buffer handling
 	jpeg_scummvm_src(&cinfo, &stream);
 
diff --git a/image/jpeg.h b/image/jpeg.h
index 26b9a87a6c1..c5581f347de 100644
--- a/image/jpeg.h
+++ b/image/jpeg.h
@@ -58,6 +58,7 @@ public:
 
 	// Codec API
 	const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream) override;
+	void setCodecAccuracy(CodecAccuracy accuracy) override;
 	Graphics::PixelFormat getPixelFormat() const override;
 	bool setOutputPixelFormat(const Graphics::PixelFormat &format) override { _requestedPixelFormat = format; return true; }
 
@@ -100,6 +101,7 @@ private:
 	Graphics::Surface _surface;
 	ColorSpace _colorSpace;
 	Graphics::PixelFormat _requestedPixelFormat;
+	CodecAccuracy _accuracy;
 
 	Graphics::PixelFormat getByteOrderRgbPixelFormat() const;
 };


Commit: ac0688bf61a34d38e1d5b45f11ef62f435089ca9
    https://github.com/scummvm/scummvm/commit/ac0688bf61a34d38e1d5b45f11ef62f435089ca9
Author: elasota (1137273+elasota at users.noreply.github.com)
Date: 2024-09-04T10:14:05+03:00

Commit Message:
VIDEO: Add codec accuracy options

Changed paths:
    video/avi_decoder.cpp
    video/avi_decoder.h
    video/video_decoder.cpp
    video/video_decoder.h


diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index 872b5370414..71b581edc68 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -345,7 +345,7 @@ void AVIDecoder::handleStreamHeader(uint32 size) {
 			}
 		}
 
-		AVIVideoTrack *track = new AVIVideoTrack(_header.totalFrames, sHeader, bmInfo, initialPalette);
+		AVIVideoTrack *track = new AVIVideoTrack(_header.totalFrames, sHeader, bmInfo, initialPalette, _videoCodecAccuracy);
 		if (track->isValid())
 			addTrack(track);
 		else
@@ -945,8 +945,8 @@ VideoDecoder::AudioTrack *AVIDecoder::getAudioTrack(int index) {
 	return (AudioTrack *)track;
 }
 
-AVIDecoder::AVIVideoTrack::AVIVideoTrack(int frameCount, const AVIStreamHeader &streamHeader, const BitmapInfoHeader &bitmapInfoHeader, byte *initialPalette)
-		: _frameCount(frameCount), _vidsHeader(streamHeader), _bmInfo(bitmapInfoHeader), _initialPalette(initialPalette) {
+AVIDecoder::AVIVideoTrack::AVIVideoTrack(int frameCount, const AVIStreamHeader &streamHeader, const BitmapInfoHeader &bitmapInfoHeader, byte *initialPalette, Image::CodecAccuracy accuracy)
+		: _frameCount(frameCount), _vidsHeader(streamHeader), _bmInfo(bitmapInfoHeader), _initialPalette(initialPalette), _accuracy(accuracy) {
 	_videoCodec = createCodec();
 	_lastFrame = 0;
 	_curFrame = -1;
@@ -1041,7 +1041,7 @@ void AVIDecoder::AVIVideoTrack::forceDimensions(uint16 width, uint16 height) {
 
 bool AVIDecoder::AVIVideoTrack::rewind() {
 	_curFrame = -1;
-
+	 
 	useInitialPalette();
 
 	delete _videoCodec;
@@ -1051,8 +1051,12 @@ bool AVIDecoder::AVIVideoTrack::rewind() {
 }
 
 Image::Codec *AVIDecoder::AVIVideoTrack::createCodec() {
-	return Image::createBitmapCodec(_bmInfo.compression, _vidsHeader.streamHandler, _bmInfo.width,
+	Image::Codec *codec = Image::createBitmapCodec(_bmInfo.compression, _vidsHeader.streamHandler, _bmInfo.width,
 									_bmInfo.height, _bmInfo.bitCount);
+
+	codec->setCodecAccuracy(_accuracy);
+
+	return codec;
 }
 
 void AVIDecoder::AVIVideoTrack::forceTrackEnd() {
@@ -1100,6 +1104,15 @@ void AVIDecoder::AVIVideoTrack::setDither(const byte *palette) {
 	_videoCodec->setDither(Image::Codec::kDitherTypeVFW, palette);
 }
 
+void AVIDecoder::AVIVideoTrack::setCodecAccuracy(Image::CodecAccuracy accuracy) {
+	if (_accuracy != accuracy) {
+		_accuracy = accuracy;
+
+		if (_videoCodec)
+			_videoCodec->setCodecAccuracy(accuracy);
+	}
+}
+
 AVIDecoder::AVIAudioTrack::AVIAudioTrack(const AVIStreamHeader &streamHeader, const PCMWaveFormat &waveFormat, Audio::Mixer::SoundType soundType) :
 		AudioTrack(soundType),
 		_audsHeader(streamHeader),
diff --git a/video/avi_decoder.h b/video/avi_decoder.h
index 1e3f00693f2..b564cd4e678 100644
--- a/video/avi_decoder.h
+++ b/video/avi_decoder.h
@@ -202,7 +202,7 @@ protected:
 
 	class AVIVideoTrack : public FixedRateVideoTrack {
 	public:
-		AVIVideoTrack(int frameCount, const AVIStreamHeader &streamHeader, const BitmapInfoHeader &bitmapInfoHeader, byte *initialPalette = 0);
+		AVIVideoTrack(int frameCount, const AVIStreamHeader &streamHeader, const BitmapInfoHeader &bitmapInfoHeader, byte *initialPalette, Image::CodecAccuracy accuracy);
 		~AVIVideoTrack();
 
 		void decodeFrame(Common::SeekableReadStream *stream);
@@ -213,6 +213,7 @@ protected:
 		uint16 getBitCount() const { return _bmInfo.bitCount; }
 		Graphics::PixelFormat getPixelFormat() const;
 		bool setOutputPixelFormat(const Graphics::PixelFormat &format);
+		void setCodecAccuracy(Image::CodecAccuracy accuracy);
 		int getCurFrame() const { return _curFrame; }
 		int getFrameCount() const { return _frameCount; }
 		Common::String &getName() { return _vidsHeader.name; }
@@ -277,6 +278,8 @@ protected:
 
 		Image::Codec *_videoCodec;
 		const Graphics::Surface *_lastFrame;
+		Image::CodecAccuracy _accuracy;
+
 		Image::Codec *createCodec();
 	};
 
@@ -353,6 +356,7 @@ protected:
 
 	Common::Array<TrackStatus> _videoTracks, _audioTracks;
 	TrackStatus _transparencyTrack;
+
 public:
 	virtual AVIAudioTrack *createAudioTrack(AVIStreamHeader sHeader, PCMWaveFormat wvInfo);
 
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index a4e9cc85e63..9029143074c 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -47,6 +47,7 @@ VideoDecoder::VideoDecoder() {
 	_mainAudioTrack = 0;
 	_canSetDither = true;
 	_canSetDefaultFormat = true;
+	_videoCodecAccuracy = Image::CodecAccuracy::Default;
 }
 
 void VideoDecoder::close() {
@@ -567,6 +568,15 @@ bool VideoDecoder::setOutputPixelFormat(const Graphics::PixelFormat &format) {
 	return result;
 }
 
+void VideoDecoder::setVideoCodecAccuracy(Image::CodecAccuracy accuracy) {
+	_videoCodecAccuracy = accuracy;
+
+	for (Track *track : _tracks) {
+		if (track->getTrackType() == Track::kTrackTypeVideo)
+			static_cast<VideoTrack *>(track)->setCodecAccuracy(accuracy);
+	}
+}
+
 VideoDecoder::Track::Track() {
 	_paused = false;
 }
diff --git a/video/video_decoder.h b/video/video_decoder.h
index b2b3aca94f3..036c4e28dc0 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -29,6 +29,7 @@
 #include "common/rational.h"
 #include "common/str.h"
 #include "graphics/pixelformat.h"
+#include "image/codec-options.h"
 
 namespace Audio {
 class AudioStream;
@@ -406,6 +407,11 @@ public:
 	 */
 	bool setOutputPixelFormat(const Graphics::PixelFormat &format);
 
+	/**
+	 * Set the accuracy of the video decoder
+	 */
+	virtual void setVideoCodecAccuracy(Image::CodecAccuracy accuracy);
+
 	/////////////////////////////////////////
 	// Audio Control
 	/////////////////////////////////////////
@@ -596,6 +602,11 @@ protected:
 		 */
 		virtual bool setOutputPixelFormat(const Graphics::PixelFormat &format) { return false; }
 
+		/**
+		 * Set the image codec accuracy
+		 */
+		virtual void setCodecAccuracy(Image::CodecAccuracy accuracy) {}
+
 		/**
 		 * Get the current frame of this track
 		 *
@@ -1003,6 +1014,8 @@ protected:
 
 	VideoTrack *_nextVideoTrack;
 
+	Image::CodecAccuracy _videoCodecAccuracy;
+
 private:
 	uint32 _pauseLevel;
 	uint32 _pauseStartTime;


Commit: 25f0db3eb6bb2000368fc95acd3e7d9703891d32
    https://github.com/scummvm/scummvm/commit/25f0db3eb6bb2000368fc95acd3e7d9703891d32
Author: elasota (1137273+elasota at users.noreply.github.com)
Date: 2024-09-04T10:14:05+03:00

Commit Message:
VCRUISE: Add fast video decoder option

Changed paths:
    engines/vcruise/detection.h
    engines/vcruise/detection_tables.h
    engines/vcruise/metaengine.cpp
    engines/vcruise/runtime.cpp


diff --git a/engines/vcruise/detection.h b/engines/vcruise/detection.h
index 47f682a5497..cf490062508 100644
--- a/engines/vcruise/detection.h
+++ b/engines/vcruise/detection.h
@@ -65,6 +65,7 @@ struct VCruiseGameDescription {
 #define GAMEOPTION_INCREASE_DRAG_DISTANCE		GUIO_GAMEOPTIONS4
 #define GAMEOPTION_USE_4BIT_GRAPHICS			GUIO_GAMEOPTIONS5
 #define GAMEOPTION_PRELOAD_SOUNDS				GUIO_GAMEOPTIONS6
+#define GAMEOPTION_FAST_VIDEO_DECODER			GUIO_GAMEOPTIONS7
 
 
 } // End of namespace VCruise
diff --git a/engines/vcruise/detection_tables.h b/engines/vcruise/detection_tables.h
index 43f398a1f32..9877b04aabd 100644
--- a/engines/vcruise/detection_tables.h
+++ b/engines/vcruise/detection_tables.h
@@ -180,7 +180,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			ADGF_CD | VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::EN_GRB,
@@ -194,7 +194,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::DE_DEU,
@@ -209,7 +209,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::EN_GRB,
@@ -222,7 +222,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::EN_GRB,
@@ -235,7 +235,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::EN_GRB,
@@ -248,7 +248,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::PL_POL,
@@ -261,7 +261,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::DE_DEU,
@@ -274,7 +274,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::DE_DEU,
@@ -289,7 +289,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::EN_GRB,
@@ -303,7 +303,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::DE_DEU,
@@ -317,7 +317,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::ES_ESP,
@@ -331,7 +331,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::FR_FRA,
@@ -345,7 +345,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::HU_HUN,
@@ -359,7 +359,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::IT_ITA,
@@ -373,7 +373,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::PL_POL,
@@ -387,7 +387,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::RU_RUS,
@@ -404,7 +404,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::EN_GRB,
@@ -419,7 +419,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::DE_DEU,
@@ -434,7 +434,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::ES_ESP,
@@ -449,7 +449,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::FR_FRA,
@@ -464,7 +464,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::HU_HUN,
@@ -479,7 +479,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::IT_ITA,
@@ -494,7 +494,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::PL_POL,
@@ -509,7 +509,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES,
-			GUIO0()
+			GUIO1(GAMEOPTION_FAST_VIDEO_DECODER)
 		},
 		GID_SCHIZM,
 		Common::RU_RUS,
diff --git a/engines/vcruise/metaengine.cpp b/engines/vcruise/metaengine.cpp
index ae3b7eac247..3c22e374f56 100644
--- a/engines/vcruise/metaengine.cpp
+++ b/engines/vcruise/metaengine.cpp
@@ -102,6 +102,17 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 			0
 		}
 	},
+	{
+		GAMEOPTION_FAST_VIDEO_DECODER,
+		{
+			_s("Faster video decoder (lower quality)"),
+			_s("Reduce video decoding CPU usage at the cost of quality."),
+			"vcruise_fast_video_decoder",
+			false,
+			0,
+			0
+		}
+	},
 	AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
 
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index dd7ac2582a7..b9cc8925901 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -4624,6 +4624,10 @@ void Runtime::changeAnimation(const AnimationDef &animDef, uint initialFrame, bo
 
 		if (aviFile->open(aviFileName)) {
 			_animDecoder.reset(new Video::AVIDecoder());
+
+			if (ConfMan.hasKey("vcruise_fast_video_decoder") && ConfMan.getBool("vcruise_fast_video_decoder"))
+				_animDecoder->setVideoCodecAccuracy(Image::CodecAccuracy::Fast);
+
 			if (!_animDecoder->loadStream(aviFile)) {
 				warning("Animation file %i could not be loaded", animFile);
 				return;




More information about the Scummvm-git-logs mailing list